Jump to content
  • 0

AI Bus stucking to invisible obstacles


Schalldampfer

Question

https://github.com/andgregor/dayZ-AI-Bus-Route
While testing this old script in Epoch 1.0.6.1, I got an issue:

When I ride on the bus which an AI is driving, the bus start driving well.
But after running about some ten or hundred meters away,
the bus suddenly stop and damage me as if there's an invisible barrier in front of me, 
and it starts bouncing like a football there.
 

I want any idea to make the script works well.

---

I have changed a part of init_bus.sqf from

Spoiler

 //Uncomment for normal dayZ
 //dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_axeBus];
 //For Epoch - Comment out for normal dayZ | Credit to Flenz
 PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_axeBus];

to

Spoiler

 //Uncomment for normal dayZ
 dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_axeBus];
 //For Epoch - Comment out for normal dayZ | Credit to Flenz
// PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_axeBus];

to make it work in 1061, and player_axebus.qf to

Spoiler
private["_axeBusDriver","_nrBuses","_getInEvent","_getOutEvent","_survivors","_pos_bus"];
_nrBuses=[];
while {alive player}
do
{
 while {count _nrBuses <1}do{_nrBuses = nearestObjects [getPos player, [axeBusType], 600];sleep 3;};
 
 {
  if(_x getVariable["isAxeAIBus",0]==1)then{ 
   _getInEvent = _x addEventHandler ["GetIn", {_this execVM "busroute\player_join_bus.sqf"}];
   _x setVariable ["axeGetInBusEv",_getInEvent,false];
   _getOutEvent = _x addEventHandler ["GetOut", {_this execVM "busroute\player_leave_bus.sqf"}];
   _x setVariable ["axeGetOutBusEv",_getOutEvent,false];
   _x setVariable ["isAxeAIBus",2,false];
   
  //Nearby Survivors
  _pos_bus = getpos _x;
  _survivors = {isPlayer _x && _x distance _pos_bus < 250} count playableunits > 0;
  
   if (_survivors) then{
    _axeBusDriver = driver _x;
    _axeBusDriver stop true;
    
    _axeBusDriver setBehaviour "STEALTH";
    _axeBusDriver action ["LightOn",_x];
    sleep .2;
    _axeBusDriver action ["LightOff",_x];
    sleep .2;
    _axeBusDriver action ["LightOn",_x];
    sleep .2;
    _axeBusDriver action ["LightOff",_x];

    _axeBusDriver setBehaviour "CARELESS";
    _axeBusDriver stop false;
   };
  };
 }forEach _nrBuses;
_nrBuses=[];
};

to make it work for any player skin.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...