Variable State Listener

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
eeeli
Posts: 49
Joined: Tue Oct 05, 2021 4:54 pm

Variable State Listener

Post by eeeli »

Hello,

I'm looking to trigger an event when a particular variable is flipped, and I was wondering if there was functionality similar to the Quest State Listener. I was using a Quest State Listener at first, but realized that it wasn't quite right given my set up.

I see how I could also use a Sequencer Command, however it feels clunky given I have a helper script that is already set up in the hierarchy that I would like to simply trigger - but as far as I can tell Sequencer Commands can't point to objects I've set up in the scene (unless I use a singleton, which I'd like to avoid).

Apologies if I've missed something! Any advice would be helpful :)
User avatar
Tony Li
Posts: 22152
Joined: Thu Jul 18, 2013 1:27 pm

Re: Variable State Listener

Post by Tony Li »

You can use a Lua Observer with frequency set to Every Dialogue Entry. However, keep in mind that it will check the variable after every dialogue entry.

You may find it to be more efficient to use a scene event.
eeeli
Posts: 49
Joined: Tue Oct 05, 2021 4:54 pm

Re: Variable State Listener

Post by eeeli »

Thanks for turning my attention to Scene Events! That's exactly the tool I was looking for :)
User avatar
Tony Li
Posts: 22152
Joined: Thu Jul 18, 2013 1:27 pm

Re: Variable State Listener

Post by Tony Li »

Glad to help!
Post Reply