Logic Actions
Built-in authoring reference for Mercury 1.0.1. All actions.
Call Inherited Event
Runs the parent Object’s version of this Event before continuing. A child’s Event replaces its parent’s only in the same Logic Component; Events in different Components all run.
Reference key: callInherited.
Editor category: Logic > Events and Logic.
Example: In a Child Object Event, call parent Logic before custom Logic.
Cancel Input Sequence Mode
Stops sequence recording and discards the current tokens without pressing any Command.
Reference key: cancelInputSequenceMode.
Editor category: Logic > Input.
Example: Cancel Input Sequence Mode when the input screen closes.
Change Variable
Changes one declared variable: a Local Variable of this Logic (private to this Logic Component, or to this call of a Function), a Data Structure field of the targeted Object when Applies To names another Object, or a Global. A field of Self’s own Data Structure is changed with Change Component Value and read as self.<data>.<field>, for example self.stats.health. Global declarations use the same $name spelling as expressions and are game-wide state shared by every Logic Component and Function. Values may use expressions such as owner.transform.position.x, practiceDueCount(), storyText(count), and storyCount().
Reference key: setVariable.
Editor category: Logic > Variables and State.
Example: Add 1 to the Logic variable combo, or add 100 to $score.
Choose the target instance with the Action’s Applies To field.
| Parameter | Type | Optional | Details |
|---|---|---|---|
| Scope | enum | No | Choose one of the listed options. Choices: local, global. Default: “local”. |
| Variable | text | No | Text value; some actions also accept $global names. |
| Operator | enum | Yes | Choose one of the listed options. Choices: =, +=, -=, *=, /=. Default: “=”. |
| Value | number | No | Expression or literal value. |
Clear Input Sequence
Removes every recorded token while keeping Input Sequence Mode active.
Reference key: clearInputSequence.
Editor category: Logic > Input.
Example: Clear the sequence when the player chooses Try Again.
Combine Event Logic
Changes the Event to Combined behavior and adds the selected Event Logic. Active Event Logic runs in authored order.
Reference key: combineEventLogic.
Editor category: Logic > Event Logic.
Example: Combine Armed with Walking so movement Logic runs before weapon Logic on each Step.
Choose the target instance with the Action’s Applies To field.
| Parameter | Type | Optional | Details |
|---|---|---|---|
| Event | enum | No | Value for Event. Default: “current”. |
| Event Logic | enum | No | Value for Event Logic. |
Comment
Adds a note for humans; it does not affect gameplay.
Reference key: comment.
Editor category: Logic > Logic and Flow.
Example: Add a note explaining why a branch exists.
| Parameter | Type | Optional | Details |
|---|---|---|---|
| Text | text | No | Text value; some actions also accept $global names. |
Control Command Rebinding
Starts or cancels one next-input or simultaneous-chord capture session. Captured input becomes active only after release. Resetting every saved binding is a separate Atomic.
Reference key: controlCommandRebinding.
Editor category: Logic > Input.
Example: Start rebinding Dash [button] to a [chord] on [keyboard].
| Parameter | Type | Optional | Details |
|---|---|---|---|
| Operation | enum | No | Choose one of the listed options. Choices: start, cancel. Default: “start”. |
| Input Context | enum | No | Value for Input Context. Shown when Operation is start. |
| Command | enum | No | Value for Command. Shown when Operation is start. |
| Command Channel | enum | No | A compatible keyboard or mouse channel of the selected Command. Choices: button, negative, positive, left, right, up, down. Default: “button”. Shown when Operation is start. |
| Device | enum | No | Choose one of the listed options. Choices: keyboard, mouse. Default: “keyboard”. Shown when Operation is start. |
| Capture | enum | No | Chord records two to four simultaneous buttons and is available only for a Button Command channel. Choices: single, chord. Default: “single”. Shown when Operation is start. |
| Timeout (seconds) | number | Yes | Zero waits until input, cancellation, or focus loss. Default: 15. Shown when Operation is start. |
Exit Event
Stops running the rest of this event.
Reference key: exit.
Editor category: Logic > Logic and Flow.
Example: After handling a special case, exit so later actions do not run.
Fire Event In Radius
Fires the named Custom Event once on every other live instance whose origin is within the radius. The receiving event can use Other to refer back to the source instance.
Reference key: fireEventInRadius.
Editor category: Logic > Events and Logic.
Example: When a bomb detonates, fire “explode” within 3.7 meters so nearby crates and enemies can react.
| Parameter | Type | Optional | Details |
|---|---|---|---|
| Event | text | No | Named custom event to trigger. |
| Radius | number | No | Number value; decimals are allowed. Default: 3.6875. |
Generate Random 2D Vector
Makes one random Vec2. Later expressions can read the complete value or its X and Y members; use Change Variable only to retain a copy.
Reference key: generateRandomVector2D.
Editor category: Logic > Random and Noise.
Example: Generate a 2D vector from length [80] to [120], then store randomVector2DResult.value or read randomVector2DResult.value.x.
| Parameter | Type | Optional | Details |
|---|---|---|---|
| Minimum Length | number | No | The shortest possible vector length. Negative values are treated as zero. Default: 0. |
| Maximum Length | number | No | The longest possible vector length. Reversed endpoints are accepted. Default: 1. |
Results
| Field | Type | Description |
|---|---|---|
| value | vec2 | |
| value.x | number | |
| value.y | number |
Generate Random Integer
Makes a whole number between Minimum and Maximum, including both endpoints, using the seeded gameplay random stream. Later expressions can read the produced value directly; use Change Variable only to retain a copy.
Reference key: generateRandomInteger.
Editor category: Logic > Random and Noise.
Example: Generate an integer from [1] to [6], then use randomIntegerResult.value in a later expression.
| Parameter | Type | Optional | Details |
|---|---|---|---|
| Minimum | number | No | The lowest possible whole number. Reversed endpoints are accepted. Default: 0. |
| Maximum | number | No | The highest possible whole number, included in the range. Reversed endpoints are accepted. Default: 100. |
Results
| Field | Type | Description |
|---|---|---|
| value | number |
Generate Random Number
Makes a decimal number between Minimum and Maximum using the seeded gameplay random stream. Later expressions can read the produced value directly; use Change Variable only to retain a copy.
Reference key: generateRandomNumber.
Editor category: Logic > Random and Noise.
Example: Generate a number from [0] to [1], then use randomNumberResult.value in a later expression.
| Parameter | Type | Optional | Details |
|---|---|---|---|
| Minimum | number | No | The lower endpoint. Reversed endpoints are accepted. Default: 0. |
| Maximum | number | No | The upper endpoint. Reversed endpoints are accepted. Default: 1. |
Results
| Field | Type | Description |
|---|---|---|
| value | number |
If
Runs its Then branch when its generic value comparisons are true. Produce live facts with Actions first, then compare their declared results here.
Reference key: if.
Editor category: Logic > Logic and Flow.
Example: Run Check Grounded, then compare groundedResult.value == true and speed > 0.
| Parameter | Type | Optional | Details |
|---|---|---|---|
| Comparisons | conditionList | No | The flat Compare Values rows rendered by the visual Condition editor. |
Invoke Function Parameter
Calls the Function assigned to this Logic attachment input.
Reference key: invokeFunctionInput.
Editor category: Logic > Events and Logic.
| Parameter | Type | Optional | Details |
|---|---|---|---|
| Function Parameter | functionInput | No | Value for Function Parameter. |
Region
A named, colored visual region for organizing Actions without changing their execution order or scope. Alt-drag or use the block menu to change membership.
Reference key: logicRegion.
Editor category: Logic > Logic and Flow.
| Parameter | Type | Optional | Details |
|---|---|---|---|
| Label | text | No | Text value; some actions also accept $global names. Default: “Region”. |
| Color | color | No | Value for Color. Default: “#22C55E”. |
Remove Event Logic
Removes the selected Event Logic without changing the Event’s other active Event Logic or its current Single or Combined behavior.
Reference key: removeEventLogic.
Editor category: Logic > Event Logic.
Example: Remove Armed from Step when the character puts its weapon away.
Choose the target instance with the Action’s Applies To field.
| Parameter | Type | Optional | Details |
|---|---|---|---|
| Event | enum | No | Value for Event. Default: “current”. |
| Event Logic | enum | No | Value for Event Logic. |
Repeat
Runs its vertical child stack Count times. Expressions inside the stack can read blockLocal(“index”) and blockLocal(“count”) for this loop.
Reference key: repeat.
Editor category: Logic > Logic and Flow.
Example: Repeat enemyCount times, then Create Instance inside the child stack using blockLocal(“index”) for spacing.
| Parameter | Type | Optional | Details |
|---|---|---|---|
| Count | number | No | Whole number value. Default: 1. The runtime rounds down to a whole count and clamps negative values to zero. Count 0 skips the child stack. |
Reset Command Bindings
Removes every player-authored Command binding override and restores the project defaults. Any active capture is cancelled first.
Reference key: resetCommandBindings.
Editor category: Logic > Input.
Example: From an input settings menu, Reset Command Bindings after the player confirms Restore Defaults.
Reset Event Logic
Restores the selected Object Event to its authored Single or Combined behavior, starting Event Logic, and order.
Reference key: resetEventLogic.
Editor category: Logic > Event Logic.
Example: Reset the Step Event Logic when a temporary gameplay mode ends.
Choose the target instance with the Action’s Applies To field.
| Parameter | Type | Optional | Details |
|---|---|---|---|
| Event | enum | No | Value for Event. Default: “current”. |
Sample 1D Noise
Samples smooth deterministic noise from -1 to 1. Later expressions can read the produced value directly; identical inputs always return the same value.
Reference key: sampleNoise1D.
Editor category: Logic > Random and Noise.
Example: Sample noise at X [$time] with Frequency [0.2] and Seed [7], then use noise1DResult.value for a smooth flicker.
| Parameter | Type | Optional | Details |
|---|---|---|---|
| X | number | No | The position along the noise field. Default: 0. |
| Frequency | number | No | Scales the coordinate before sampling. Smaller values change more gradually. Default: 0.01. |
| Seed | number | No | A whole-number seed selecting a repeatable noise field. Default: 0. |
Results
| Field | Type | Description |
|---|---|---|
| value | number |
Sample 2D Noise
Samples smooth deterministic planar noise from -1 to 1. Later expressions can read the produced value directly; identical inputs always return the same value.
Reference key: sampleNoise2D.
Editor category: Logic > Random and Noise.
Example: Sample 2D noise at [X] and [Y] with Frequency [0.03] to vary terrain, color, or motion smoothly.
| Parameter | Type | Optional | Details |
|---|---|---|---|
| X | number | No | The horizontal position in the noise field. Default: 0. |
| Y | number | No | The vertical position in the noise field. Default: 0. |
| Frequency | number | No | Scales both coordinates before sampling. Smaller values change more gradually. Default: 0.01. |
| Seed | number | No | A whole-number seed selecting a repeatable noise field. Default: 0. |
Results
| Field | Type | Description |
|---|---|---|
| value | number |
Set Event Logic
Changes the Event to Single behavior and makes only the selected Event Logic active. It takes effect on the Event’s next firing.
Reference key: setEventLogic.
Editor category: Logic > Event Logic.
Example: When the player enters water, set the Step Event Logic to Swimming and replace its other active Event Logic.
Choose the target instance with the Action’s Applies To field.
| Parameter | Type | Optional | Details |
|---|---|---|---|
| Event | enum | No | Value for Event. Default: “current”. |
| Event Logic | enum | No | Value for Event Logic. |
Set Game State
Changes the singular project-wide Game State and runs Game State Changed when the value changes.
Reference key: setGameState.
Editor category: Logic > Game State.
Example: When the player pauses: Set Game State [Paused].
| Parameter | Type | Optional | Details |
|---|---|---|---|
| Game State | enum | No | Value for Game State. |
Set Input Context Active
Activates or deactivates one Input Context without changing any other active contexts. Commands and mappings from every active context are merged.
Reference key: setInputContextActive.
Editor category: Logic > Input Contexts.
Example: When opening a menu: Set Input Context Active [Menus] [On].
| Parameter | Type | Optional | Details |
|---|---|---|---|
| Input Context | enum | No | Value for Input Context. |
| Active | boolean | No | On or off. Default: true. |
Set Logic State
Enables, disables, or toggles one attached Logic on each target instance, firing lifecycle events only for real state transitions.
Reference key: enableBehavior.
Editor category: Logic > Events and Logic.
Example: Disable an opened chest’s interaction Logic, or toggle a door Logic from a lever.
Choose the target instance with the Action’s Applies To field.
| Parameter | Type | Optional | Details |
|---|---|---|---|
| Logic Component | thing:behavior | No | Choose a behavior resource. |
| State | enum | No | Choose one of the listed options. Choices: enable, disable, toggle. Default: “enable”. |
Set Target Object
Changes which live Object a TARGET reference identifies. SELF references cannot be reassigned.
Reference key: setTargetObject.
Editor category: Logic > Variables and State.
| Parameter | Type | Optional | Details |
|---|---|---|---|
| Target | objectInput | No | The assignable TARGET Object Parameter to change. |
| Object | objectInput | No | A compatible SELF or TARGET Object Parameter whose current Object becomes the new target. Shown when Target has a selection. |
Start Input Sequence Mode
Starts recording ordered Command and Axis Direction tokens. Starting again replaces the current recording session.
Reference key: startInputSequenceMode.
Editor category: Logic > Input.
Example: When the player opens a cheat console, start Input Sequence Mode for [Gameplay].
| Parameter | Type | Optional | Details |
|---|---|---|---|
| Input Context | enum | Yes | Blank records Commands from every active Input Context. |
Submit Input Sequence
Checks the recorded tokens against enabled Input Manager sequences, stops recording, and presses the matched sequence’s mapped Button Command.
Reference key: submitInputSequence.
Editor category: Logic > Input.
Example: On an Enter Command, submit the current Input Sequence.
Trigger Custom Event
Broadcasts one named Custom Event to matching Custom Event listeners.
Reference key: triggerCustomEvent.
Editor category: Logic > Events and Logic.
Example: Trigger Custom Event “doorOpened” for every named listener.
| Parameter | Type | Optional | Details |
|---|---|---|---|
| Custom Event | text | No | Named custom event to trigger. |
Trigger Custom Event on Object
Sends one named Custom Event to the selected Object instance without broadcasting it to unrelated Objects.
Reference key: triggerTargetCustomEvent.
Editor category: Logic > Logic and Flow.
Example: On Collision Enter, send “receiveCharge” to Event Other.
Choose the target instance with the Action’s Applies To field.
| Parameter | Type | Optional | Details |
|---|---|---|---|
| Custom Event | text | No | Named custom event to trigger. |
While
Runs its vertical child stack while the visual Condition remains true. The Condition is checked again before every iteration, and blockLocal(“iteration”) exposes this loop’s zero-based iteration number.
Reference key: while.
Editor category: Logic > Logic and Flow.
Example: While Health is below Maximum Health, increase Health inside the child stack until the Condition becomes false.
| Parameter | Type | Optional | Details |
|---|---|---|---|
| Comparisons | conditionList | No | The flat Compare Values rows checked before every loop iteration. The runtime stops after 10,000 iterations and warns if normal condition termination has not occurred. |
Myth Engine Documentation
