Jump to content
Sign in to follow this  
Beny.cz

How to force a trigger to "update"

Recommended Posts

Hey,

is there a way to "update" a trigger?

This is how the trigger looks like:

Act: BLUFOR, present, repeatedly

On Act: trigger1 = count thislist

So, it counts BLUFOR units in the area, but the problem is that if there are more / less units, the trigger does not update (it only updates if all BLUFOR units leave the area).

What i need is a command or sth that makes the trigger update (reinitialize) .

Share this post


Link to post
Share on other sites

Well, as you set the trigger to repeatedly, "thislist" is constantly updated.

Change your on activation line this way :

east_list = thislist

Then you can check when you want the content of the array "east_list", count it or do whatever you want.

You can also name the trigger, "east_trigger" for example, and you will be able to check the same thing thanks to the "list" command, such as :

count list east_trigger > 100

for example.

So in brief :

(1) The trigger is fired when an eastern unit enters it, and will be fired again only if the trigger area is emptied by eastern units then refilled by at least one of them (with the same consequences on the "on activation" or "on deactivation" lines) ;

(2) But the list of units triggering the trigger (hehe) is constantly updated and can be accessed through "thislist" or "list" commands.

Share this post


Link to post
Share on other sites

I've also tried it but needed it to update for each side

Problem is its not doing what I intended it to do,lol

b1trigger setTriggerStatements ["this", "east_list = thislist; west_list = thislist ;if ((west countside thislist >= 1)&&(east countSide thislist <= 1)) then {""b1"" setmarkercolor ""colorBlue""} ;if ((east countSide thislist >= 1)&&(west countSide thislist <= 1)) then {""b1"" setmarkercolor ""colorRed""} ;if ((east countSide thislist >= 1)&&(west countSide thislist >= 1)) then {""b1"" setmarkercolor ""colorBlack""} "," ""b1"" setmarkercolor ""colorblack"" "];

Whan opfor is inside the trigger the marker color is red, which is correct, but when I move a blufor man inside, the marker stays red where I want it to turn black...I kill the opfor man, with blufor man still inside trigger but it still stays red...I have to move the blufor man outside of trigger then back in...Any suggestions???

Edited by Cornish Rebel

Share this post


Link to post
Share on other sites

I can get it to work but in a slightly different way.

1. place a gamelogic and in it's init put update=true

2. create your trigger in the editor and set it to

anyone present,

repeating,

and set all three timers to 2 so the trigger only checks every 2 seconds.

In the init replace this with update

In the On Act put null=[thislist] execVM"markerupdate.sqf";update=false

In the On dea put update=true

3. create the following script and save it as markerupdate.sqf

wholist = _this select 0;

if ((west countside wholist >= 1) && (east countSide wholist <= 1)) then {
"b1" setmarkercolor "colorBlue";
};
if ((east countSide wholist >= 1)&&(west countSide wholist <= 1)) then {
"b1" setmarkercolor "colorRed";
};
if ((east countSide wholist >= 1)&&(west countSide wholist >= 1)) then {
"b1" setmarkercolor "colorBlack";
};

4 create marker and name b1

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  

×