Jump to content
Ulfgaar

"Group" and Respawn/Trigger issues

Recommended Posts

Hello folks! 

I've encountered an issue which is making problems for my mission - and I think it explains former problems I’ve had also in previous missions I’ve made (multiplayer missions, hosted on dedicated servers - or local).

When making missions, I at times use triggers to recognize that a specific group is either in a vehicle, or has departed a vehicle. To do this, I use the following codes. 



This one I use to link an entire Unit to a said "group", for script/coding purposes when it comes to triggers etc. 

<GROUP> = group this;



This one I use to detect if said above named "group" has entered the vehicle. This particular one, checks group for "dead" people, so it will only count members still alive in the group. This is normally put into the triggers condition, to then activate the trigger. 

{_x in <VEHICLE>} count units <GROUP> == {alive _x} count units  <GROUP>;

 


This one is as the one above, just for detecting when said "group" has left a given vehicle.

{_x in <VEHICLE>} count (units <GROUP>) ==  0;



In my latest mission, i've also added the "onPlayerkilled.sqf" and "onPlayerRespawn.sqf" files, to both save gear on death, and give it back once they respawn.
 

onPlayerKilled.sqf

player setVariable["Saved_Loadout",getUnitLoadout player];


onPlayerRespawn.sqf

removeAllWeapons player;
removeGoggles player;
removeHeadgear player;
removeVest player;
removeUniform player;
removeAllAssignedItems player;
clearAllItemsFromBackpack player;
removeBackpack player;
player setUnitLoadout(player getVariable["Saved_Loadout",[]]);

My problem is that when someone dies, they apparently lose their link to their "group" - which means that above triggers with "enter/leave" vehicle using the group codes - won’t work.

Example:
Helo Evac from a said location. The helicopter is set to land on location, and wait for the group to enter it. A trigger prevents the helicopter from moving on until the entire group is in the chopper. The problem is if we've had deaths in the group, who have then respawned. As the trigger used to check if the group is in the chopper, counts out dead group members - they are counted as "not being in the game anymore" by all concerns for the trigger once they have died and respawned. The respawn script does not "re-implement" them into the given group - and we get the case where the helicopter will take off once the "original group members" who never died during the mission is in the chopper, while leaving respawned members behind. Only way I’ve found to counter this so far, is to make sure that the "original members who never died", enter the vehicle last - but this is an issue, as this particular mission is going on the steam workshop soon, and it'll be tricky to get this through without giving away some hints on what’s going to happen, before it happens. 

I’m no script/code guru - but I’m quite a proficient "googler" and "forum reader" when it comes to finding codes/scripts I need to do what I want. I am however hoping that some of the script/coder guys in this community could help me out with this one - either by providing me changes to the respawn scripts, so that the players still will be counted as "part of the group" when respawning, or perhaps making changes to the trigger condition code so the group is still counted properly, despite deaths (while also counting deaths - as some might die during the mission - which has a set amount of respawns). 

Think you guys can see my predicament here

Share this post


Link to post
Share on other sites

A respawned guy belongs to group-null when he dies, he recovers his group after respawning, except if you changed something via script or mod.

 

Same for a "waiting for revival" guy. That means you can even have a alive/died/alive/died/alive sequence for a guy non rescued but respawned!

But when a guy dies, the group changes only when the situation is known by the other member "We have a man down". It's not instantaneous (see your command bar).

The alive or not alive status changes at once.

So you need to compare:

{_x in <VEHICLE> && alive _x} count units <GROUP> == {alive _x} count units <GROUP>;

 

{_x in <VEHICLE> && alive _x} count (units <GROUP>) == 0;

 

Share this post


Link to post
Share on other sites

Im trying to understand what you're saying compared to what i asked, but im strugling a bit.

My example is:

Teamleader of a unit of 6 players, has the ..

OWL = group this;

.. in his init field, making this entire unit of 6 players belong to the group now named "OWL". 

At the end of the mission, i have a waypoint trigger with this line in its Condition field ..
 

{_x in Heli1} count units OWL == {alive _x} count units  OWL;

.. which then checks when all of the alive group members are in the helicopter, before it moves on. Basicly, prevents the helicopter moving on before all group members are in the helicopter.


My problem is that when people apparently die, and get respawned into the game - they lose their connection to said group "OWL", which makes the helicopter move on without the players in question who have died and respawned. Only way to keep the helicopter from moving on, is to make sure that the players of the "original OWL group" that never died through the mission, enters it last. 

What im wondering about, is if there is a way to make sure that when players respawn back into the game, that they are again put into the group "OWL" so that they will be counted by the trigger command ..

{_x in Heli1} count units OWL == {alive _x} count units  OWL;

.. as being alive and part of said group still.


I notice that the commands you linked to back to me in your post differs somewhat from those i used - will those you posted do what i ask for? or are they just different versions of the same ones im using?
 

Share this post


Link to post
Share on other sites

The alive status is straight (no delay). But the dead still belongs to the group a few moment (situational awareness).

so, did you test {_x in heli1 && alive _x} count units owl == {alive _x} count units owl   ?

That's the right way to make sure all alive guys are in helo, without messing with dead inside or outside.

 

As already said, except some possibly weird addons , respawned unit recovers his former group (if not deleted when empty (all died))

  • Like 1

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

×