R3vo/Sandbox1 – User
mNo edit summary |
mNo edit summary |
||
Line 116: | Line 116: | ||
| {{n/a}} | | {{n/a}} | ||
|- | |- | ||
| | | _thisFSM | ||
_thisFSM | | The [[FSM]] id for FSMs executed with [[execFSM]]. | ||
| | |||
The [[FSM]] id for FSMs executed with [[execFSM]]. | |||
| [[Number]] | | [[Number]] | ||
| [[execFSM]] | | [[execFSM]] | ||
Line 176: | Line 174: | ||
| [[Number]] | | [[Number]] | ||
| [[onPlayerDisconnected]], [[onPlayerConnected]] | | [[onPlayerDisconnected]], [[onPlayerConnected]] | ||
| {{GVI| | | {{GVI|arma3|1.50}} | ||
|- | |- | ||
| _new | | _new | ||
Line 203: | Line 201: | ||
|- | |- | ||
| _isSelected | | _isSelected | ||
| | | Returns the new selection state of the units. | ||
| | | [[Boolean]] | ||
| | | [[onHCGroupSelectionChanged]] | ||
[[ | | {{GVI|arma2|1.00}} | ||
| | |- | ||
| _isHighCommand | |||
| Returns [[true]] if player is in high command. | |||
| [[Boolean]] | |||
| [[onCommandModeChanged]] | |||
| {{GVI|arma2|1.00}} | |||
|- | |- | ||
| | | _id | ||
| Contains the direct player ID. | |||
| | | [[Number]] | ||
| [[onPlayerDisconnected]] | |||
| | | {{GVI|arma1|1.00}} | ||
[[ | |||
| | |||
[[ | |||
| | |||
|- | |- | ||
| | | _idStr | ||
_id | | Same as _id but in string format, so could be exactly compared to user marker ids. | ||
| | | [[String]] | ||
| [[onPlayerDisconnected]] | |||
| | | {{GVI|arma1|1.96}} | ||
[[onPlayerDisconnected]] | |||
| | |||
|- | |- | ||
| | | _group | ||
_group | | Contains the newly selected group. | ||
| | | [[Group]] | ||
Contains the newly selected group. | | [[onHCGroupSelectionChanged]] | ||
| | | {{GVI|arma2|1.00}} | ||
[[Group]] | |||
| | |||
[[onHCGroupSelectionChanged]] | |||
| | |||
|- | |- | ||
| | | _from | ||
_from | |||
| | | | ||
* [[onTeamSwitch]] - Contains the unit that the player switched from | |||
| | * [[kbAddTopic]] - Contains the person that talked to the receiver and triggered the script | ||
[[kbAddTopic]], [[onTeamSwitch]] | | [[Object]] | ||
| | | [[kbAddTopic]], [[onTeamSwitch]] | ||
| {{GVI|arma2|1.00}} | |||
|- | |- | ||
| | | _forEachIndex | ||
_forEachIndex | | Represents the (zero-based) index of a [[forEach]] [[#x|_x]] element. | ||
| | | [[Number]] | ||
Represents the (zero-based) index of a [[forEach]] [[#x|_x]] element. | | [[forEach]] | ||
| | | {{n/a}} | ||
[[Number]] | |||
| | |||
[[forEach]] | |||
| | |||
|- | |- | ||
| | | _fnc_scriptNameParent | ||
_fnc_scriptNameParent | | {{Feature|Informative|not engine-maintained, but added by functions_f/'''initFunctions.sqf''' script – see [[scriptName]]}} | ||
| | |||
{{Feature|Informative|not engine-maintained, but added by functions_f/'''initFunctions.sqf''' script – see [[scriptName]]}} | |||
From within a [[:Category:Functions|Function]], name of the function that called the current one ([[#fnc_scriptName|_fnc_scriptName]] used when not defined) | From within a [[:Category:Functions|Function]], name of the function that called the current one ([[#fnc_scriptName|_fnc_scriptName]] used when not defined) | ||
| | | [[String]] | ||
[[String]] | | {{n/a}} | ||
| | | {{n/a}} | ||
| | |||
|- | |- | ||
| | | _fnc_scriptName | ||
_fnc_scriptName | | {{Feature|Informative|not engine-maintained, but added by functions_f/'''initFunctions.sqf''' script – see [[scriptName]]}} From within a [[:Category:Functions|Function]], the '''TAG_fnc_functionName''' function name as string (e.g. "myTag_fnc_myFunction") | ||
| | | [[String]] | ||
{{Feature|Informative|not engine-maintained, but added by functions_f/'''initFunctions.sqf''' script – see [[scriptName]]}} From within a [[:Category:Functions|Function]], the '''TAG_fnc_functionName''' function name as string (e.g. "myTag_fnc_myFunction") | | {{n/a}} | ||
| | | {{n/a}}? | ||
[[String]] | |||
| | |||
| | |||
? | |||
|- | |- | ||
| | | _exception | ||
_exception | | [[Exception handling]] using a [[try]]-[[catch]] statement declares this variable which contains details about the [[throw|thrown]] exception in the try block. | ||
| | | ? | ||
[[Exception handling]] using a [[try]]-[[catch]] statement declares this variable which contains details about the [[throw|thrown]] exception in the try block. | | [[try]]-[[catch]] | ||
| | | ? | ||
? | |||
| | |||
[[try]]-[[catch]] | |||
| | |||
? | |||
|- | |- | ||
| | | _destination | ||
_destination | | ? | ||
| | | ? | ||
? | | [[commandFSM]], [[doFSM]] | ||
| | | ? | ||
? | |||
| | |||
[[commandFSM]], [[doFSM]] | |||
| | |||
? | |||
|- | |- | ||
| _alt | | _alt | ||
Line 316: | Line 275: | ||
| {{n/a}} | | {{n/a}} | ||
|- | |- | ||
| | | _uid | ||
_uid | | Contains [[getPlayerUID|UID]] of the leaving player. In {{arma3}} it is also the same as Steam ID. | ||
| | | [[String]] | ||
| [[onPlayerDisconnected]], [[onPlayerConnected]] | |||
| | | {{n/a}} | ||
[[String]] | |||
| | |||
[[onPlayerDisconnected]], [[onPlayerConnected]] | |||
| | |||
|} | |} | ||
[[Category: Scripting Topics]] | [[Category: Scripting Topics]] |
Revision as of 17:34, 14 November 2021
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. |
1.85 | ||
_topic |
Stores the topic name. | String | 1.00 | |
_to |
Stores the unit that was switched to in onTeamSwitch. | Object | onTeamSwitch | 1.00 |
_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 | 1.54 |
_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 | 2.06 |
_thisArgs | Additional event handler arguments available with addMissionEventHandler. | Array | addMissionEventHandler | 1.54 |
_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 | 1.85 |
_sentenceId | Contains the ID of given sentence. | String ??? | kbAddTopic | 1.00 |
_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 | 1.50 |
_new | Contains the newly created object. Old 3D-Editor only. | Object | addEditorObject | 1.00 |
_name | Profile name of the the player. | String | onPlayerDisconnected, onPlayerConnected | 1.00 |
_leader | Contains the group leader. | Object | doFSM | 1.00 |
_jip | Returns whether or not the player joined in progress. | Boolean | onPlayerDisconnected, onPlayerConnected | 1.50 |
_isSelected | Returns the new selection state of the units. | Boolean | onHCGroupSelectionChanged | 1.00 |
_isHighCommand | Returns true if player is in high command. | Boolean | onCommandModeChanged | 1.00 |
_id | Contains the direct player ID. | Number | onPlayerDisconnected | 1.00 |
_idStr | Same as _id but in string format, so could be exactly compared to user marker ids. | String | onPlayerDisconnected | 1.96 |
_group | Contains the newly selected group. | Group | onHCGroupSelectionChanged | 1.00 |
_from |
|
Object | kbAddTopic, onTeamSwitch | 1.00 |
_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 | Function, the TAG_fnc_functionName function name as string (e.g. "myTag_fnc_myFunction") | From within aString | 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 |