this: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(_thiseventhandler)
(Redirection to Magic_Variables)
Line 1: Line 1:
[[Category:Scripting_Topics|T]]
#REDIRECT [[Magic_Variables]]
 
 
=_this=
*'''In Scripts/Functions''': The given arguments that were passed by a [[call]], [[exec]], [[execVM]] or [[spawn]].<br>For the arguments in scripts executed by mission-made actions or Event Handlers, check [[addAction]] and [[:Category:Event Handlers|Event Handlers]].
*'''In Addons' config files''': An array with the current object as its first (and only) element.
*'''In Addons' custom UserActions''': Unit that is activating the action.
*'''In Dialogs''': An array with the current control as its first (and only) element (only available during runtime).
 
=_thisScript=
{{GVI|arma3|1.54}}
* '''In expression executed by [[execVM]] or [[spawn]]''', this  variable stores the [[Script (Handle)|Script]] handle.
 
=_thisFSM=
{{GVI|arma3|1.54}}
* '''In FSM executed by [[execFSM]]''', this variable stores FSM ID (the same as is returned by execFSM command).
 
=_thisEventHandler=
{{GVI|arma3|1.54}}
* This variable stores Event Handler ID (the same ID returned by command, which adds Event Handler) and is available for certain Event Handlers. See [[Arma_3:_Event_Handlers]] to find out which event handlers support it.
 
=this=
*'''In Addons' config files''' (e.g. UserActions, onInit, etc.): The object the entry belongs to.
*'''In Dialogs''': The player unit that activated control (e.g. via mouseEnter). [[false]] if non-activated.
*'''In Object's "Init" line:''' The object the init line belongs to.
*'''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).
 
=thisList=
*'''In Triggers''' (''"Condition" or "On Activation/Deactivation" line''): An [[Array]] of objects that are currently fulfilling the trigger's condition (same as the what is returned by the [[list]] command).
*'''In Waypoints''' (''"Condition" or "On Activation" line''): An [[Array]] containing all group members that completed the respective waypoint.<br>(''thisList'' in a trigger's ''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.)
 
=thisTrigger=
*'''In Triggers''' (''"Condition" or "On Activation/Deactivation" line''): ''thisTrigger'' refers to the trigger itself.
 
=See Also=
[http://www.ofpec.com/editors-depot/index.php?action=details&id=35&game=OFP|All About "This"]
A detailed tutorial by General Barron on the various forms of 'this' and where to use them.

Revision as of 19:34, 3 May 2018

Redirect to: