8️⃣Timed Events
Last updated
Last updated
Copyright © 2012- 2023 The Sandbox. All Rights Reserved.
Build Singleplayer & Multiplayer Logic - about [SP] or [MP] behaviours or components
Use this behaviour to choreograph precise logic triggers.
Options |
---|
The Timed Events Behaviour offers multiple ways to customise timers that can be used to trigger messages. These timers can be singular or repeating, and a parent timer within the behaviour can also house multiple sub-event timers.The flexibility of this tool makes it ideal for creating environmental cycles, periodic logic checks, and dynamic quest mechanics.The Timed Events Behaviour isn’t a visible countdown. All values set in the Properties Panel define variables that happen ‘behind the scenes’ and won't be displayed on the user interface.
If the Multiplayer version of this Behaviour has been selected, then the progression of an active Timed Event will be synchronized for ALL players, and the resulting messages sent by the Behaviour will also be synchronized for ALL players.For example, if a Timed Event sends messages for a [MP] Door Behaviour to open periodically, the progress of the Timed Event and the moment the Door Behaviour triggers will be experienced by ALL players simultaneously.Messages sent by Multiplayer Behaviours or Components can only be received by other Multiplayer Behaviours and Components. A Client Only Behaviour or Component can’t receive messages or send messages to a Multiplayer one.
If Wait for Message is set to ‘TRUE’, a message can be added that can be used to trigger the start of the Behaviour.If Wait for Message is set to ‘FALSE’, the Behaviour will start when the experience loads.
When set to ‘TRUE’, the Timed Events Behaviour will start again after all Timed Events, and Sub Events have expired.If the Reset Toggle is set to ‘FALSE’, then the Timed Event will need to be re-triggered to start again. Otherwise, it will remain inactive.ALLTimed Events AND Sub-Events need to elapse before the RESET triggers.
By default, the Timer name will be set to Element followed by a number until it has been customised.The name of the Timer won't appear ‘in-game’, but giving each Timed Event and Sub Event a clear name will help make each trigger identifiable, especially as events will move position if their times are changed.
This is where the trigger Time of Timed Events and triggers for Relative time on Sub Events are set.Two fields are available in this section - the left is measured in minutes, and the right is measured in seconds. Each field has a maximum value of 59.Once a time has been entered in these fields, it will also be added to the Event Name.If the time set is smaller or greater than Timed Events or Sub events before or after it, it will change position in the list.When the timer is activated, it will not be visible to the players.
This is the message the Timed Event or Sub Event will broadcast when the set Time has been reached.Create a new message or click on the field to access the drop-down menu containing existing messages.Keep in mind messages are space and case-sensitive.
Allows you to set the specific actors targeted by the message sent when the time is reached.
Because this is both a Client Only AND a Synchronized enabled Behaviour, make sure to select the appropriate option for your needs.In the Behaviour Panel, choose ‘Client Only’ for Single Player or ‘Synchronized’ for Multiplayer when adding it to an actor.Because this Behaviour doesn’t have any visible functions, it’s recommended to apply it to a Logic Asset. This makes them easier to identify as logic functions and reduces the face count in an experience, which improves performance.
This Behaviour has two key categories - Timed Events and Sub Events.Timed Events define the Primary Timer, which is the linear progression of time, in seconds, from the moment the Behaviour is activated to the moment the last timer has completed.Sub Events are created 'within' a Timed Event and only start once the parent Timed Event has been triggered. This means the time of a Sub-Event is set in reference to the triggering of the parent Timed Event, not in reference to the Primary Timer.
Timed Events define the moment at which a message is sent in reference to the Primary Timer, which is the elapsed time from the moment the Behaviour is triggered.A looping Timed Event used to send 3 different messages to an Animated Decoration Behaviour triggering 3 different animations.There can be multiple Timed Events within a single Behaviour, each defining the primary timeline.The order of the Timed Events is chronological, so even if one is created before another, the order will change based on the time assigned to them.For example, if Timed Event 1 is set to 00:01 and Timed Event 2 is set to 00:02, then Timed Event 1 will be both listed first AND triggered first.However, if the Time for Timed Event 1 is changed to 00:03, then Timed Event 2 will move up in order, and Timed Event 1 will be triggered second.Timed Events won't change their listing order in the Properties Panel until after the Behaviour has been run in Play Mode.
Sub Events are ‘children’ of the primary Timed Event and will trigger relative to the elapsed time of the parent.Animations triggered by Timed Events (GREEN) and Sub Events (BLUE) - all in one Timed Event BehaviourFor example, if a Timed Event is set to trigger at 10 seconds, its first Sub Event won't start until 10 seconds have elapsed.
Both Timed Events and Sub Events use the same settings. However, there are some clear differences regarding the order of execution.Timed Events trigger chronologically along the primary timeline, with the primary timeline starting as soon as the Behaviour is triggered.Sub Events trigger ‘relative’ to the time of the parent Timed Event. So if a Timed Event is set to 00:01 and has a Sub Event set to 00:01, then the Sub Event will actually occur at 00:02 along the primary timeline.A good way to figure out the time of a Sub Event is to add its time to the time of the parent Timed Event OR (TE + SE = PT)It’s also important to note that Timed Events following the initial Timed Event won't wait for the Sub Events of previous Timed Events to complete before they trigger.6 Timed Events establish triggers along the Primary Timer. 5 Sub Events triggered by the first Timed Event.For example, if Timed Event 1 is set to 00:02 and has a Sub Event set to 00:03, but there’s also a Timed Event 2 set to 00:04, then Timed Event 1 AND 2 will trigger before the Sub Event. Even though the Sub Event comes before Timed Event 2 in the list, the time of the Sub Event is relative to the parent Timed Event and is actually triggered at 00:05 along the primary timeline.This can be visualised as follows:
At the bottom of the Properties Panel, there is a button to add more Timed Events. These will appear in order of creation until the Time is set, at which point they will be rearranged in chronological order.Within each Timed Event is the option to add extra Sub Events.Sub Events will appear in the order they have been created until their Time is set to something other than 0:0, at which point they will also rearrange to fit their chronological order.
When a message is received, send a series of messages after specified times.