dayZ (arma) AI Controlled Bus Route.

I have this error in my rpt when i approach the bus :

1:54:43 "AIBUSDRIVER: Beeping Horn at B 1-1-C:1 (Alcapon) REMOTE"
1:54:43 Error in expression <_x distance axBus >10)then{
axBusDriver action ["useWeapon",axBus,axBusDriver,0]>
1:54:43 Error position: <action ["useWeapon",axBus,axBusDriver,0]>
1:54:43 Error 4 elements provided, 2 expected
1:54:43 File mpmissions\dayz_1.chernarus\busroute\monitorBus.sqf, line 26


and when i kill the driver , i got this :

1:55:38 WARNING: Function 'name' - 1f746040# 1058819: baf_soldier_light_baf.p3d has no unit
1:55:38 - network id 2:3834
1:55:38 - person Jacob Campbell
1:55:38 - dead
 
Great mod Axeman! got this working in no time! Thanks alot for sharing this! =)

Im curius though. Along with this mod i also have Sarge AI Framework on, and im wondering if his AI bandits would shoot at the bus ?
 
I have this error in my rpt when i approach the bus :

1:54:43 "AIBUSDRIVER: Beeping Horn at B 1-1-C:1 (Alcapon) REMOTE"
1:54:43 Error in expression <_x distance axBus >10)then{
axBusDriver action ["useWeapon",axBus,axBusDriver,0]>
1:54:43 Error position: <action ["useWeapon",axBus,axBusDriver,0]>
1:54:43 Error 4 elements provided, 2 expected
1:54:43 File mpmissions\dayz_1.chernarus\busroute\monitorBus.sqf, line 26


and when i kill the driver , i got this :

1:55:38 WARNING: Function 'name' - 1f746040# 1058819: baf_soldier_light_baf.p3d has no unit
1:55:38 - network id 2:3834
1:55:38 - person Jacob Campbell
1:55:38 - dead

For the first error I would comment out lines #23-#33
Code:
    if ((count _survivors) > 0)then{
        {
            if(_x distance axBus >10)then{
            axBusDriver action ["useWeapon",axBus,axBusDriver,0];
            axBusDriver action ["useWeapon",axBus,axBusDriver,1];
            axBusDriver action ["useWeapon",axBus,axBusDriver,2];
            diag_log format ["AIBUSDRIVER: Beeping Horn at %1",_x];
            sleep 2;
            };
        }forEach _survivors;
    };
Is currently not doing much, I need to move the horn beeping clientside so the player can hear it. Have not got this error myself, is this after you have killed the driver ?

The second error I am also seeing on my test server, this is the drivers mate running off after the driver is shot. If you follow him he carries on running the bus route.

I did have him setup to take over if the bus driver is killed, will see if I can find that bit of code. It got all mixed up when I started to code the retaliation units to take over the bus after clearing the area, managing all the groups was a nightmare..

A simple solution would be to kill him if the driver is killed, in crewKilled.sqf.
 
Great mod Axeman! got this working in no time! Thanks alot for sharing this! =)

Im curius though. Along with this mod i also have Sarge AI Framework on, and im wondering if his AI bandits would shoot at the bus ?
Thanks, I haven't tested it with Sarge's AI mod, I would look at which sides they are on, I suspect they will be the same side so 'probably' shouldn't attack each other..
 
my bandits are side EAST, so as long as axe's AI is west, you should see them attacking. It will get interesting though when survivor players that shot at friendly AI will try to board the bus ... i assume it will not be possible without enabling my vehicle fix, someone will need to test that special scenario out.

Axe, questions out of curiosity : you mixed your local and global variables quite heavily, is that really intended ?

Trying to declare global variables in private arrays doesn't make much sense ...

(e.g.) private["_abc","_def","xyz","ghj"];

cheers, Sarge
 
my bandits are side EAST, so as long as axe's AI is west, you should see them attacking. It will get interesting though when survivor players that shot at friendly AI will try to board the bus ... i assume it will not be possible without enabling my vehicle fix, someone will need to test that special scenario out.

Axe, questions out of curiosity : you mixed your local and global variables quite heavily, is that really intended ?

Trying to declare global variables in private arrays doesn't make much sense ...

(e.g.) private["_abc","_def","xyz","ghj"];

cheers, Sarge
Not intentional, there was a method to my madness at the time and just haven't tidied up yet. Have released this as a work in progress under request from the other bus thread. It works but does require more work / tweaking.
 
there still a file call "monitorRetaliation.sqf" left, do i need to use it? just wonder ;)
Can ignore that, is an experimental eventhandler to try and disband the unit after killing the bus driver's murderer.. I did have it working at some point, can't remember why i took it back out.. I think is also part of the means to repopulate the bus after driver and mate get killed..
 
  • Like
Reactions: Fox
Bus pausing at bus stops:

