dayZ (arma) AI Controlled Bus Route.

It's spawning but not picking up the group from the bus. the bus should hold a variable for the group.

thx for fast reply,
iam not very firm in arma2 scripting and i use your files.

in Bus_Driver.sqf you have:
axBusGroup = createGroup resistance;

in manBus.sqf you have:
axBusGroup = axBus getVariable "axBusGroup";

and in monitorBus you have:
_busGroup = axBus getVariable "axBusGroup";

is manbus correct or does it need _busGroup = axBus getVariable "axBusGroup"; instead of axBusGroup = axBus getVariable "axBusGroup";


btw. removed the NVgoggles because it was a to interesting loot. But know they cant see anything in halfdarkness :(

I need to find a way to make nvgoggles unlootable.

good night vor today :)
 
Will double check the manbus. Will add something to clear inventory if killed. found the ai to be useless in the dark..
 
Just added the newest version to my server. If the driver is killed, the mate abandons the bus. I killed the mate and was systematically assassinated by the response force.

Also, I use Sarge's AI and the bandits took out the AI driver, causing the AI's mate to abandon the bus and the bus was left to idle in the road.
 
Just added the newest version to my server. If the driver is killed, the mate abandons the bus. I killed the mate and was systematically assassinated by the response force.

Also, I use Sarge's AI and the bandits took out the AI driver, causing the AI's mate to abandon the bus and the bus was left to idle in the road.
------------------

Same probleme for me whith SARGE AI
 
Just found the AI bus stuck on a hedgehog that someone deployed on the road. Maybe add something that detects if the bus hasn't moved in X number of seconds, it resets it?
 
To be sure this was working correctly this morning, I deleted my rpt file so a new one would be generated, started my server and played about 10 minutes before I had to log off. Checking the rpt file I find entries that indicate there's a problem getting a driver back after the first one was killed. Maybe I'm reading it wrong, but I'm not sure. Also, not sure how the driver was killed unless Sarge's AI bandits killed him?

http://pastebin.com/Fu84cYfx
 
That doesn't look right the log entry is from the event handler that is triggered from the bus engine starting. Something is stuck in a loop.
 
That doesn't look right the log entry is from the event handler that is triggered from the bus engine starting. Something is stuck in a loop.

Well, I just tried it again and the bus worked correctly this time. The driver was even killed by a bandit AI chopper and apparently either the mate took his place or another driver spawned. I was off the bus healing when it started again so I'm not sure which.
 
If the mate isnt killed It Works for me too sometimes.

today it worked once after an hor of logwriting. BUT: we found a living AI near kamenka (bus was in elektro) after we killed him the bus goes back to the road. But could be coincidence
 
Problem kick.
Scripts Restriction #109
Scripts.log
Code:
"BAF_Soldier_L_DDPM" createUnit [_unitpos, axBusGroup, "busUnit=this;",0.6,"Private"];
 
 
 
"
14.05.2013 13:47:45: Polkos (91.189.166.15:2304) a86185967bbcea84158860dd8154c61d - #109 "ailoadout select 0;
_aiammo = _ailoadout select 1;
busUnit addweapon _aiwep;
busUnit addMagazine _aiammo;
busUnit addMagazine _a"
 
Great Job Axeman,
I gave up after no success back in march, lol. So firstly I was wondering which faction these AI are set to?
Also I am looking at porting this script onto Ovaron an was wondering if you think it is possible or not?
Otherwise I may have to come up with another idea? lol

EDIT: Got it spawning and all other scripts seem to work, but just gotta sort out why waypoints are not working.
 
Is there a way to make it so the bus doesn't stop for bus stops, but does stop for survivors in the road?

Also, any chance a server announcement could be sent out when the bus hit certain check points? ie: The AI bus just arrived in Cherno, heading east", etc?
 
EDIT:

Ok after plenty of messing around I finally got the bus working, now I just need to figure out if I can get the bus to stop just before the township, (to help prevent Zombies surrounding bus it goes nowhere) or if I have to place bus stops in with the editor to do it.

So, There is now a small, ( will edit as I go) bus route active on Ovaron.
 
