R3vo/Sandbox1 – User
Lou Montana (talk | contribs) m (Text replacement - "{{KeyboardShortcut" to "{{Controls") |
mNo edit summary |
||
| Line 1: | Line 1: | ||
{{TopMenu|[[User:R3vo/Sandbox|Sandbox No. 1]] [[User:R3vo/Sandbox1|Sandbox No. 2]] [[User:R3vo/Sandbox2|Sandbox No. 3]] [[User:R3vo/Sandbox3|Sandbox No. 4]]}} | |||
{{TOC|side}} | {{TOC|side}} | ||
__NOEDITSECTION__ | __NOEDITSECTION__ | ||
Revision as of 14:19, 26 August 2022
Magic variables are engine-maintained variables that serve a specific purpose within a given scope and are often used by the engine to push data to a given script or code fragment.
They are usually no longer present after leaving the scope (e.g. after code execution or after a forEach statement).
| Variable | Description | Data Types | Used In | Introduced With |
|---|---|---|---|---|
| thisTrigger |
Refers to the trigger object itself - accessible within the Condition, On Activation or On Deactivation script. |
N/A | ||
|
thisList |
"Variable defined by Triggers and Waypoints:
|
N/A | ||
|
this |
|
See description. |
N/A | |
|
_y |
Iterating over a HashMap with forEach will return the key as _x and the value as _y. |
See description. |
||
|
_x |
Represents the current element during a loop with: apply, count, configClasses, configProperties, findIf, forEach, select. |
apply, count, configClasses, configProperties, findIf, forEach, select |
N/A | |
|
_units |
Stores units depending on the context it is used in. |
|||
|
_topic |
Stores the topic name. | String | ||
|
_to |
Stores the unit that was switched to in onTeamSwitch. | Object | onTeamSwitch | |
|
_time |
SQS ONLY. The time elapsed since the script started running. |
In SQS scripts. |
N/A | |
|
_thisScript |
The execVMed, called or spawned script handle from within itself. |
See description. |
N/A | |
| _thisFSM | The FSM id for FSMs executed with execFSM. | Number | execFSM | |
| _thisEventHandler | The index for Event Handlers added with addEventHandler, addMPEventHandler or addMissionEventHandler. | Number | addEventHandler, addMissionEventHandler, addMPEventHandler | N/A |
| _thisEvent | The name of the Event added with addEventHandler, addMPEventHandler or addMissionEventHandler as well as for config types EHs. | String | addEventHandler, addMissionEventHandler, addMPEventHandler | |
| _thisArgs | Additional event handler arguments available with addMissionEventHandler. | Array | addMissionEventHandler | |
| _this | Is used to make arguments of a script call (call, exec, execVM, spawn) visible and accessible to the script, also used in Event Handlers to pass appropriate params. | String | addAction, addEventHandler, addMissionEventHandler, addMPEventHandler, addMusicEventHandler, addPublicVariableEventHandler, call, ctrlAddEventHandler, ctrlSetEventHandler, displayAddEventHandler, displaySetEventHandler, editorSetEventHandler, exec, execFSM, execVM, inGameUISetEventHandler, kbAddTopic, onGroupIconClick, setMusicEventHandler, spawn, try | N/A |
| _target | Object | addAction, commandFSM, doFSM | N/A | |
| _shift | Returns whether or not ⇧ Shift was pressed. | Boolean | onDoubleClick, onMapSingleClick | |
| _sentenceId | Contains the ID of given sentence. | String ??? | kbAddTopic | |
| _pos | Contains a position. What position depends on the command it was used in. | Array | onDoubleClick, onMapSingleClick, onShowNewObject | N/A |
| _owner | Owner id of the leaving player. | Number | onPlayerDisconnected, onPlayerConnected | |
| _new | Contains the newly created object. Old 3D-Editor only. | Object | addEditorObject | |
| _name | Profile name of the the player. | String | onPlayerDisconnected, onPlayerConnected | |
| _leader | Contains the group leader. | Object | doFSM | |
| _jip | Returns whether or not the player joined in progress. | Boolean | onPlayerDisconnected, onPlayerConnected | |
| _isSelected | Returns the new selection state of the units. | Boolean | onHCGroupSelectionChanged | |
| _isHighCommand | Returns true if player is in high command. | Boolean | onCommandModeChanged | |
| _id | Contains the direct player ID. | Number | onPlayerDisconnected | |
| _idStr | Same as _id but in string format, so could be exactly compared to user marker ids. | String | onPlayerDisconnected | |
| _group | Contains the newly selected group. | Group | onHCGroupSelectionChanged | |
| _from |
|
Object | kbAddTopic, onTeamSwitch | |
| _forEachIndex | Represents the (zero-based) index of a forEach _x element. | Number | forEach | N/A |
| _fnc_scriptNameParent |
From within a Function, name of the function that called the current one (_fnc_scriptName used when not defined) |
String | N/A | N/A |
| _fnc_scriptName | From within a Function, the TAG_fnc_functionName function name as string (e.g. "myTag_fnc_myFunction") | String | N/A | N/A? |
| _exception | Exception handling using a try-catch statement declares this variable which contains details about the thrown exception in the try block. | ? | try-catch | ? |
| _destination | ? | ? | commandFSM, doFSM | ? |
| _alt | Returns whether or not Alt was pressed | Boolean | onDoubleClick, onMapSingleClick | N/A |
| _uid | Contains UID of the leaving player. In Arma 3 it is also the same as Steam ID. | String | onPlayerDisconnected, onPlayerConnected | N/A |