Access variable from c#

Announcements, support questions, and discussion for the Dialogue System.
hrohibil
Posts: 369
Joined: Thu Nov 04, 2021 12:50 pm

Re: Access variable from c#

Post by hrohibil »

That looks exactly what I need.
One question though.

As in my cutscene I use an empty as a camera and the location is far away from current place so I put the seconds to like 0.1 so it almost instantly moves to target.

But is there a way to delay like 1.5 seconds before it starts the cutscene based on number enemies killed?

Because as I am doing the last enemy kill I am holding the mouse button down and are shooting as soon as he dies the camera switches instantly and I miss the initial node dialogue because I was still holding mouse button down so it continued to next node..
User avatar
Tony Li
Posts: 22144
Joined: Thu Jul 18, 2013 1:27 pm

Re: Access variable from c#

Post by Tony Li »

Configure a separate Dialogue System Trigger to start the conversation. Let's call is "Dialogue System Trigger 2" for now. Set it to OnUse.

On the original Dialogue System Trigger, don't use the Start Conversation action. Instead, add a Timed Event component to the same GameObject. Set the Dialogue System Trigger's Add Action > OnExecute() Event to call TimedEvent.StartTimer. On the Timed Event component, set Seconds to 5. Configure the OnTimeReached() event to call Dialogue System Trigger 2's OnUse.
hrohibil
Posts: 369
Joined: Thu Nov 04, 2021 12:50 pm

Re: Access variable from c#

Post by hrohibil »

Why is my "start conversation " greyed out?

I was following your post.

hrohibil
Posts: 369
Joined: Thu Nov 04, 2021 12:50 pm

Re: Access variable from c#

Post by hrohibil »

UPDATE:

I solved the "greyed out start conversation".

My new issue is, I am using Emerald AI for the enemies, and as you can see when they die, I don't see them being destroyed.
I tried changing the Increment on destroy to disable but that did not help either.

What other way can i use this?

UPDATE # 2:
My workaround was to create a little script that looked at when Enemy IsDead then destroy GO after like 1 sec and set the incremement to onDestroy. This seemd to do the trick.
But was hoping tere was another way??



UPDATE # 3

Following your guide regarding the second Dialogue system trigger, as i set it to OnUse, as soon as i start the game it plays the sequence??

User avatar
Tony Li
Posts: 22144
Joined: Thu Jul 18, 2013 1:27 pm

Re: Access variable from c#

Post by Tony Li »

Hi,

I'm sorry; I missed this post.
hrohibil wrote: Sun Aug 07, 2022 3:30 amMy workaround was to create a little script that looked at when Enemy IsDead then destroy GO after like 1 sec and set the incremement to onDestroy. This seemd to do the trick.
But was hoping tere was another way??
The Emerald AI has an OnDeath() UnityEvent. Configure this UnityEvent to call IncrementOnDestroy.TryIncrement.
hrohibil wrote: Sun Aug 07, 2022 3:30 amFollowing your guide regarding the second Dialogue system trigger, as i set it to OnUse, as soon as i start the game it plays the sequence??
Something is sending OnUse to the trigger. Maybe a TimedEvent component?
Post Reply