Scripting - Objects - Conditions
Updated 3 months agoConditions drive complex logic in the scripting, there are many different types of conditions.
Common Properties
All types of conditions have the listed variable:
conditionType
The type of Condition, all conditions have this variable, it defines what type of conditions it is.
Values: Any of the types listed under the heading "Condition Types", as a string (e.g. "And"
)
Condition Types
And
Passes only if all of the provided conditions pass
conditions
The Conditions to check, all must pass the check for the And Condition to pass.
Value: An array of Conditions.
Or
Passes if any of the provided conditions pass.
conditions
The Conditions to check, one or more must pass the check for the Or Condition to pass.
Value: An array of Conditions.
Not
Inverts the provided condition.
condition
The Condition to check, it must fail for the Not Condition to pass the check.
Value: A Condition.
Weather
Passes if the provided weather type matches the current moon's weather.
weather
The weather type.
Values: "DustClouds"
, "Eclipsed"
, "Flooded"
, "Foggy"
, "None"
, "Rainy"
, "Stormy"
PlayerLocation
Passes if the player you're controlling is in/at this location.
location
The location.
Values: "Ship"
, "Facility"
PlayerAlive
Passes if the player you're controlling is alive.
PlayerHealth
Passes if the health of the player you're controlling passes a certain comparison.
comparisonType
The type of comparison.
Values: "Equals"
, "NotEquals"
, "GreaterThan"
, "LessThan"
, "GreaterThanOrEquals"
, "LessThanOrEquals"
value
The value to compare the health to.
Value: A valid integer. (Note: the player has 100 max health)
PlayerCrouching
Passes if the player you're controlling is crouching.
PlayerInsanity
Passes the player your controlling has an insanity that passes a certain comparison.
comparisonType
The type of comparison.
Values: "Equals"
, "NotEquals"
, "GreaterThan"
, "LessThan"
, "GreaterThanOrEquals"
, "LessThanOrEquals"
level
The insanity level.
Value: a valid float. (0 to 1, 0 being minimum insanity, 1 being maximum insanity)
ShipLanded
Passes if the ship is currently landed.
ShipLeavingAlertCalled
Passes if the ship leaving alert has been called.
MusicWithTagPlaying
Passes if music with a specified tag is playing.
tag
The tag to look for.
Value: A valid string.
CurrentMoon
Passes if the current moon has the same name as the one specified (you can find the name of a moon by routing to it and seeing what it says on the monitor under "Orbiting").
moonName
The name of the moon in question.
Values: A valid string. (e.g. "41 Experimentation"
)
Timer
Passes if a set timer has passed a certain threshold
timerName
The name of the timer.
Value: a valid string.
timeGoal
The threshold for the time to reach.
Value: a valid float.
resetsTimer
Should this condition reset the specified timer if it has reached the goal?
Value: true
, false
Default: true
Random
Passes if a random number falls between 0 and the chosen number.
chance
The chance of this condition passing.
Value: a valid float. (0 to 1, 0 being a 0% chance, 1 being a 100% chance)
ApparatusDocked
Passes if the Apparatus exists and is docked.
TimeOfDay
Passes the time of day passes a certain comparison.
comparisonType
The type of comparison.
Values: "Equals"
, "NotEquals"
, "GreaterThan"
, "LessThan"
, "GreaterThanOrEquals"
, "LessThanOrEquals"
time
The normalised time.
Value: a valid float. (0 to 1, 0 being the start of the day, 1 being the end of the day)