Trigger Random answer?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Hereder
Posts: 76
Joined: Mon Dec 21, 2020 2:53 am

Trigger Random answer?

Post by Hereder »

Hi
I wonder if there is a simple way to allow my NPC to say one of 3 random options.
Is there anything I can write in the "Sequence" slot - Like "GoRandom()" similar to how we can write "None()" to ignore the slot all togheter...
random.png
random.png (55.59 KiB) Viewed 921 times
Thanks in advance!
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Trigger Random answer?

Post by Tony Li »

Hi,

Yes. Set the Doomsday node's Sequence field or Script field to:

Code: Select all

RandomizeNextEntry()
There's a sequencer command and a Lua function by that name, so you can use either field.
Hereder
Posts: 76
Joined: Mon Dec 21, 2020 2:53 am

Re: Trigger Random answer?

Post by Hereder »

Fantastic, thank you soo much!
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Trigger Random answer?

Post by Tony Li »

Glad to help!
Hereder
Posts: 76
Joined: Mon Dec 21, 2020 2:53 am

Re: Trigger Random answer?

Post by Hereder »

Btw, late reply but I ran in to a situation. Is it possible to combine RandomizeNextEntry() and None() ?
So the three, I leave it empty None() yet we randomnice the next entry?
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Trigger Random answer?

Post by Tony Li »

Hi,

I don't fully understand. Can you provide a screenshot of how you'd want to configure the conversation?
Post Reply