Jump to content
Hardly

Exit Tank as Commander - Immediately run over by same vehicle

Recommended Posts

I've found an interesting problem while playing a mission with AI team mates.

 

If I get in any vehicle as commander and have a teammate drive, I can order the teammate to move to a position using the map or visual interface.

 

However, when I exit the vehicle after it's stopped moving, almost all of the time(especially in tanks!) the AI driver teammate attempts to return to formation and promptly drives over me.

 

Is there a proper way to order a driver to stop moving? Or do I have to switch to the driver position, THEN exit...then re-enter, then change back to commander every time?

Share this post


Link to post
Share on other sites

Yep! known problem.

You can work around with something like that (tank or land vehicle will stop for 5 seconds, adjustable):

 

["beQuiet","onEachFrame",{
    if !(isNil {player nearEntities ["landVehicle",6] select 0} && {!isNull driver (player nearEntities ["landVehicle",6] select 0)}) then {
      _veh = player nearEntities ["landVehicle",6] select 0;
      if (_veh != vehicle player && group driver _veh == group player) then {
        _unit = driver _veh;
        _unit disableAI "path";
        _unit spawn {
          _unit = _this;
          uisleep 5;
          if (alive _unit) then {_unit enableAI "path"}
        };
      };
    };
}] call bis_fnc_addStackedEventHandler;

 

  • Like 1

Share this post


Link to post
Share on other sites

Thank you for this. I'm not sure where to put it in the mission files but I'll figure it out!

 

Meanwhile, for people who are already in-mission, switching to driver THEN exiting the vehicle seems to prevent this MOST of the time.

Share this post


Link to post
Share on other sites

 

Quote

...order a driver to stop moving...

 

Here is an idea, add the following into the init statement field for your tank.

this addEventHandler ["GetOut", "if (_this select 1 == 'commander') then {dostop (driver (_this select 0));};"];

 

 

When acting as the commander for the tank, tank will stay put when you get out, until you order the driver to move elsewhere or to regroup.

 

Didn't test it in multiplayer.

Edited by mt_klip12
  • Like 1

Share this post


Link to post
Share on other sites

How would this work for abandoned/neutral vehicles? Would I have to tag every vehicle in the mission including enemy vehicles if they become abandoned?

Share this post


Link to post
Share on other sites

The code I wrote did that for you... and btw, more efficient than a simple dostop as in mt_klip12 script :f:

 

Share this post


Link to post
Share on other sites

Okay, I pulled C_EB.altis from the mission files and got it compiling properly for the first time ever so now I can try it out. :)

Share this post


Link to post
Share on other sites
Quote

for abandoned/neutral vehicles

 

using something like 'vehicles' would add the eventhander to all 'vehicles' in the scenario.

 

Quote

{_x addEventHandler ["GetOut", "if (_this select 1 == 'commander') then {dostop (driver (_this select 0));};"];} foreach vehicles;

 

and if you wanted to narrow down the 'all' vehicle list, you could probably weed out want we don't want.  side, class, empty....

Share this post


Link to post
Share on other sites

Or you could run kju's "DisabledFriendlyFire Server Side Addon". All player & AI units become immune to being run over by the idiot A3 drivers. Also prevents players and units from being shot by purblind friendly AIs.

 

You can find the file ^ server key here:

https://dev.withsix.com/projects/pvpscene-tweaks/fileshttps://dev.withsix.com/projects/pvpscene-tweaks/files

 

It dates from A2/CO but works flawlessly in A3 MP & SP.

  • 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

×