OFPEC Forum
Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting Multiplayer => Topic started by: tcp on 06 Sep 2009, 01:04:26
-
Does anyone if there is a local variable inside of a trigger that is equal to the trigger name? I want it to let you copy and paste the boundary trigger and do its automatic rename (b1_1) but I still have to manually change where to I referred to it in the activation ([b1] execVM).
Also, do I need to make this MP-friendly? I still don't understand client/server sync issues.
b1
(vehicle player in thislist) && ("LandVehicle" countType thislist > 0)
hint "You are off the designated route. Threat unknown. Advise you to return immediately!!!"; _arty=[b1] execVM "scripts\artillerybarrage.sqf";
//example taken from Behind Enemy Lines by laggy
_tnam = _this select 0;
_tgt = list _tnam;
while {triggerActivated _tnam} do {
_delay = 1 + random 4;
sleep _delay;
{"Sh_120_HE" createVehicle [((getpos _x) select 0) + 50 - random 100,((getpos _x) select 1) + 50 - random 100, 0]} forEach _tgt;
_tgt = list _tnam;
};
-
Triggers actually have a "Name:" field in them.
-
Right, but from within the trigger, is there a variable that you can pass to scripts for trigger name, no matter what the Name: field is changed to.
-
Shouldn't a simple "this" refer to the trigger itself, if the script is fired from the trigger? I.e. [this] execVM "blablabla..."
-
Doesn't variable, this, refer to the trigger condition?