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