Page 1 of 1

What's the proper way to only show an alert once?

Posted: Sat May 25, 2024 2:34 pm
by Razputin
I have the following tree
asd.png
asd.png (172.93 KiB) Viewed 280 times
When the player first goes down this branch I would like to play an alert that says "New Quest..."
I would like this to only happen the first time they go down this tree.

What's the best way to ensure that it only happens the first time?

Here is what the "Quest Alert" node looks like at the moment.
daaa.png
daaa.png (34.83 KiB) Viewed 280 times
It seems like even though there's no dialog you still have to press the advance key to get past this "Quest Alert" node. Is there a way to just passthrough the node and execute the scripts in it without waiting for the continue button to be pressed. Or perhaps there's a cleaner way to do this entire thing.

Thanks!

Re: What's the proper way to only show an alert once?

Posted: Sat May 25, 2024 3:11 pm
by Tony Li
Hi,

There are two parts to this:

1. To pass through a node without showing any text or waiting for a continue button click, tick the node's Group checkbox or set its Sequence field to:

Code: Select all

Continue()
This will simulate an immediate continue button click. If you don't want to type it, from the "+" menu select Continue > Simulate Continue Button Click.

2. To show a node only once, set Conditions. I see that you've set Conditions on this node already, and it looks like those Conditions should work fine with #1 above. If you wanted to allow the player to reach some node more than once but only show the alert once, you could use an "if..then" statement in the Script field, such as:

Code: Select all

if (Variable["ShowedThisAlert"] ~= true) then
   Variable["Alert"] = "This is an alert"
   Variable["ShowedThisAlert"] = true
end

Re: What's the proper way to only show an alert once?

Posted: Sat May 25, 2024 3:18 pm
by Razputin
That makes sense, thanks so much!

Re: What's the proper way to only show an alert once?

Posted: Sat May 25, 2024 3:35 pm
by Tony Li
Glad to help!