Skip to reading
Visual Scripting in Depth

48. Listen with On Event

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

Figure 31. On Event selects an engine event. The dispatcher starts that entry when the event is emitted.

1. Create a separate listener graph, such as custom_listener.

2. Add On Event. Choose OnCustomEvent for this first example.

3. Connect it to a simple condition or variable update.

4. Save and restart the preview so it contains the new listener.

5. Cause the real event, or use Emit Event from another graph.

On Event entries are found across the project’s Visual Scripts. They are different from an On Interact graph that must be assigned to a particular object. A listener can react without being assigned to the object’s own verb action.

Several event entries can live in one graph. The dispatcher supplies the matching entry node ID. A default manual run does not test every entry, and it does not reproduce every event’s context.

Do not put duplicate reward logic in both a global OnInteraction listener and the object’s own Use action. Both can be reached for one player interaction. Give one system responsibility for the reward.

Page 52 of 93Permalink
Go to page