IScriptValueGet
Inheritance 56 descendants
- IScriptValueGetcurrent
- 0x7908fe0e
- 0xbf65c0ce
- 0xed030d64
- 0xefe2309
- BoolGet
- ColorGet
- CustomGet
- DataObjectBoolGet
- DataObjectFloatGet
- DataObjectGet
- DataObjectIntGet
- DataObjectStringGet
- EntityGroupGet (removed in patch 15.17)
- EntityReferenceGet
- EntityTagGet
- FloatGet
- IntGet
- ListGet
- MapGet
- NilEntityGet
- NilGet
- NilUnitGet
- PathReferenceGet
ScriptTableGet28
- 0x257477d2
- 0x47f638a9 (removed in patch 15.8)
- BoolTableGet
- ColorTableGet
- CustomTableGet
- DataObjectBoolTableGet
- DataObjectFloatTableGet
- DataObjectIntTableGet
- DataObjectStringTableGet
- DataObjectValueTableGet
- EntityGroupTableGet (removed in patch 15.17)
- EntityTableGet
- EntityTagTableGet
- FloatCast (removed in patch 13.22)
- FloatOffsetTableGet
- FloatTableGet
- FunctionTableGet
- IntCast (removed in patch 14.24)
- IntOffsetTableGet
- IntTableGet
- PathTableGet
- ResourceKeyValueTableGet
- SegmentTableGet
- StringCast
- StringTableGet
- UiElementITableGet
- UnitTableGet
- VectorTableGet
- SegmentGet
- StringGet
- UiElementIGet
- VectorGet
Class Documentation
Edit documentationA value getter: an object in a bin script that produces one script value when a
block or a condition evaluates it. Getters fill the inputs of script blocks (see
IScriptBlock) and conditions (see
IScriptCondition). A getter holds a literal value
(IntGet, StringGet), reads a script
variable (the *TableGet classes, see ScriptTableGet),
reads a property of a loaded bin object (the DataObject*Get classes), or builds a
new value (ListGet, MapGet). The client
evaluates the getter every time the block or condition runs. Nothing caches the result.
Value kinds. Every script value has one of these kinds:
| Kind | Content | Literal getter |
|---|---|---|
| Nil | No value | NilGet |
| Int | 32-bit signed integer | IntGet |
| Bool | true or false |
BoolGet |
| Float | 32-bit float | FloatGet |
| String | Text | StringGet |
| Vector3 | Three floats | VectorGet |
| Function | A script function | none |
| CustomTable | A key-value table that scripts create and fill at run time | CustomGet, ListGet, MapGet |
| Entity | The id of a game entity | EntityReferenceGet, NilEntityGet |
| EntityTag | An entity tag hash | EntityTagGet |
| Path | A link to a path object (IPath) |
PathReferenceGet |
| Color | An RGBA color | ColorGet |
| Int64 | 64-bit signed integer | none |
| DataObject | A loaded bin object | DataObjectGet |
| ResourceKey | A resource reference hash | 0x7908fe0e |
| UiElement | A UI element | UiElementIGet |
| Unit | The id of a unit | NilUnitGet |
| Segment | An 8-bit value | SegmentGet |
Generic and typed reads. A property that takes an IScriptValueGet receives the
value together with its kind, and the reader decides what to do with the kind:
ComparisonScriptCondition compares two values of
any kind, and SetVarInTableBlock stores any value. A
property that takes a typed getter interface, such as IFloatGet, IIntGet,
IBoolGet, IStringGet, IVectorGet or IEntityGet, asks for that one kind, and
any getter that implements the interface fits the property. Every float getter also
implements IIntGet, and every int getter also implements IFloatGet. Read as an int,
a float is truncated toward zero.
Variables. A script variable is addressed by a table and a variable name.
The table is one of the ScriptTable classes, such as InstanceVars or WorldVars.
The client resolves the table for the script that is running, so the same getter reads
a different instance of the table in each script context. A *TableSet (for example
the output of a block) writes a variable and names it by its name string. A
*TableGet reads a variable and names it by the hash of the name (FNV-1a of the
lowercased name), so both address the same variable. If a *TableGet leaves Table
unset, it reads the pass-through parameter table of the running script call. See
ScriptTableGet.
Failure. A getter fails when its input does not resolve or does not hold the expected kind. A failing getter raises a script error: the client discards the message, marks the running script as failed, and the block that evaluated the getter skips its effect (see IScriptBlock). A reader can also evaluate a getter with error reporting turned off, test the result and fall back to another input. A failure then raises no error.
Fallbacks. Some table getters return a value of their own when the variable does not give one:
| Getter | Missing variable | Variable of another kind |
|---|---|---|
| ScriptTableGet | Fails | Returns the value with its kind |
| FloatTableGet, IntTableGet, BoolTableGet, StringTableGet | Returns Default if it is set, otherwise fails |
Converts if it can, otherwise as for a missing variable |
| FloatOffsetTableGet, IntOffsetTableGet | Returns offset |
Fails |
Every other *TableGet |
Fails | Fails, except for the conversions on its page |
Referenced by 19 classes · 21 properties
- 0x2330a302 DefaultInput
Pointer<IScriptValueGet> - 0x2a2c82dc FunctionInputs
Map<Hash, IScriptValueGet> - 0x2d653ed5 EventParameters
Map<Hash, IScriptValueGet> - 0x7c537128 EventParameterOverrides
Map<Hash, IScriptValueGet> - AttackableUnitGeComponentDef 0xcf9b9ca4
Map<String, IScriptValueGet> - ComparisonScriptCondition Value1
Pointer<IScriptValueGet>Value2Pointer<IScriptValueGet> - CustomTableContainsValueBlock value
Pointer<IScriptValueGet> - CustomTableHasKeyCondition Key
Pointer<IScriptValueGet> - DesignerEvent EventParameters
Map<String, IScriptValueGet> - ExecuteFunctionEntityBlock PassThroughParameters
Map<Hash, IScriptValueGet> - GameEntityScriptBase InstanceVariables
Map<Hash, IScriptValueGet> - GameEntityScriptDefinition InstanceVariableOverrides
Map<Hash, IScriptValueGet> - GetKeyValueInCustomTableBlock SrcKey
Pointer<IScriptValueGet> - InsertIntoCustomTableBlock value
Pointer<IScriptValueGet> - ListGet Elements
List2<IScriptValueGet> - MapGet Elements
Map<String, IScriptValueGet> - RemoveFromCustomTableBlock Key
Pointer<IScriptValueGet> - SetKeyValueInCustomTableBlock Key
Pointer<IScriptValueGet>valuePointer<IScriptValueGet> - SetVarInTableBlock Src
Pointer<IScriptValueGet>