Jump to content
Mynock

Seeking workaround for destroying empty vehicles

Recommended Posts

I'm looking for a workaround for the issue where destroying a "friendly" EMPTY sided vehicle results in the squad turning on the player and shooting him/her. Specifically I am looking to destroy a NATO helicopter with a NATO unit. I have placed the helicopter as an EMPTY sided unit. I have tried the setFriend command and the createGroup command to assign the helicopter as an enemy to WEST or as part of an EAST group respectively. Neither has worked. There is a support ticket for the issue I found, however BI claims this is by design that destroying a vehicle, even if it's EMPTY but it would normally belong to the same side, will cause the squad to turn on the player... So there will be no real fix coming anytime...well ever I guess...

Is there a known workaround? My searching has resulted in nothing so far. The only idea I can come up with is to switch all of the BLUFOR units I have placed to OPFOR units but dress them manually like BLUFOR units, however this will create problems later in the mission as the BLUFOR extraction vehicle likely isn't going to want to pick up OPFOR units...

Share this post


Link to post
Share on other sites

Unfortunately that does not work, but thanks for the suggestion.

Share this post


Link to post
Share on other sites

Humm you could spawn a CSAT pilot then move him in the helicopter and delete him. Its messy but should set the helicopter as a CSAT vehicle just as if it was flown by them.

 

 

CSATpilot  moveindriver NATOhelo;

deleteVehicle CSATpilot;

Share this post


Link to post
Share on other sites

hi,

 

I tried to addVehicle the chopper to an OPFOR group but it doesn't work.

I tried to addRating -5000 the empty chopper but its side remains CIV.

 

One way is to add OPFOR unit as crew in the chopper but it is not what you are looking for.

 

If you delete/kill crew, chopper's side switch to CIV and AI stop to fire at it.

 

Maybe something like:

_group = _this select 0;
_chopper = _this select 1;

    {
        _x addRating 100000;
    }
    forEach units _group;

    while {alive _chopper} do
    {
        {
            _x doTarget _chopper;
            _x forceWeaponFire [ weaponState _x select 1, weaponState _x select 2];
        }
        forEach units _group;
        sleep 0.25;
    };

EDIT: if the unit who destroy the chopper is ONLY the player use addRating.

player addRating 100000;

With this command AI will not consider the player as sideEnemy because he destroyed empty vehicle.

 

cya.

 

Nikiller.

Share this post


Link to post
Share on other sites

Humm you could spawn a CSAT pilot then move him in the helicopter and delete him. Its messy but should set the helicopter as a CSAT vehicle just as if it was flown by them.

 

 

CSATpilot  moveindriver NATOhelo;

deleteVehicle CSATpilot;

I actually tried this as well but you're right it doesn't really work as deleting the pilot resets the helicopter's side. We were thinking alike.

 

 

hi,

 

I tried to addVehicle the chopper to an OPFOR group but it doesn't work.

I tried to addRating -5000 the empty chopper but its side remains CIV.

 

One way is to add OPFOR unit as crew in the chopper but it is not what you are looking for.

 

If you delete/kill crew, chopper's side switch to CIV and AI stop to fire at it.

 

Maybe something like:

_group = _this select 0;
_chopper = _this select 1;

    {
        _x addRating 100000;
    }
    forEach units _group;

    while {alive _chopper} do
    {
        {
            _x doTarget _chopper;
            _x forceWeaponFire [ weaponState _x select 1, weaponState _x select 2];
        }
        forEach units _group;
        sleep 0.25;
    };
EDIT: if the unit who destroy the chopper is ONLY the player use addRating.

player addRating 100000;
With this command AI will not consider the player as sideEnemy because he destroyed empty vehicle.

 

cya.

 

Nikiller.

I'll have to try setting the player's rating, I didn't think to try that, I'd only tried setting the helicopter's rating. Theoretically the player should be the one destroying it as the mission is designed for single player and I was planning to give the player an explosive charge to detonate the helicopter (it's already damaged when the player discovers it). I suppose the player might order the AT Rifleman unit in the squad to fire on it, but I can simply put a note in the mission to not do that.

Share this post


Link to post
Share on other sites

You can also use addRating forEach units group player

{_x addRating 100000} forEach units group player

Like that any player's group unit can destroy the empty chopper without being considered renegade.

Share this post


Link to post
Share on other sites

Be sure you're running the addRating command where the unit destroying the aircraft is local.

 

It's the same problem the A2 SecOps "TRAP" (downed aircraft) mission suffered from.  The aircraft had to be destroyed for the mission to complete, and sometimes it spawned in as damaged rather than destroyed.  The player would destroy the aircraft, but then everybody turned against the player due to the hit against the player's rating.

 

It was handled when A2 updated with Corepatch, if you have A2 you can see how it's done in the missions.pbo> som> data> scripts> TRAP folder, phase script 07.  Deals with any side, whether player or AI, destroying the aircraft.  Uses public variable, public variable event handler and a SOM function for multiplayer communication, but RemoteExec or RemoteExecCall can be used instead.

 

Basically, the aircraft is local to the server.  When a unit (player or AI) destroys the aircraft, the "killed" event handler spawns code and transmits a public variable for others to run the same code.  The code runs only where the killer is local.  The code reimburses the killer the rating lost for destroying the aircraft.  The rating amount reimbursed is fixed based on the aircraft type.  (Problem is timing, you can't get the killer's rating before the kill when you don't know who the killer is until the aircraft is destroyed; and as soon as the aircraft's destroyed the rating change is practically instant.)

 

It still suffers a problem in that there can be communication delay; during the time it takes for communication to come through and the code to run local on client, the killer is vulnerable to getting killed as renegade.  So when destroying the aircraft the killer has to be out of sight of others (i.e., when on foot I would order team members to watch away from me and make sure I'm not visible to others) , else protected from being shot (i.e., gunner inside a vehicle).  Once the communication comes through and rating added, the killer is safe.  So not a perfect fix, but hope this helps.

Share this post


Link to post
Share on other sites

rcmw's idea will sort of work just leave the enemy pilot in the vehicle, you can make him invisible  and disable  simulation.

It will look empty, to stop AI shooting at chopper you can set pilot to captive.

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

×