Add this after line #24
Code:
axBusWP setWaypointTimeout [10, 15, 20];//thanks orcthrasher :)

in bus_driver.sqf (that line got lost in a backup somewhere). Is explained here: setWaypointTimeout
 
Have just noticed another file that is designed to repopulate the bus and is called from monitorBus.sqf at line #63.

Add manBus.sqf to your units directory:
Code:
    private["_unitpos","_driverKilled","_xpos","_ypos","_buspos"];
    busUnit = objNull;
    axBus = _this select 0;
    axBusGroup = axBus getVariable "axBusGroup";
    _buspos = getPos axBus;
    _xpos = (_buspos select 0)-50;
    _ypos = (_buspos select 1)+50;
    _unitpos = [_xpos,_ypos,0];
 
    axDriversMate = objNull;
    axDriver = objNull;
 
    //Create Driver and Drivers Mate
    for [{ x=1 },{ x <3 },{ x = x + 1; }] do {
   
        "BAF_Soldier_L_DDPM" createUnit [_unitpos, axBusGroup, "busUnit=this;",0.6,"Private"];
 
        diag_log format ["BUSCREW: Creating Replacement BAF_Soldier_L_DDPM by %1 at %2. Result:%3 | Loadout:%4 / Num:%5",player,_unitpos,busUnit,_ailoadout,_rndLOut];
   
        busUnit enableAI "TARGET";
        busUnit enableAI "AUTOTARGET";
        busUnit enableAI "MOVE";
        busUnit enableAI "ANIM";
        busUnit enableAI "FSM";
        busUnit allowDammage true;
 
        busUnit setCombatMode "GREEN";
        busUnit setBehaviour "CARELESS";
        //clear default weapons / ammo
        removeAllWeapons busUnit;
        //add random selection
 
        //set skills
        busUnit setSkill ["aimingAccuracy",1];
        busUnit setSkill ["aimingShake",1];
        busUnit setSkill ["aimingSpeed",1];
        busUnit setSkill ["endurance",1];
        busUnit setSkill ["spotDistance",0.6];
        busUnit setSkill ["spotTime",1];
        busUnit setSkill ["courage",1];
        busUnit setSkill ["reloadSpeed",1];
        busUnit setSkill ["commanding",1];
        busUnit setSkill ["general",1];
   
        if(x==1)then{
        busUnit assignAsCargo axBus;
        busUnit moveInCargo axBus;
        _mateKilled = busUnit addEventHandler ["killed", {_this+[axBus] execVM "busroute\crewKilled.sqf"}];
        }
        else{
        axBusGroup selectLeader busUnit;
        axDriver = busUnit;
        _driverKilled = busUnit addEventHandler ["killed", {_this+[axBus] execVM "busroute\crewKilled.sqf"}];
        busUnit assignAsDriver axBus;
        busUnit moveInDriver axBus;
        };
    };

All it does is create new driver and mate if no units are found within the existing bus group.

Am testing the error where drivers mate runs away..
 
@axeman ,

How can i get the soldier defende the bus , because any players can kill the driver and take the bus easy, when i kill the driver i get this error in rpt :

1:55:38 WARNING: Function 'name' - 1f746040# 1058819: baf_soldier_light_baf.p3d has no unit
1:55:38 - network id 2:3834
1:55:38 - person Jacob Campbell
1:55:38 - dead

and nothing happens
 
Are the additions that you listed included in the original post (manbus.sqf and bus stopping)?

Also, what's to stop someone from taking over the bus and driving it to NWAF? If the player then jumps out, will the driver then make his way back to the coast road? I've seen the AI trying to drive vehicles in Sarge's AI script and they are lousy at it.
 
@axeman ,

How can i get the soldier defende the bus , because any players can kill the driver and take the bus easy, when i kill the driver i get this error in rpt :

1:55:38 WARNING: Function 'name' - 1f746040# 1058819: baf_soldier_light_baf.p3d has no unit
1:55:38 - network id 2:3834
1:55:38 - person Jacob Campbell
1:55:38 - dead

and nothing happens
When the driver, or mate, is killed there should be some retaliation, where 4 crack soldiers come and clear the area. Targetting the killer is difficult so they are set to seek and destroy, is quite effective and gives the bus attackers a small chance at escaping.
 
Are the additions that you listed included in the original post (manbus.sqf and bus stopping)?

Also, what's to stop someone from taking over the bus and driving it to NWAF? If the player then jumps out, will the driver then make his way back to the coast road? I've seen the AI trying to drive vehicles in Sarge's AI script and they are lousy at it.
Not yet they aren't.. Am looking at the error after the bus driver is killed, I wasn't getting this before, the drivers mate should take over the role of driver..
 
Testing on 1.7.6.1 with no errors. Really cool add on axeman. Thanks for sharing. Also using the train script, also very cool.
 
Back
Top