list: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "</dd> </dl>" to "</dd> </dl>") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
Line 1: | Line 1: | ||
{{RV|type=command | {{RV|type=command | ||
| ofp | |game1= ofp | ||
|1.00 | |version1= 1.00 | ||
|game2= ofpe | |game2= ofpe | ||
Line 23: | Line 23: | ||
|arg= global | |arg= global | ||
|eff= local | |eff= local | ||
|gr1= Triggers | |gr1= Triggers | ||
| List of units that would activate given [[Triggers|Trigger]]. | |descr= List of units that would activate given [[Triggers|Trigger]]. | ||
It returns nothing before the simulation started, i.e. in (undelayed) init.sqf files. Returns a '''[[Array#Array_references|pointer]]''' to the trigger's list after the simulation started.<br>Since this is just a ''reference'' this means that the value in your local variable will change as the content of the trigger area changes. To permanently copy the returned list to a different variable, use _mylist | It returns nothing before the simulation started, i.e. in (undelayed) init.sqf files. Returns a '''[[Array#Array_references|pointer]]''' to the trigger's list after the simulation started.<br>Since this is just a ''reference'' this means that the value in your local variable will change as the content of the trigger area changes. To permanently copy the returned list to a different variable, use {{ic|_mylist {{=}} +([[list]] triggerOne)}}. | ||
The second example can be used inside the trigger (in that case, no need to name your trigger). | The second example can be used inside the trigger (in that case, no need to name your trigger). | ||
Line 35: | Line 35: | ||
The list returned for trigger of type "Not present" is the same as that returned for type "present". | The list returned for trigger of type "Not present" is the same as that returned for type "present". | ||
{{Feature|important|While the command can query any trigger, local or remote, the result will be only for the trigger condition set on the local client. See [[createTrigger]] for more info.}} | |||
|s1= | |s1= [[list]] trigger | ||
|p1= trigger: [[Object]] | |p1= trigger: [[Object]] | ||
Line 43: | Line 43: | ||
|r1=[[Array]] or [[Nothing]] | |r1=[[Array]] or [[Nothing]] | ||
|x1= <code> | |x1= <code>_triggerList = [[list]] _triggerOne;</code> | ||
|x2= <code>[[hint]] [[format]] ["%1", [[thisList]]];</code> | |x2= <code>[[hint]] [[format]] ["%1", [[thisList]]];</code> | ||
Line 55: | Line 56: | ||
<dt class="note">[[User:TeaCup|teaCup]]</dt> | <dt class="note">[[User:TeaCup|teaCup]]</dt> | ||
<dd class="note">Calling [[list]] immediately after creating a trigger via [[createTrigger]] (and setting up activation, area, statements, timeout, etc..), will return <null> instead of an array. It seems the trigger needs about 1 second to initialise, after which it will behave as expected: returning an array of all the objects inside the trigger (the ones matching the criteria), or an empty array. | <dd class="note">Calling [[list]] immediately after creating a trigger via [[createTrigger]] (and setting up activation, area, statements, timeout, etc..), will return <null> instead of an array. It seems the trigger needs about 1 second to initialise, after which it will behave as expected: returning an array of all the objects inside the trigger (the ones matching the criteria), or an empty array. | ||
</dd> | |||
</ | |||
<dt></dt> | <dt></dt> |
Revision as of 16:09, 13 June 2021
Description
- Description:
- List of units that would activate given Trigger.
It returns nothing before the simulation started, i.e. in (undelayed) init.sqf files. Returns a pointer to the trigger's list after the simulation started.
Since this is just a reference this means that the value in your local variable will change as the content of the trigger area changes. To permanently copy the returned list to a different variable, use_mylist = +(list triggerOne)
. The second example can be used inside the trigger (in that case, no need to name your trigger). The list returned for trigger of type "Not present" is the same as that returned for type "present". - Groups:
- Triggers
Syntax
Examples
Additional Information
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
- Posted on March 6, 2013 - 14:15 (CEST)
- teaCup
- Calling list immediately after creating a trigger via createTrigger (and setting up activation, area, statements, timeout, etc..), will return <null> instead of an array. It seems the trigger needs about 1 second to initialise, after which it will behave as expected: returning an array of all the objects inside the trigger (the ones matching the criteria), or an empty array.
- Posted on January 6, 2021 - 01:58 (UTC)
- 7erra
-
The resulting array is not modifiable. Any array related commands, that modify the original array, will fail with the error message:
Error Reserved variable in expression
.
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint version 1.00
- Operation Flashpoint: New Scripting Commands
- Operation Flashpoint: Scripting Commands
- Operation Flashpoint: Elite: Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: Triggers
- Scripting Commands: Local Effect