i have a problem: when the driver was killed than the bus isnt working anymore. a new driving crew is not spawning and the bus is still standing.
When the second guy gets killed than the new driving crew is spawning. the driver gets into the bus but he wont go on driving along the coast. he is still standing and after a while the driver disappears and nothing happen anymore.
 
As we had this problems:

1. no driver spawn after kill.
2. to much driverkills for loot.
3. too long waittime for the bus

So we tried to fix that.
As we dont get the driverrespawn working, Wofu (our Head of Scripting ;)) changed the script to solve the problems.

Now we have:

1. bulletproof driver.
2. bulletproof bus.
3. more than one bus.
4. No killercommando anymore.
5. Waypoints for right and left streetside.

work in progress:
-Horn and chatmessages.
-dont stop for zombies (not sure if its ever possible)

Its not ready yet as we need to clean it up. But if you want to take a look: Come to our server and get it :)
One bus starts in kamenka, one in berezino.
 
Nice. Am glad someone had picked this up. I have the horn beeping at nearby survivors triggered from a gameLogic, is currently created client side, haven't tested it serverside though i did previously get some beeping from the server but it was a bug and went off only with no driver in the bus ?

Can send you over what I have so far for the working beeping..

Have also started on trying to get the bus to stop for survivors with no luck as yet, the Ai stubbornly carry on to the next waypoint.

Is the driver immune to head shots ? I don't think avoiding zombies is possible but deleting them may be..
 
As we had this problems:

1. no driver spawn after kill.
2. to much driverkills for loot.
3. too long waittime for the bus

So we tried to fix that.
As we dont get the driverrespawn working, Wofu (our Head of Scripting ;)) changed the script to solve the problems.

Now we have:

1. bulletproof driver.
2. bulletproof bus.
3. more than one bus.
4. No killercommando anymore.
5. Waypoints for right and left streetside.

work in progress:
-Horn and chatmessages.
-dont stop for zombies (not sure if its ever possible)

Its not ready yet as we need to clean it up. But if you want to take a look: Come to our server and get it :)
One bus starts in kamenka, one in berezino.

That sounds good. Is it possible to get this script from you?
 
Nice. Am glad someone had picked this up. I have the horn beeping at nearby survivors triggered from a gameLogic, is currently created client side, haven't tested it serverside though i did previously get some beeping from the server but it was a bug and went off only with no driver in the bus ?

Can send you over what I have so far for the working beeping..

Have also started on trying to get the bus to stop for survivors with no luck as yet, the Ai stubbornly carry on to the next waypoint.

Is the driver immune to head shots ? I don't think avoiding zombies is possible but deleting them may be..

Iam glad you started It :)

Yes, the driver is immune to headshots. The Bus Stops for Zombies, Players and chickens. But that does your Script already. We just copied the Part.
Would like to get the horncode :)

@silver yes, you can have It. Just connect to our Server an Download the Mission.pbo to get It NOW. I will Post It with comments as soon we are ready.

@stealth the Bus Stops at the waypoints. Just change the waypoints. They are Not needet for streetfinding.

There are 2 options you can configure. Buscount and how much Time the Bus should wait at busstops.

And: uppercase is comming from iPad. Sry for that ;)
 
Beeping horn, this is a mixture of the horn beeping, testing lights flashing and trying to get the bus to stop for a survivor.

This bit of code is under testing and am not sure how it will work on a busy live server as it currently creates a gameLogic for each survivor just to beep the horn. Would like to try creating a gameLogic with the server and try and use that, or detect an existing gameLogic.

init.sqf
Code:
if (!isDedicated) then {
//Client Bus
    ["","","",[false,objNull]] execVM "busroute\init_bus.sqf";
};

init_bus.sqf
Code:
private ["_center","_group","_pos","_gameLogic","_player","_objBus","_isBus","_nrPlayer","_range","_busVar","_beepHorn","_axBusDriver","_beepCount","_busObj"];
 
