Recurring Dialogues with Invector

Announcements, support questions, and discussion for Quest Machine.
Post Reply
TattooRose
Posts: 21
Joined: Wed May 15, 2019 7:42 am

Recurring Dialogues with Invector

Post by TattooRose »

Hi Tony,

I continued with the updates you posted and for the demo scene with the shooter character it seemed like the recurring dialogues issue was resolved. I then started my own scene using my character model making sure all the rigged parts were tagged as the original along with the layers.

Here is what I started to see, when I enter a guest giver trigger. The initial dialogue to accept the quest comes up, then I accept the quest, as soon as I try to walk away from the trigger the Dialogue keep popping up and I keep having to hit enter as I press the move key to finally get out of the guest givers trigger range.

I went into the code and trapped the OnTriggerEnter event in the class TriggerEvent. Here I discovered, for every collider on my rig the event was firing. I confirmed this by outputting the tag and the name of other parameter. I then looked at the IsInTagMask property which lead me to TagMask. There I saw the tag array which is set to the value 'Player'.

So, at first glance it seems that the test should return on objects that do not have the Player tag assigned.

In order to work around this in my environment I went ahead and named my player 'Player'. I then added a test underneath the !IsInTagMask test to check if the name of the object was Player. If it was not, I then returned before the call to Invoke the OnTriggerEnter event.

Once I did that the system performed as expected.

Here is the code I modified.
protected virtual void OnTriggerEnter(Collider other)
{
if (!IsInTagMask(other.tag)) return;
if (string.Compare(other.name, "Player", StringComparison.OrdinalIgnoreCase) != 0) return;
Debug.Log("Other Tag: " + other.tag + " Other Name: " + other.name);
onTriggerEnter.Invoke(other.gameObject);
}

Now this is a quick fix to the issue I am seeing and probably not the proper one. Maybe I have something setup incorrectly, not sure. Any help will be appreciated.

Thanks,
TattooRose
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Recurring Dialogues with Invector

Post by Tony Li »

Hi,

At runtime, Invector changes the tags all of the player's child GameObjects that have colliders to 'Player'. But, at least in the included example scenes, it deactivates most of the child colliders. The example scenes also have their layers set to 'BodyPart'.

If you can't have it set up that way for some reason, I recommend making a subclass of Trigger Event. This way you can override the OnTriggerEnter event without directly modifying the original script. When you import an updated version of Quest Machine, your changes won't be overwritten this way.

Or, perhaps better yet, look at the new example scene included with Quest Machine's integration. (Or the Dialogue System's integration.) They both now use Invector's interaction system. That might work better and also be more consistent with how the player interacts with other Invector interactables.
TattooRose
Posts: 21
Joined: Wed May 15, 2019 7:42 am

Re: Recurring Dialogues with Invector

Post by TattooRose »

Hi,

I will definitely look at the newer examples. Do I already have the new scenes or are they in the latest build you posted? If so I will need to wait for Unity to upload your latest.

Thanks again,
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Recurring Dialogues with Invector

Post by Tony Li »

They're in the newest packages on the site.
Post Reply