Skip to reading
Action Lists & Events

10. Keep a one-time reward one-time

Edition 0.86.4.3

0.86.4.3 edition with revised lessons, updated cross-references and new cinematic/camera-safety supplements. Earlier examples, screenshots and registry figures retain their stated edition context.

Download PDFView illustrations

An event can happen more than once. Hover can happen whenever the pointer returns. Enter can happen whenever the player walks back in. A saved story flag is the dependable way to remember that a reward or greeting has already happened.

1. Create a visual script called Welcome, Once, with ID welcome_once.

2. Start with On Interact and connect Next to If Variable.

3. Select greeted, Equals true. Connect True to End.

4. Connect False to Set Variable: greeted = true.

5. Connect that node to Show Message: Welcome to the signal room. Set Duration to 2.2.

Figure 8. The True path ends; the False path marks the flag before showing the greeting.

Set the flag before a long message, sound or animation. That way, another entry route sees that the event is already underway. Adapt the same pattern to key_taken before the pickup reward.

A trigger's temporary re-entry guard prevents overlapping execution of the same event while it is busy. It does not mean "only once in the whole game." That is the variable's job.

Page 14 of 189Permalink
Go to page