_array = _this select 3;
_player = _array select 1;
_range = 25;
_beepCount = 0;
_center = createCenter sideLogic;
_group = createGroup _center;
_pos = [0, 0, 0];
_gameLogic = _group createUnit ["LOGIC",_pos , [], 0, ""];
//_beepHorn = compile loadFile "busroute\beep_horn.sqf";
while {true}
do
{
    if (!isNull player) then
    {
        _nrPlayer = vehicle player;
        _objBus = nearestObjects [_nrPlayer, ["Ikarus_TK_CIV_EP1"], _range];
       
        if(count _objBus >0)then{
       
            {
                if(str(_x getVariable ["axBusGroup","NONE"]) != "NONE")then{
                hint format ["Bus Found: Vel:%1",velocity _x];
                sleep .5;
                _isBus=true;
                //[_nrPlayer,_objBus] call _beepHorn;
                _axBusDriver = driver _x;
               
                //Beep Horn
                    if(_nrPlayer distance _x >10 && _beepCount < 3)then{
                    _gameLogic action ["useWeapon",_x,_axBusDriver,0];
                    _gameLogic action ["useWeapon",_x,_axBusDriver,1];
                    _gameLogic action ["useWeapon",_x,_axBusDriver,2];
                    _beepCount=_beepCount+1;
                    hint format["Beeping Horn:Count:%1",_beepCount];
                    sleep .5;
                   
                //Try to Flash Lights (Not yet tested at night). Needs time detection or just night time flashing ?
                    _axBusDriver action ["LightOn",_x];
                    sleep .3;
                    _axBusDriver action ["LightOff",_x];
                    _busObj = _x;
                    };
                };
       
            }forEach _objBus;
        }else{
        _beepCount=0;
        _player=objNull;
        _isBus = false;
        player removeAction axeHailBus;
        };
       
       
       
        if (_player != player && _isBus) then
        {
            _player = player;
            axeHailBus = player addAction ["<t color=""#ffff33"">" + ("Hail Bus") + "</t>", "busroute\hail_bus.sqf",[_busObj,_gameLogic],-19,false];
        };
           
    };
       
};

And hail_bus.sqf
Code:
private["_array","_bus","_done","_finTime","_waitTime","_axBusDriver","_gameLogic","_speed_x","_speed_y","_nspeed_x","_nspeed_y"];
_array=_this select 3;
_bus = _array select 0;
_gameLogic = _array select 1;
_done=false;
_waitTime = 25;
_finTime = time + _waitTime;
_axBusDriver = driver _bus;
_gameLogic action ["useWeapon",_bus,_axBusDriver,0];
player removeAction axeHailBus;
_nspeed_x = 0;
_nspeed_y = 0;
axBus lockDriver false;
_axBusDriver assignAsCargo axBus;
_axBusDriver moveInCargo axBus;
axBus lockDriver true;
//_axBusDriver disableAI "MOVE";
//_axBusDriver stop true;
while {!_done}
do
{
_speed_x = (velocity _bus) select 0;
_speed_y = (velocity _bus) select 1;
if (_speed_x > 0) then {_nspeed_x = _speed_x / 1.01;};
if (_speed_y > 0) then {_nspeed_y = _speed_y / 1.01;};
_bus setVelocity [_nspeed_x,_nspeed_y,0];//Not yet tried setting velocity to driver
sleep .1;
    if(time>_finTime)then{
    _done=true;
    };
   
};
axBus lockDriver false;
_axBusDriver assignAsDriver axBus;
_axBusDriver moveInDriver axBus;
axBus lockDriver true;
_gameLogic action ["useWeapon",_bus,_axBusDriver,0];
sleep .1;
//_axBusDriver enableAI "MOVE";
//_axBusDriver stop false;

Here is a set of test wayPoints (for Chernarus)
Code:
axBusRouteWaypoints = [[12981.6,10062.9,_axWPZ],[12963.9,10209.5,_axWPZ]];//Test Waypoints
The bus will loop the block at the start point..
 
Nice work ,will also try this,since th last update makes ai spawn with bus but no driver inside .thats since im using sarge ai, i think
Yesterday we had about 16 buses spawning ^^

send from my Galaxy S2 using tapatalk
 
Back
Top