Jump to content
Lorflord Denninard

How to detect if player(s) are alive, dead or player slot empty.

Recommended Posts

So, i'm making a mission in which i used the Unit Capture and Unit Play functions so a pair of helicopters could land on a clearing in a dense forest, but i want it so that when they get off the chopper they head to an officer and the briefing starts, but i'm trying to setup a trigger that detects alive players but if i set it up to detect all 10 slots, then if mission is not full it wont start, so i want to know if you guys could help me, i remember it was something like: if !alive UnitName or _____

 

Any ideas?

 

Thanks a lot! :)

Share this post


Link to post
Share on other sites
35 minutes ago, rebitaay said:

Sounds like you want "alive" or "isNil".

But how would i make it an argument in a trigger?

 

Condition:

if [!alive unit1] or [IsNil unit 1], [!alive unit2] or [IsNil unit 2]; [!alive unit3] or [IsNil unit 3]; etc?

 

 

Share this post


Link to post
Share on other sites
44 minutes ago, Lorflord Denninard said:

But how would i make it an argument in a trigger?

 

I didn't understand what you're trying to make, so I can't quite say. If you elaborate more on exactly what you're trying to do, I could possibly help you further.

 

But from the sounds of it, you're new to scripting. You should check out Scripting Introduction.

I personally learned most of what I know from the Community Wiki, which is definitely worth checking out as well.

Share this post


Link to post
Share on other sites

condition

(!isNil "unit1" && {alive unit1}) || (!isNil "unit2" && {alive unit2}) ||......

 

Share this post


Link to post
Share on other sites
1 hour ago, rebitaay said:

 

I didn't understand what you're trying to make, so I can't quite say. If you elaborate more on exactly what you're trying to do, I could possibly help you further.

 

But from the sounds of it, you're new to scripting. You should check out Scripting Introduction.

I personally learned most of what I know from the Community Wiki, which is definitely worth checking out as well.

Ok, so it goes something like this, when the mission starts, a pair of helos drop all the players at a camp, what i want to do is that once all players unload from helicopters they walk into a trigger zone where i have set up an officer with a "GUARD" animation, what this trigger does is that when it detects all players online in that trigger area, it switches to a briefing animation, but since maybe at times not all player slots are filled (lets say a group of 5 tries to make the mission out of the 10 posible) of course the players in that trigger zone will vary, so i want it to detect all used player slots online at the momento of the mission start and when they are at the trigger zone (after they landed) it starts the briefing animation, but i dont know which script to use, i know one should be !alive so it detects if the players are alive, but i need another script to link it so that game knows when they are not used (no AI in player slots).

Share this post


Link to post
Share on other sites
3 minutes ago, killzone_kid said:

condition


(!isNil "unit1" && {alive unit1}) || (!isNil "unit2" && {alive unit2}) ||......

 

 I'll check it and reply, thanks beforehand man!

Share this post


Link to post
Share on other sites

Now I am confused about what you want. You want trigger to activate when any of the players enters it or when all players enter it? Because you can just set trigger in editor to activate for Any Player.

Share this post


Link to post
Share on other sites
8 minutes ago, killzone_kid said:

Now I am confused about what you want. You want trigger to activate when any of the players enters it or when all players enter it? Because you can just set trigger in editor to activate for Any Player.

 

What you said was more like what i was looking for, a trigger that activates when all available players are present, sorry im not that good explaining it seems, but i have to say in my dfense that english is not my first language so maybe that complicates it too hahaha, besides scripting is in english too, so, yeah i get confused at times too, but thanks a lot!

Share this post


Link to post
Share on other sites

If all players belong to the same group, you can set activation for the group and it will only activate when every member of the group is present.

Share this post


Link to post
Share on other sites
8 hours ago, Lorflord Denninard said:

i want it to detect all used player slots online at the momento of the mission start and when they are at the trigger zone (after they landed) it starts the briefing animation, but i dont know which script to use

 

In case all players don't belong to the same group, you could try this

private _trig = createTrigger ["EmptyDetector", getPos _officer, false];
_trig setTriggerArea [10, 10, 0, false, 10];
_trig setTriggerActivation ["WEST", "PRESENT", true];
_trig setTriggerStatements ["allPlayers arrayIntersect thisList isEqualTo allPlayers", "call briefingAnimation", ""];

 

Share this post


Link to post
Share on other sites
19 hours ago, killzone_kid said:

condition


(!isNil "unit1" && {alive unit1}) || (!isNil "unit2" && {alive unit2}) ||......

 

Well, it aint working, if you want i can send you the misión so you can check it? its quite on its bare bones yet, but if it helps i'd try it.

Share this post


Link to post
Share on other sites
5 hours ago, Lorflord Denninard said:

Well, it aint working, if you want i can send you the misión so you can check it? its quite on its bare bones yet, but if it helps i'd try it.

 

Thanks, but I'm ok. The expression is solid, but I don't really understand what you want even after enough posts in this thread, so I guess I won't be able to help you, sorry.

Share this post


Link to post
Share on other sites
On ‎25‎/‎03‎/‎2017 at 4:21 AM, killzone_kid said:

 

Thanks, but I'm ok. The expression is solid, but I don't really understand what you want even after enough posts in this thread, so I guess I won't be able to help you, sorry.

Sorry, but i think i've got it: i want a script that activates when all available players are inside it.

 

Thats it :)

Share this post


Link to post
Share on other sites
Guest
5 hours ago, Lorflord Denninard said:

i want a script that activates when all available players are inside it.

I'm not sure but

allPlayers isEqualTo thisList

@killzone_kid

What do you think about that.

Share this post


Link to post
Share on other sites
2 hours ago, harmdhast said:

I'm not sure but


allPlayers isEqualTo thisList

@killzone_kid

What do you think about that.

I am not 100% the order will be the same, which will result in mismatch.

Share this post


Link to post
Share on other sites

 

20 hours ago, harmdhast said:

I'm not sure but


allPlayers isEqualTo thisList

@killzone_kid

What do you think about that.

 

What if not all the player slots are filled? Will it still work? I'll try again with the one you provided @killzone_kid and see if i can make an adjustment in the script to work, ill have to try it with Friends first tho.

Share this post


Link to post
Share on other sites

You can try this for condition. Set trigger activation for "ANY PLAYER"

 

Condition

this && {(((allPlayers - entities "HeadlessClient_F") - thisList) - allDead) isEqualTo []}

 

  • Like 1

Share this post


Link to post
Share on other sites
Guest
21 hours ago, killzone_kid said:

You can try this for condition. Set trigger activation for "ANY PLAYER"

 

Condition


this && {(((allPlayers - entities "HeadlessClient_F") - thisList) - allDead) isEqualTo []}

 

I knew I got something :p

Edit : allPlayers returns dead players so no need for allDead ??

Share this post


Link to post
Share on other sites
5 hours ago, harmdhast said:

Edit : allPlayers returns dead players so no need for allDead ??

 

On 3/24/2017 at 5:13 AM, Lorflord Denninard said:

i'm trying to setup a trigger that detects alive players

 

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

×