Jump to content
Sign in to follow this  
felingard

Issues setting respawn for PvP with AI in both sides

Recommended Posts

Hi

Im playing arma 1 and 2 for a while and amateur editing missions. So i know the basics and know about the AI regular problems but what i have here is different.

My mission is a PvP COOP. Like, if the BLUFOR reaches some places the OPFOR will send AI reinforcements and if OPFOR reaches certain places BLUEFOR will send AI reinforcements. BLUEFOR and OPFOR have players slots.

What is happening is everything works fine, until the BLUEFOR AI start to engage OPFOR AI. After that if any players in OPFOR team die, they become invisible to BLUFOR AI in next life. The OPFOR AI still targeting BLUFOR players and BLUFOR AI but the BLUFOR AI stop engaging OPFOR players that died once for ever.

A detail is, when the mission have respawn seted to SIDE the problem doesnt happen, is certain something with respawn BASE option.
The mission have no mods and im using the default respawn config for the mission. Setting a marker and setting the respawn at  BASE in description.ext. Have no respawn for unplayable units, just the playable groups, the mission is simple as it can be and for sure is not heavy.

 

Maybe have some basic configs sets to have missions with OPFOR and BLUFOR with players respawning and AI. Maybe a module. But i searched everything and did not find what is. So please help-me.

Share this post


Link to post
Share on other sites

Are you using the First Aid: Simulation module (AIS) or a setCaptive command?

 

When a unit goes into agony the AIS sets the unit captive.  If the unit recovers, captive gets removed.  But if the unit dies while in agony, captive does not get removed and the respawned unit is set captive.  Captive units are detected as side civilian and AI won't engage them.

 

A respawned captive unit needs "<unitName> setCaptive false;" run on the machine where the unit is local to have AI start engaging them again.  Simple fix might be a Respawn Event Handler or MPRespawn Event Handler that includes:

_unit = _this select 0;
if (Captive _unit) then {_unit setCaptive false};

 

If not using AIS, maybe test with a respawn event handler or some trigger to detect and message about respawned player side and captive status, to eliminate that as a possibility.

 

 

Share this post


Link to post
Share on other sites

Thank you! Its probably that.
Yes. I´m using AIS, First Aid Simulation and battlefield clearance on the playable units. But i did not get it. Should i put this code line that you told me in the unit initialization and its fixed? If not. Can you explain me better how i call to set captive  false when the unit dies?

Share this post


Link to post
Share on other sites

Not tested, but try this in the editor init field of the playable units in groups synched to the AIS (because one in group synched = whole group gets synched):

 

_respawnHandle = this addEventHandler ["Respawn",{Private "_unit"; _unit = _this select 0; if (Local _unit) then {if (Captive _unit) then {_unit setCaptive false;};};}];

The event handler will be added on each machine joining, but the setCaptive command will only run where the respawned unit is local.

Share this post


Link to post
Share on other sites

Oh yeah dude! It worked really well. This info should be in AIS module information because many people do missions with AIS and respawn and got the same issue.

Thank you for your time. See you

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  

×