Jump to content
Sign in to follow this  
KooZ

TriggerActivated Problems

Recommended Posts

_t1 = (triggeractivated radioflare);
_t2 = (triggeractivated aaflare1);
_t3 = (triggeractivated aaflare2);
_t4 = (triggeractivated aaflare3);
_t5 = (triggeractivated aaflare4);
_t6 = (triggeractivated aaflare5);


hint format ["1 %1 2 %1 3 %1 4 %1 5 %1 6 %1",_t1, _t2, _t3, _t4, _t5, _t6];


if (_t1) then
{
_posX = (getPos flareradio select 0) + (random 50) - (random 50);
_posY = (getPos flareradio select 1) + (random 50) - (random 50);
_posZ = (getPos flareradio select 2) + (random 50) - (random 50);
_pos = "Radio";
};


if (_t2) then
{
_posX = (getPos aaflare1 select 0) + (random 50) - (random 50);
_posY = (getPos aaflare1 select 1) + (random 50) - (random 50);
_posZ = (getPos aaflare1 select 2) + (random 50) - (random 50);
_pos = "AA1";
};

if (_t3) then
{
_posX = (getPos aaflare2 select 0) + (random 50) - (random 50);
_posY = (getPos aaflare2 select 1) + (random 50) - (random 50);
_posZ = (getPos aaflare2 select 2) + (random 50) - (random 50);
_pos = "AA2";
};

if (_t4) then
{
_posX = (getPos aaflare3 select 0) + (random 50) - (random 50);
_posY = (getPos aaflare3 select 1) + (random 50) - (random 50);
_posZ = (getPos aaflare3 select 2) + (random 50) - (random 50);
_pos = "AA3";
};

if (_t5) then
{
_posX = (getPos aaflare4 select 0) + (random 50) - (random 50);
_posY = (getPos aaflare4 select 1) + (random 50) - (random 50);
_posZ = (getPos aaflare4 select 2) + (random 50) - (random 50);
_pos = "AA4";
};

if (_t6) then
{
_posX = (getPos aaflare5 select 0) + (random 50) - (random 50);
_posY = (getPos aaflare5 select 1) + (random 50) - (random 50);
_posZ = (getPos aaflare5 select 2) + (random 50) - (random 50);
_pos = "AA5";
};

sleep (random 5);

while {true} do
{	
flare1 = "F_20mm_red" createVehicle ((_posX, _posY, _posZ) ModelToWorld [0,100,200]);
flare1 setVelocity [0,0,-10];
hint format ["Flare Deployed at %1 ",_pos];
sleep (random 5);
};
if (false) exitWith {};

I've been trying to light up a flare for differente spots on altis, being 1 radio tower and 5 AA tigris sites.

There is a trigger for "Blufor is spotted by Opfor (repeat)" and it calls the script shown ahead.

The if's are meant to discover what trigger was activated and they ll define the position where the flare will spawn. I could easily make a different script for each zone, but that would be unnecessary and I'll later make a backup script that will work around with the positions given on this script, say , It will call backup.sqf and it will pick a random unit (within 6) to answer the backup call IF the radio tower is alive.

It's is showing a error: radioflare (it's the trigger's name) undefined variable.

Share this post


Link to post
Share on other sites

That looks like it should work. But if you need a workaround, I am confident this would work:

In each of those triggers, set a global variable to true:

Gradioflare = true;

Then change your script to assign the t variables to reference the globals instead.

_t1 = Gradioflare;

Share this post


Link to post
Share on other sites

Couldn't I just work around the global variable instead of making a local one?

Say: If Gradioflare=True then getpos radioflare

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×