Jump to content
Sign in to follow this  
febriannas

Trigger CONDITION for checking total ticket

Recommended Posts

i want to make a trigger that act on CONDITION of the total ticket left.

ex: if blufor ticket left is 5 than spawn a tank

so what is the condition to call the total ticket?

Share this post


Link to post
Share on other sites

I haven't tinkered with tickets, but apparently bis_fnc_respawnTickets returns a number and an array:

NUMBER - remaining tickets after adjustment (-1 when no tickets were defined yet)

ARRAY - when array was used as an argument, returned value is [<losingSpace>,<tickets>]

condition:

(ticketHandle select 0) == 5

Activation:

_script = [arguments] execVM "tankSpawn.sqf";
Edited by Iceman77

Share this post


Link to post
Share on other sites

wow thank you iceman for the response, one more question

(ticketHandle select 0) == 5 for the condition

so what is the (ticketHandle select 0) zero stands for?

Share this post


Link to post
Share on other sites

and for the sides condition of the ticket like "west or east", where we put it?

or just sync it?

Edited by febriannas

Share this post


Link to post
Share on other sites
(ticketHandle select 0) == 5

Should be <= 5, though, as triggers only tick every 0.5 seconds, so if tickets are 6, and 2 are lost at the same time, next check will be 4, and the trigger will never activate.

Share this post


Link to post
Share on other sites

what is it mean?

so..

(ticketHandle select 0) == 5 shouldbe (ticketHandle select 0) <= 5

and for checking th side ticket where do we put the west or east?

Share this post


Link to post
Share on other sites
what is it mean?

so..

(ticketHandle select 0) == 5 shouldbe (ticketHandle select 0) <= 5

Yes, incase the score is never actually equal to 5. So we want to check if it's 5 or less. Use == sparingly when checking values.

Share this post


Link to post
Share on other sites

so for the effecting trigger side ticket?

where do we put it west or east?

if sync where to sync, to the ticket module? or to the game logic module? or maybe setting trigger activation BLUFOR?

Edited by febriannas

Share this post


Link to post
Share on other sites

Okay I had to set up my own little scenario in order to provide a legit answer. I had my head on backwards there for a minute lol.

Trigger + module Method (assuming you've the module setup)

trigger condition:

[west,0] call BIS_fnc_respawnTickets <= 5

External Script Method (no module or triggers)

init.sqf.

[] spawn {
   //Starting tickets 
   [west,50] call BIS_fnc_respawnTickets;

   //Monitor tickets
   while {[west,0] call BIS_fnc_respawnTickets >= 5} do {
    sleep 1;
       if ([west,0] call BIS_fnc_respawnTickets <= 5 && {isNil "wTankSpawned"}) then {
           _wTank = "B_MBT_01_TUSK_F" createVehicle (getPosATL wBasePos);
           wTankSpawned = 1;
       };
   };
};  

Edited by Iceman77

Share this post


Link to post
Share on other sites

WOWOWOWOOW,

SORRY

the

[west,0] call BIS_fnc_respawnTickets <= 5 and [east,0] call BIS_fnc_respawnTickets <= 5

its WORKINGG!!

it workk

ahh iceman i think i start to loving u, always there to help me out. 3 lol

please dont get bored to always help me and the others.

once again thank you dude

Edited by febriannas

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  

×