Forum Jump :

Author Message


Posts: 34
Rank:


Level: Member

Country: ba
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2014-05-05 15:28        
     
So I wanted to create a trigger that activates if non of the players are present in a marked area.

When I say non of the players I mean every unit that is playable not including Blufor AI that are not playable. So If I had 30 AI that are set to playable that include them.

So if all playable units leave marked area or die and there are non left the trigger fires.

If for example 1 playable unit is left all other left the area or died the trigger wont fire.


Author Message


Posts: 93
Rank:


Level: Member

Country: fr
Location: Paris
Occupation:
Age: 47
In-game name:

 
#2 Posted at 2014-05-05 20:03        
     
Use the following as condition in the trigger :

{_x in playebleunits} count thislist == 0


Advertisement


Author Message


Posts: 34
Rank:


Level: Member

Country: ba
Location:
Occupation:
Age:
In-game name:

 
#3 Posted at 2014-05-06 00:16        
     
Ok but this doesn't count Player himself. I tried to group the trigger whit this condition to the player has no effect.

How do count Player himself in without making if he dies or leaves and all playable are still inside the trigger fires.


Author Message


Posts: 1473
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#4 Posted at 2014-05-06 00:47        
     
You have spelt it incorrectly it should be playableunit, and is MP only.
{_x in playableunits} count thislist == 0

Playableunits


Author Message


Posts: 34
Rank:


Level: Member

Country: ba
Location:
Occupation:
Age:
In-game name:

 
#5 Posted at 2014-05-06 01:18        
     
When I select Player in MP and not playable the trigger fires becouze I didn't select Playable. But when I select Playable the trigger doesn't fire but also when I leave the area whit that playable the trigger still doesn't fire

{_x in playableunits} count thislist == 0


Author Message


Posts: 1473
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#6 Posted at 2014-05-06 03:11        
     
Try this if it still doesn't work I haven't a clue.

{(_x in playableunits) and (isPlayer _x)} count thislist == 0

You may be able to see the list of playableunits

hint str playableunits


Author Message


Posts: 34
Rank:


Level: Member

Country: ba
Location:
Occupation:
Age:
In-game name:

 
#7 Posted at 2014-05-06 03:48        
     
Ok whit this the trigger just fires immediately no matter if Im in the marked area or not.

So here is everything I put to trigger:

Axis A: 100 Axis B: 100
Not Present
CONDITION:
{(_x in playableunits) and (isPlayer _x)} count thislist == 0
ON ACT.: "markerName" setMarkerColor "ColorRed"


another trigger:
CONDITION: markerColor "markerName" == "ColorRed"
ON ACT.: ["Mission Failed",false,30] call BIS_fnc_endMission


And whit this on MP LAN game it immediately fires the End mission trigger and the marker turns RED.

So what I am trying to do is if all Player and Playable units leave the marked area (non of them are inside) the End Mission trigger fires which says Mission Failed.


So what does this == 0 stand for ?? is it true or false or its just the equal of number of units inside the marked area.


Author Message


Posts: 1473
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#8 Posted at 2014-05-06 11:57        
     
In this case ==0 stands for zero.

value/code == value/code then it is true and trigger fires else it's false and it doesn't

I think you need to use anyone present otherwise thislist will always be empty.

I don't know why markerColor "markerName" == "ColorRed" fails in MP
Using triggers in MP games can be tricky due to locality issues.


Author Message


Posts: 34
Rank:


Level: Member

Country: ba
Location:
Occupation:
Age:
In-game name:

 
#9 Posted at 2014-05-06 17:43        
     
holy muffins ! Changing the trigger to Present Anybody actually made this work just tested it out in MP *THUMBS UP*

Added 20 minutes later:

Ok just found another problem...When a player or all playable units enter a vehicle or a turret in the area then it counts them as they have left the area and the trigger fires. But they didn't they are inside just in turret or vehicle.

How to include them when they are inside a vehicle or a turret inside the marker ??

This post was edited by MaestroProduction (2014-05-06 18:03, ago)


Author Message


Posts: 1473
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#10 Posted at 2014-05-06 20:19        
     
Yes that's another issue, try using vehicle _x

{(vehicle _x in playableunits) and (isPlayer vehicle _x)} count thislist == 0

it should work for foot soldiers and units in vehicles. (maybe)


Author Message


Posts: 34
Rank:


Level: Member

Country: ba
Location:
Occupation:
Age:
In-game name:

 
#11 Posted at 2014-05-06 22:10        
     
No it doesn't have any effect still when I enter a vehicle it fires the trigger.


Author Message


Posts: 1473
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#12 Posted at 2014-05-06 23:03        
     
You got me beat now, I know this bit works in SP

{isPlayer vehicle _x} count thislist == 0