OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Mandoble on 24 Oct 2006, 01:30:29

Title: global var = list triggername
Post by: Mandoble on 24 Oct 2006, 01:30:29
A curiosity, if you assign to a global variable the list of a trigger, this variable seems to keep updated (without your intervention) all the time with the current list of the trigger, seems to work like a pointer  :blink:
Title: Re: global var = list triggername
Post by: bedges on 24 Oct 2006, 10:26:56
indeed. and if you assign

Quote
global var = +thislist

in the init of the trigger, it stays at the initial value.
Title: Re: global var = list triggername
Post by: Chris Death on 24 Oct 2006, 10:44:00
Same what bedges says happens when making:

a = list triggerA; deleteVehicle triggerA

When a unit of the static list gets killed, it will be like any other array e.g: west alpha black 25cblabla #noid mc vojak

While when not doing it like bedges or deleting the trigger, a will interact with the trigger's list and the
unit gets removed correctly from the array.

I think this is still a good find Mandoble, since lots of missions are based on trigger lists made like you mentioned
in first post and thus there may be different results because of the interactive global variable.

:edit - if you want to assign a trigger's list to a non interactive global variable, where the units will reamin
without the #noid stuff, you need to say:

a = call format [{"%1"},list triggerA]

Now killing a unit from this trigger's list will not change anything - the array will remain like it was from start.  ;)

~S~ CD