Controls what operation should be used for the condition.
Unknown. Seems to always be 2 in vanilla Elden Ring. 3 seems to make the condition always true.
If the condition is false, the state at this index will be checked next. Set it to -1 to disable the sfx if the condition is false.
Controls what type of value the operand to the left of the operator should be.
This does different things depending on the
leftOperandType
:
Controls what type of value the operand to the right of the operator should be.
This does different things depending on the
rightOperandType
:
Controls what type of value the operand to the left of the operator should be.
This does different things depending on the
leftOperandType
:
If the condition is false, the state at this index will be checked next. Set it to -1 to disable the sfx if the condition is false.
Controls what operation should be used for the condition.
Controls what type of value the operand to the right of the operator should be.
This does different things depending on the
rightOperandType
:
Unknown. Seems to always be 2 in vanilla Elden Ring. 3 seems to make the condition always true.
The LessThanOrEqual and LessThan operators are not valid operators in the FXR format. This method returns an equivalent condition that is valid.
Swaps the operands and changes the operator to match if the left operand is a literal value and the right operand is a non-literal value. This makes it a bit easier to read the expression, but doesn't affect functionality.
Static
fromParses a logical expression in a string and creates a StateCondition from it.
A string with a logical expression and optionally an
else
statement with a state index.
expression = <operand> <operator> <operand>[ else[ goto] <stateIndex>]
operand = <number> | External(<integer>) | StateTime | UnkMinus2
operator = != | == | > | >= | < | <=
stateIndex = <integer> | none
External
, StateTime
, and UnkMinus2
are all case-insensitive and have
shorter variations available. Here are some examples:
ext(0)
stateTime
time
minus2
ext(0) > 1
time < 5 else goto 2
1 != External(10000) else 1
A new StateCondition based on the expression.
A condition for a state. The state remains active if all of its conditions are true or if it has no conditions. If the condition is false, the state is deactivated and the next state (
nextState
) is activated.