Page 1 of 1

Recurring Dialogues with Invector

Posted: Sat May 18, 2019 10:55 am
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

Re: Recurring Dialogues with Invector

Posted: Sat May 18, 2019 11:22 am
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.

Re: Recurring Dialogues with Invector

Posted: Sat May 18, 2019 11:54 am
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,

Re: Recurring Dialogues with Invector

Posted: Sat May 18, 2019 12:10 pm
by Tony Li
They're in the newest packages on the site.