Page 3 of 3

Re: Access variable from c#

Posted: Sat Aug 06, 2022 8:45 pm
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..

Re: Access variable from c#

Posted: Sat Aug 06, 2022 8:54 pm
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.

Re: Access variable from c#

Posted: Sun Aug 07, 2022 3:20 am
by hrohibil
Why is my "start conversation " greyed out?

I was following your post.


Re: Access variable from c#

Posted: Sun Aug 07, 2022 3:30 am
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??


Re: Access variable from c#

Posted: Fri Sep 02, 2022 11:02 am
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?