|
|
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}}
| |
| __NOEDITSECTION__
| |
| '''Magic variables''' are engine-maintained [[Variables|variables]] that serve a specific purpose within a given scope and are often used by the engine to push data to a given [[Script File|script]] or [[Code|code]] fragment.<br>They are usually no longer present after leaving the scope (e.g. after code execution or after a [[forEach]] statement).
| |
|
| |
| {| class="wikitable sortable"
| |
| |-
| |
| ! Variable !! Description !! Data Types !! Used In !! Introduced With
| |
| |-
| |
| | thisTrigger
| |
| |
| |
| Refers to the [[Triggers|trigger]] object itself - accessible within the '''Condition''', '''On Activation''' or '''On Deactivation''' script.
| |
| |
| |
| [[Object]]
| |
| |
| |
| [[Trigger]]s
| |
| | {{n/a}}
| |
| |-
| |
| |
| |
| thisList
| |
| |
| |
| "[[Variables|Variable]] defined by [[Triggers]] and [[Waypoints]]:
| |
| * Triggers:
| |
| ** accessible within the '''Condition''', '''On Activation''' or '''On Deactivation''' script
| |
| ** defines an array of objects that have been detected by the trigger (same as what is returned by the [[list]] command)
| |
| ** '''thisList''' in a trigger's '''On Deactivation''' field seems to be undefined, and should not be used. It will either return an empty array, or possibly the contents of a different trigger.
| |
| * Waypoints:
| |
| ** accessible within the '''Condition''' or '''On Activation''' script
| |
| ** defines an array containing all group members that completed the respective waypoint"
| |
| |
| |
| [[Array]] of [[Object]]s
| |
| |
| |
| [[Trigger]]s & [[Waypoint]]s
| |
| | {{n/a}}
| |
| |-
| |
| |
| |
| this
| |
| |
| |
| * '''In Addons' config files''' (e.g. UserActions, onInit, etc.): The object to which the entry belongs
| |
| * '''In Dialogs''': The player unit that activated control (e.g. via mouseEnter). [[false]] if non-activated
| |
| * '''In Object's ""Init"" line:''' The object to which the init line belongs
| |
| * '''In Triggers'''
| |
| ** ''""Condition"" line'': The [[Boolean]] return value of the [[Mission Editor: Triggers|trigger]]'s conditions (e.g. ""East Not Present"" etc)
| |
| ** ''""On Activation/Deactivation"" line'': Seems to always return [[false]]
| |
| * '''In Waypoints'''
| |
| ** ''""Condition"" or ""On Activation/Deactivation"" line'': The group leader that completed the respective waypoint (or driver, if waypoint is assigned to a vehicle)"
| |
| |
| |
| [[Object]] or [[Boolean]]
| |
| |
| |
| See description.
| |
| | {{n/a}}
| |
| |-
| |
| |
| |
| _y
| |
| |
| |
| Iterating over a [[HashMap]] with [[forEach]] will return the key as [[#x|_x]] and the value as [[#y|_y]].
| |
| |
| |
| [[Anything]]
| |
| |
| |
| See description.
| |
| |
| |
| {{GVI|arma3|2.02}}
| |
| |-
| |
| |
| |
| _x
| |
| |
| |
| Represents the current element during a loop with: [[apply]], [[count]], [[configClasses]], [[configProperties]], [[findIf]], [[forEach]], [[select]].
| |
| |
| |
| [[Anything]]
| |
| |
| |
| [[apply]], [[count]], [[configClasses]], [[configProperties]], [[findIf]], [[forEach]], [[select]]
| |
| | {{n/a}}
| |
| |-
| |
| |
| |
| _units
| |
| |
| |
| Stores units depending on the context it is used in.
| |
| |
| |
| [[Array]] of [[Object]]s
| |
| |
| |
| [[commandFSM]], [[doFSM]], [[onDoubleClick]], [[onMapSingleClick]]
| |
| | {{GVI|ofp|1.85}}
| |
| |-
| |
| |
| |
| _topic
| |
| | Stores the topic name.
| |
| | [[String]]
| |
| |
| |
| [[kbAddTopic]]
| |
| | {{GVI|arma2|1.00}}
| |
| |-
| |
| |
| |
| _to
| |
| | Stores the unit that was switched to in [[onTeamSwitch]].
| |
| | [[Object]]
| |
| | [[onTeamSwitch]]
| |
| | {{GVI|arma2|1.00}}
| |
| |-
| |
| |
| |
| _time
| |
| |
| |
| '''[[SQS Syntax|SQS]] ONLY.''' The time elapsed since the script started running.
| |
| |
| |
| [[Number]]
| |
| |
| |
| In SQS scripts.
| |
| | {{n/a}}
| |
| |-
| |
| |
| |
| _thisScript
| |
| |
| |
| The [[execVM]]ed, [[call]]ed or [[spawn]]ed [[Script Handle|script handle]] from within itself.
| |
| |
| |
| [[Script Handle]]
| |
| |
| |
| See description.
| |
| | {{n/a}}
| |
| |-
| |
| | _thisFSM
| |
| | The [[FSM]] id for FSMs executed with [[execFSM]].
| |
| | [[Number]]
| |
| | [[execFSM]]
| |
| | {{GVI|arma3|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]]
| |
| | {{GVI|arma3|2.06}}
| |
| |-
| |
| | _thisArgs
| |
| | Additional event handler arguments available with [[addMissionEventHandler]].
| |
| | [[Array]]
| |
| | [[addMissionEventHandler]]
| |
| | {{GVI|arma3|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 {{Controls|Shift}} was pressed.
| |
| | [[Boolean]]
| |
| | [[onDoubleClick]], [[onMapSingleClick]]
| |
| | {{GVI|ofp|1.85}}
| |
| |-
| |
| | _sentenceId
| |
| | Contains the ID of given sentence.
| |
| | [[String]] ???
| |
| | [[kbAddTopic]]
| |
| | {{GVI|arma2|1.00}}
| |
| |-
| |
| | _pos
| |
| | Contains a position. What position depends on the command it was used in.
| |
| | [[Array]]
| |
| | [[onDoubleClick]], [[onMapSingleClick]], [[onShowNewObject]]
| |
| | {{n/a}}
| |
| |-
| |
| | _owner
| |
| | [[owner|Owner]] id of the leaving player.
| |
| | [[Number]]
| |
| | [[onPlayerDisconnected]], [[onPlayerConnected]]
| |
| | {{GVI|arma3|1.50}}
| |
| |-
| |
| | _new
| |
| | Contains the newly created object. '''Old''' 3D-Editor only.
| |
| | [[Object]]
| |
| | [[addEditorObject]]
| |
| | {{GVI|arma2|1.00}}
| |
| |-
| |
| | _name
| |
| | [[profileName|Profile name]] of the the player.
| |
| | [[String]]
| |
| | [[onPlayerDisconnected]], [[onPlayerConnected]]
| |
| | {{GVI|ofpe|1.00}}
| |
| |-
| |
| | _leader
| |
| | Contains the group leader.
| |
| | [[Object]]
| |
| | [[doFSM]]
| |
| | {{GVI|arma1|1.00}}
| |
| |-
| |
| | _jip
| |
| | Returns whether or not the player joined in progress.
| |
| | [[Boolean]]
| |
| | [[onPlayerDisconnected]], [[onPlayerConnected]]
| |
| | {{GVI|arma3|1.50}}
| |
| |-
| |
| | _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
| |
| | Same as _id but in string format, so could be exactly compared to user marker ids.
| |
| | [[String]]
| |
| | [[onPlayerDisconnected]]
| |
| | {{GVI|arma1|1.96}}
| |
| |-
| |
| | _group
| |
| | Contains the newly selected group.
| |
| | [[Group]]
| |
| | [[onHCGroupSelectionChanged]]
| |
| | {{GVI|arma2|1.00}}
| |
| |-
| |
| | _from
| |
| |
| |
| * [[onTeamSwitch]] - Contains the unit that the player switched from
| |
| * [[kbAddTopic]] - Contains the person that talked to the receiver and triggered the script
| |
| | [[Object]]
| |
| | [[kbAddTopic]], [[onTeamSwitch]]
| |
| | {{GVI|arma2|1.00}}
| |
| |-
| |
| | _forEachIndex
| |
| | Represents the (zero-based) index of a [[forEach]] [[#x|_x]] element.
| |
| | [[Number]]
| |
| | [[forEach]]
| |
| | {{n/a}}
| |
| |-
| |
| | _fnc_scriptNameParent
| |
| | {{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)
| |
| | [[String]]
| |
| | {{n/a}}
| |
| | {{n/a}}
| |
| |-
| |
| | _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]]
| |
| | {{n/a}}
| |
| | {{n/a}}?
| |
| |-
| |
| | _exception
| |
| | [[Exception handling]] using a [[try]]-[[catch]] statement declares this variable which contains details about the [[throw|thrown]] exception in the try block.
| |
| | ?
| |
| | [[try]]-[[catch]]
| |
| | ?
| |
| |-
| |
| | _destination
| |
| | ?
| |
| | ?
| |
| | [[commandFSM]], [[doFSM]]
| |
| | ?
| |
| |-
| |
| | _alt
| |
| | Returns whether or not {{Controls|Alt}} was pressed
| |
| | [[Boolean]]
| |
| | [[onDoubleClick]], [[onMapSingleClick]]
| |
| | {{n/a}}
| |
| |-
| |
| | _uid
| |
| | Contains [[getPlayerUID|UID]] of the leaving player. In {{arma3}} it is also the same as Steam ID.
| |
| | [[String]]
| |
| | [[onPlayerDisconnected]], [[onPlayerConnected]]
| |
| | {{n/a}}
| |
| |}
| |
|
| |
| [[Category: Scripting Topics]]
| |