Example_State_Transitions
Server/EncounterManager/Example_State_Transitions.json, 2.2 KB
Fields
| Field | Type |
|---|---|
Class | string |
Type | string |
StartState | string |
Debug | string |
StateTransitions | array[3] |
Instructions | array[1] |
Source
{
"Class": "EncounterManager",
"Type": "Generic",
"StartState": "Idle",
"Debug": "DisplayState",
"StateTransitions": [
{
"States": [ { "From": [], "To": [ "Active" ] } ],
"Actions": [
{ "Type": "Log", "Message": "[Encounter] --> ACTIVE: round starting" },
{ "Type": "TimerStart", "Name": "RoundTimer", "StartValueRange": [ 5, 5 ], "RestartValueRange": [ 5, 5 ] },
{ "Type": "TimerRestart", "Name": "RoundTimer" }
]
},
{
"States": [ { "From": [ "Active" ], "To": [ "Cooldown" ] } ],
"Actions": [
{ "Type": "Log", "Message": "[Encounter] --> COOLDOWN" },
{ "Type": "TimerStart", "Name": "CooldownTimer", "StartValueRange": [ 3, 3 ], "RestartValueRange": [ 3, 3 ] },
{ "Type": "TimerRestart", "Name": "CooldownTimer" }
]
},
{
"States": [ { "From": [], "To": [ "Idle" ] } ],
"Actions": [
{ "Type": "Log", "Message": "[Encounter] --> IDLE: waiting for a player" },
{ "Type": "Timeout", "Delay": [ 1, 1 ] }
]
}
],
"Instructions": [
{
"Instructions": [
{
"Sensor": { "Type": "State", "State": "Idle" },
"Instructions": [
{
"Sensor": { "Type": "Player", "Range": 8 },
"Actions": [ { "Type": "State", "State": "Active" } ]
}
]
},
{
"Sensor": { "Type": "State", "State": "Active" },
"Instructions": [
{
"Sensor": { "Type": "Timer", "Name": "RoundTimer", "State": "Stopped" },
"Actions": [ { "Type": "State", "State": "Cooldown" } ]
}
]
},
{
"Sensor": { "Type": "State", "State": "Cooldown" },
"Instructions": [
{
"Sensor": { "Type": "Timer", "Name": "CooldownTimer", "State": "Stopped" },
"Instructions": [
{
"Sensor": { "Type": "Player", "Range": 8 },
"Actions": [ { "Type": "State", "State": "Active" } ]
},
{
"Actions": [ { "Type": "State", "State": "Idle" } ]
}
]
}
]
}
]
}
]
}