onTriggerEnter tag problems

Announcements, support questions, and discussion for the Dialogue System.
nitrox32
Posts: 68
Joined: Sat Dec 01, 2018 10:41 am

onTriggerEnter tag problems

Post by nitrox32 »

I recently bought Dialogue System to integrate with Opsive's TPC. I'm finding this to be a bit overwhelming as I still relatively new to both products. What I would like to do is have my Character start a conversation upon entering the trigger of a NPC. Currently, I am able to do this by adding the Dialogue System Trigger Intractable Target script to the NPC (currently a capsule) and set the Trigger to On Trigger Enter. When I walk to the NPC everything works as expected. However when I add Player to the Accepted Tags the trigger doesn't fire and the conversation doesn't start. My TPC character's tag is set to Player. What am I missing?
User avatar
Tony Li
Posts: 22057
Joined: Thu Jul 18, 2013 1:27 pm

Re: onTriggerEnter tag problems

Post by Tony Li »

Hi,

Thanks for buying the Dialogue System!

For TPC characters, the collider is in a child GameObject hierarchy named "Colliders". Try this:

1. Inspect the collider (e.g., <YourCharacter> / Colliders / Capsule Collider). Change its tag to 'Player'.

2. Inspect the Dialogue System Trigger Interactable Target. Assign the main character GameObject, not the child collider, to the Conversation Actor field.
nitrox32
Posts: 68
Joined: Sat Dec 01, 2018 10:41 am

Re: onTriggerEnter tag problems

Post by nitrox32 »

Perfect! Now all I need to do is stop the character movement when the dialogue windows are open. In other words, the mouse cursor should be allowed to select dialogue but not allow player movement during conversations. How do I do this?
User avatar
Tony Li
Posts: 22057
Joined: Thu Jul 18, 2013 1:27 pm

Re: onTriggerEnter tag problems

Post by Tony Li »

The character needs a Converse ability and a Conversing state as described in this section of the documentation.

The Converse ability detects when the character is involved in a conversation and disables character movement.

The Conversing state shows the mouse cursor during conversations.
nitrox32
Posts: 68
Joined: Sat Dec 01, 2018 10:41 am

Re: onTriggerEnter tag problems

Post by nitrox32 »

That did it! The only thing that I had to change from your example is the that you have "Detect Horizontal Collisions" and "Detect Vertical Collisions" in the Converse Ability set to False. I found that these settings caused my character to fall through the floor. When I set these to No Override everything works perfectly. Thanks!
User avatar
Tony Li
Posts: 22057
Joined: Thu Jul 18, 2013 1:27 pm

Re: onTriggerEnter tag problems

Post by Tony Li »

Thanks; I'll update the screenshot in the next version if not sooner.
nitrox32
Posts: 68
Joined: Sat Dec 01, 2018 10:41 am

Re: onTriggerEnter tag problems

Post by nitrox32 »

OK, everything is working fine in the test scene I created. However when I attempt to incorporate it into my game nothing happens. I have everything set up exactly as the test scene. I can't even get a conversation to start when the trigger is set to onStart in the Dialogue System Trigger Intractable Target script. I'm not even using tags. Any thoughts?
User avatar
Tony Li
Posts: 22057
Joined: Thu Jul 18, 2013 1:27 pm

Re: onTriggerEnter tag problems

Post by Tony Li »

Hi,

Are there any warnings in the Console window?

Make sure your Dialogue System Trigger has a Start Conversation action with a valid conversation selected. More than once, I've started to set up a Dialogue System Trigger then got distracted by something else and forgot to actually select the conversation.

Temporarily set the Dialogue Manager's Debug Level to Info. This will log a lot of info to the Console window. Look for lines like:

Code: Select all

Dialogue System: Starting conversation 'AAA' with actor=XXX and conversant=YYY
nitrox32
Posts: 68
Joined: Sat Dec 01, 2018 10:41 am

Re: onTriggerEnter tag problems

Post by nitrox32 »

Ok, newbie mistake, I missed step one - add the Dialogue Manager. Well that was embarrassing ;) The only thing I still am not able to figure out is why the mouse cursor appears on the screen when runtime begins and at the first conversation. After I exit the conversation the mouse cursor does not appear in game and during the next conversation. After I exit the conversation again the cursor appears in game again and when I return to conversation. Probably another newbie mistake but could you point me in the right direction?
User avatar
Tony Li
Posts: 22057
Joined: Thu Jul 18, 2013 1:27 pm

Re: onTriggerEnter tag problems

Post by Tony Li »

The Conversing state should control the mouse cursor during conversations.

Inspect your character's Unity Input component. At the bottom of the States list, click "+" to add a new state. Set the name to Conversing (spelled exactly like that). Assign the preset in Pixel Crushers / Dialogue System / Third Party Support / Opsive UCC Support / Data named "ConversingUnityInputPreset". Reposition it to be the top state in the list.

Finally, inspect the Dialogue Manager's Input Device Manager component. Untick "Detect Mouse Control". When this is ticked, it will detect if you move the mouse; if so, it will show the cursor. For Opsive's controller, it's better to let the Conversing state handle it.
Post Reply