Page 2 of 3

Re: OnTriggerEnter combined with Button Press

Posted: Tue May 31, 2016 10:43 pm
by supadupa64
I would probably just use a quest trigger component and set it to "on use" and add a variable alert that says "nice tv." But Tony probably has a better way.

Re: OnTriggerEnter combined with Button Press

Posted: Tue May 31, 2016 11:00 pm
by Tony Li
I'd use barks. You still have to write a one line conversation, but it's a bit simpler.

(BTW, you can organize conversations in groups by using the "/" character in the title. For example, you could group all your item interaction conversations in an "Items" submenu by titling them "Items/TV", "Items/Toaster", "Items/Oven", etc.)

Create a conversation where the player says "Nice TV!".

Then add a Bark Trigger to the TV. Set the trigger to OnUse, select the conversation, and assign the player as the Conversant.

Finally, add a bark UI to your player.

When the player interacts with the TV, the Bark Trigger will show a one-off line "Nice TV!" through the player's bark UI, which is usually above the player's head.

Re: OnTriggerEnter combined with Button Press

Posted: Wed Jun 01, 2016 8:28 pm
by Xpyke
Tony Li wrote:I'd use barks. You still have to write a one line conversation, but it's a bit simpler.

(BTW, you can organize conversations in groups by using the "/" character in the title. For example, you could group all your item interaction conversations in an "Items" submenu by titling them "Items/TV", "Items/Toaster", "Items/Oven", etc.)

Create a conversation where the player says "Nice TV!".

Then add a Bark Trigger to the TV. Set the trigger to OnUse, select the conversation, and assign the player as the Conversant.

Finally, add a bark UI to your player.

When the player interacts with the TV, the Bark Trigger will show a one-off line "Nice TV!" through the player's bark UI, which is usually above the player's head.
supadupa64 wrote:I would probably just use a quest trigger component and set it to "on use" and add a variable alert that says "nice tv." But Tony probably has a better way.
I went with barks and it's working really well, thanks for the amazing support!

Re: OnTriggerEnter combined with Button Press

Posted: Wed Jun 01, 2016 10:24 pm
by Tony Li
Glad to help!

Re: OnTriggerEnter combined with Button Press

Posted: Mon Sep 12, 2016 10:25 am
by OneManOnMars
Tony Li wrote:
that's a good question. Here's my reasoning: In a lot of games (especially 2D console games), a common way to start conversations is by walking up to an NPC and pressing an action button. The ProximitySelector is designed to work like that.
That is exactly the reason. I don't want the player talk to a npc when he is to far away and. The same button is used for other things, so the conversation would get triggered all the time if I would not check the proximity

Re: OnTriggerEnter combined with Button Press

Posted: Mon Sep 12, 2016 10:35 am
by Tony Li
OneManOnMars wrote:
Tony Li wrote:
that's a good question. Here's my reasoning: In a lot of games (especially 2D console games), a common way to start conversations is by walking up to an NPC and pressing an action button. The ProximitySelector is designed to work like that.
That is exactly the reason. I don't want the player talk to a npc when he is to far away and. The same button is used for other things, so the conversation would get triggered all the time if I would not check the proximity
Were you able to get the ProximitySelector working in your scene? (Remember there's also a demo scene here if you'd like to see an example.) If I can help with anything, just let me know!

Re: OnTriggerEnter combined with Button Press

Posted: Thu Nov 10, 2016 4:32 am
by OneManOnMars
Hi Tony,
yes it works. Thank you. The only thing right now that is not perfect is, that I have a text above the character that says Press A. But what I would prefere is to just show a image of the button. Didn't find the solution to that yet. But the functionality is working.

Re: OnTriggerEnter combined with Button Press

Posted: Thu Nov 10, 2016 8:22 am
by Tony Li
Hi,

The easiest way is to use Unity UI. Here are the steps:

1. Let's assume your player already has a Proximity Selector component. Add a Unity UI Selector Display component, too.

2. Create a Unity UI Canvas in your scene if there isn't one already. If you're using the Dialogue Manager prefab from the Prefabs folder, it already has one as a child GameObject.

3. Add Prefabs/Unity UI Prefabs/Generic/Generic Unity UI Selector Panel to the Canvas.

Play the scene and make sure it's working. To see an example of what the Generic Unity UI Selector Panel looks like, play the scene Examples/Unity UI Examples/Generic UI Example Scene. This uses a Selector, not a Proximity Selector, but the Generic Unity UI Selector Panel is the same.

Then customize it. You can change the Reticle In Range and Reticle Out Of Range images, add other images and backgrounds to the Selection Text Panel, etc.

Re: OnTriggerEnter combined with Button Press

Posted: Wed Nov 16, 2016 11:09 am
by OneManOnMars
Thanks a lot I'll try to put it in as soon as I am back on the task

Re: OnTriggerEnter combined with Button Press

Posted: Wed Nov 16, 2016 11:16 am
by Tony Li
Sounds good! If you get stuck on anything, just let me know.