The test of this block. If Condition is null, the block is an Else whatever its
type: if the previous result is true, it closes the chain; if the chain is still open,
it runs Sequence.
IfConditionBlock
Inheritance 1 ancestor · 45 siblings
- IScriptBlock
- 0x24120f89 (removed in patch 15.10)
- 0x28c595ef (removed in patch 15.13)
- 0x3f934c8f (removed in patch 16.21)
- 0x6b73a615
- 0x7c537128
- 0x92b6b7fa
- 0xc5e16ef4
- 0xeda147c3 (removed in patch 16.21)
- BreakBlock
- CallFunctionBlock (removed in patch 14.12)
- ClearBit
- ConcatenateStringsBlock
- ConceptBlockBase15
- ContinueBlock
- CopyCustomTableBlock
- CreateCustomTableBlock
- CreateFunctionBlock (removed in patch 14.22)
- CustomTableContainsValueBlock
- DebugPrintToChatBlock
- DestroyCustomTableBlock
- EndEventBlock
- EndFunctionBlock (removed in patch 15.13)
- FindInString
- FreeformMathBlock
- GameEntityBlock36
- GetAverageValueInCustomTableBlock
- GetHqBlock (removed in patch 15.2)
- GetKeyValueInCustomTableBlock
- GetRandomFromCustomTableBlock
- GetSizeOfCustomTableBlock
- IAsyncBlock
- IBehaviorScriptBlock5
- IClientBlock4
- IGameScreenClientBlock13
- ILoopScriptBlock10
- IRunFunctionBlock5
- IfConditionBlockcurrent
- InsertIntoCustomTableBlock
- LevelScriptBlock25
- RemoveFromCustomTableBlock
- ScriptCommentBlock
- SetBit
- SetKeyValueInCustomTableBlock
- ShuffleCustomTableBlock
- SortCustomTableBlock
- SwitchScriptBlock (removed in patch 14.24)
Class Documentation
Edit documentationThe conditional block. The block evaluates Condition, applies Invert, and runs
Sequence if the result is true. It stores the result on the script context, where the
next conditional block of the chain reads it. type selects how the block combines its own
condition with that previous result, so one class covers If, AndIf, OrIf, ElseIf and Else.
IScriptBlock describes how a chain is laid out in a list.
A chain is written as sibling blocks, for example:
| Block | Runs its Sequence when |
|---|---|
If A |
A is true |
AndIf B |
A and B are true |
ElseIf C |
A and B are not both true, and C is true |
Else (null Condition) |
A and B are not both true, and C is false |
If Condition cannot be evaluated, the condition returns false (see
IScriptCondition).
Properties
Invert
Bool = false If true, the block uses the opposite of the result of Condition.
The blocks that run when the result of the block is true.
type
U32 = 0 How the block takes part in the if-chain. The previous result is the result of the conditional block before this one.
| Value | Name | Behaviour |
|---|---|---|
0 |
If | Starts a new chain. Evaluates Condition and runs Sequence if the result is true. |
1 |
AndIf | If the previous result is true and the chain is open, evaluates Condition and runs Sequence if the result is true. If the previous result is false, the result stays false and Sequence does not run. |
2 |
OrIf | If the previous result is true, runs Sequence without evaluating Condition, and the result stays true. Otherwise evaluates Condition and runs Sequence if the result is true. |
3 |
ElseIf | If the previous result is true, closes the chain: this block and the later ElseIf and Else blocks of the chain do not run Sequence. Otherwise evaluates Condition and runs Sequence if the result is true. |
A value above 3 makes the block do nothing.