Home   Help Search Login Register  

Author Topic: Boundary Triggered Artillery  (Read 1602 times)

0 Members and 1 Guest are viewing this topic.

Offline tcp

  • Members
  • *
    • Violator Gaming
Boundary Triggered Artillery
« 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.
 
Code: (Trigger Name) [Select]
b1
Code: (Trigger Condition) [Select]
(vehicle player in thislist) && ("LandVehicle" countType thislist > 0)
Code: (Trigger On Activation) [Select]
hint "You are off the designated route. Threat unknown. Advise you to return immediately!!!"; _arty=[b1] execVM "scripts\artillerybarrage.sqf";


Code: (artillerybarrage.sqf) [Select]
//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;
};

Offline Shuko

  • Members
  • *
Re: Boundary Triggered Artillery
« Reply #1 on: 06 Sep 2009, 02:27:28 »
Triggers actually have a "Name:" field in them.

Offline tcp

  • Members
  • *
    • Violator Gaming
Re: Boundary Triggered Artillery
« Reply #2 on: 06 Sep 2009, 19:18:06 »
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.

Offline Inkompetent

  • Members
  • *
Re: Boundary Triggered Artillery
« Reply #3 on: 07 Sep 2009, 14:35:54 »
Shouldn't a simple "this" refer to the trigger itself, if the script is fired from the trigger? I.e. [this] execVM "blablabla..."

Offline tcp

  • Members
  • *
    • Violator Gaming
Re: Boundary Triggered Artillery
« Reply #4 on: 07 Sep 2009, 21:30:14 »
Doesn't variable, this, refer to the trigger condition?