Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
darksider282

trouble with "settriggeractivation"

Recommended Posts

I'm trying to set a trigger with two conditions, namely that an empty vehicle is not present and that all opfor units are not present. I've got the basic trigger settings set to check for opfor, and I'm trying to add the other condition via the settriggeractivation code. This is what I have:

this && trig1 setTriggerActivation ["VEHICLE", "NOT PRESENT", false]

trig1 being the name of this particular trigger. I suspect that is where the problem is, because I get a message saying "Type any, expected bool" and I can't for the life of me figure out what the problem is. I've even done test triggers set for only one condition using this code and nothing from the menu settings and get the same message every time. Any help would be much appreciated.

Share this post


Link to post
Share on other sites

You're trying to execute a command where that Condition field only wants to see a true or false return.

Edited by DMarkwick

Share this post


Link to post
Share on other sites

You may also get away with just one trigger

opfor not present

cond

this and (vehiclename distance thistrigger >50)

vehiclename would be whatever you named the vehicle

Share this post


Link to post
Share on other sites

The problem here is that you run code that does not return a boolean (In this case setTriggerActivation does not return anything). The Condition line requires code that either returns true or false (a boolean).

Try running this:

!(myCar in list this) && (1 > {alive _x} count this list)[/Code]

Set the trigger to "activated by OPFOR", so that only OPFOR units will be counted.

This solution is out of the head and untested.

Share this post


Link to post
Share on other sites

First off, thanks all for the suggestions! Mondkalb, that suggestion seems like it could work if I could understand any of it. I'm really fairly new to trying to do some of the more sophisticated things with the editor. F2k sel, I'm looking for the vehicle to not be present due to two possible reasons: first, it has a random appearance rate so it might not spawn at all, and then second would be for it to be destroyed. Will checking distance cover that?

Share this post


Link to post
Share on other sites

If the car doesn't need to be within the trigger's area you could do a check to see if its "alive". As in "!(alive myCar)" would (should ;)) return true if it either doesn't exist or is destroyed.

Share this post


Link to post
Share on other sites

!alive will only work if the vehicle existed in the first place.

The above I posted won't work either for the same reason the car doesn't exist so it's distance can't be checked.

You may be able to get around this by creating the vehicle but then deleting it.

in the vehicles init or wherever your creating the vehicle

if (random 100 > 50 ) then {deleteVehicle vehiclename}

that would give a 50/50chance just adjust to whatever you require.

then in the trigger

opfor not present

cond

 this and !alive vehiclename or vehiclename distance thistrigger  >50

Share this post


Link to post
Share on other sites

F2k Sel your work around worked perfectly. Creating and then immediately deleting (randomly) the vehicle in question allows the !alive check to work, and the mission is now working and triggering perfectly. Thanks all!

Share this post


Link to post
Share on other sites
Sign in to follow this  

×