Skip to content

Condition Action

Namespace: SpaceUsurper

Evaluates a condition before deciding which set of actions to perform next.

Inheritance: ObjectFsmAction → Condition

Examples

Example

The following example prints "You got lucky!" with a 20% chance, and otherwise prints "Better luck next time!".

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
...
{ "action": "Condition", "condition": "rand.Chance(0.2)",
    "true": [
        { "action": "Log", "message": "You got lucky!" }
    ],
    "false": [
        { "action": "Log", "message": "Better luck next time!" }
    ]
},
...

Properties

Name Description
condition Condition to evaluate, the result of which will decide which set of actions to perform.
false Optional actions to run if the condition evaluated to false.
true Optional actions to run if the condition evaluated to true.