dayZ (arma) AI Controlled Bus Route.

Rule #1: never accept any code someone gives you as correct, always double check it.
I wrote the while condition wrong, it should be:
while {true} do {

So replace the () with {} and at least this part of the code should be correct. is this script being called from your init.sqf so its running on each client all the time?

And lets not forget about whats banned and whats not banned. If you are running Epoch, then you are okay because nothing is banned. If running Dayz or Overwatch then make sure you are using an unbanned marker type. Thats the kind of thing that never made sense to me, why ban marker types or available skins? Military vehicles/gear I can understand, but Markers? WTF!

AND ... whenever you assign a variable to something like
_markerpos= createmarker["MTVR", getpos theBus];
An object is being created and the variable _markerpos will BE that object. So now _markerpos is going to contain all the information for your marker object including the position and the "MTVR" name you gave it. So you add/change any information about that object you have to refer to its variable _markerpos

So change your
"MTVR" setMarkerType "mil_dot";
"MTVR" setMarkerColor "ColorRed";
to
_markerpos setMarkerType "mil_dot";
_markerpos setMarkerColor "ColorRed";

Again, don't take what i say (or anyone else for that matter, but especially mine as I make a lot of mistakes) as gospel, always check the syntax if it doesn't work correctly.
 
Last edited:
Sure, but unfortunately I haven't that much time due to work and other server stuff to learn more about scripting.
Even when I would learn a bit about this stuff I would never be able to write a script on my own.
Also, all that code and brackets are really confusing and annoying sometimes, happened so often that I forgot a damn bracket and I had to restart the server again, apologizing to the peeps online...

But however, I would really appreciate some help again to set up the marker for it.
I know some commands and I also checked Bohemia sites for them, but I didn't figure out how to use them in the correct way.

I tried this and failed, nothing popped up:
Code:
if (isserver) exitwith{};
while (true) do {
_markerpos = createmarker["MTVR",getpos theBus];
"MTVR" setMarkerType "mil_dot";
"MTVR" setMarkerColor "ColorRed";
sleep 1;
};
I even don't know if it's the right file to assign the marker...
The theBus = _axbus; I put in the way you told me.
Ok since i like the idea I'll get it working and post how i did so you see
 
Sure, I'm always critical with scripts.
The problem is that I don't understand all of the code, so I wouldn't had recognized that the while {true} do { part had wrong brackets. I tried it now with the changes you posted, also changed the calls for the marker to _markerpos, but unfortunately it still doesn't work.

The bus script is called from the init.sqf in the parts
if (isServer) then { the
and
if (!isDedicated) then {

Code:
if (isServer) then {
...
[true] execVM "custom\busroute\init_bus.sqf";
...
if (!isDedicated) then {
[] execVM "custom\busroute\player_axeBus.sqf";
The player_axeBus.sqf should stop the bus for survivors, but that doesn't work either, like others posted before here. Overall that's a thing I can live with...
 
mine always stopped for players when you stood next to the road. and it stopped at every busstopfor 5 seconds.

what errors are in your rpt logs? you have your servers arma2oaserver.rpt log and your client has its own log arma2oa.rpt
since we are executing these scripts on the client the errors will be in the client log.
https://community.bistudio.com/wiki/Crash_Files

i understand your problem reading the scripts, it takes a while. what you need to do is forget about learning the commands and take a few days to try and understand a few things completely. [variable types, how values are passed, and arrays. ] these scripts are big on arryays and methids of handling arrays .. you will be a scripter. without thise 3 things, a script will look like so much gibberish.
i will see if i can get some information on a video together.
 
RPT log spits out this error:
Code:
13:51:47 Error in expression < createVehicle _axeBuspawnpos;
theBus = _axbus;
_axeBus setDir _dir;
_axeBus set>
13:51:47  Error position: <_axbus;
_axeBus setDir _dir;
_axeBus set>
13:51:47  Error Undefined variable in expression: _axbus
13:51:47 File mpmissions\DayZ_Epoch_11.Chernarus\custom\busroute\init_bus.sqf, line 44
Line 44 is of course the added definition: theBus = _axbus;
 
when you have an error it lists the code near it so you can see what is going on sometines without having to go look at the file. the actual error in this case is ...
undefined variable in expression: _axbus
so the problem is where _axbus is defined

you have an error in creating the bus itself or you are not assigning_axbus to that object. looking at the top of your error i think youvare using the wrong syntax for createvehicle, at least i have never used that method. i would use
_axbus = createVehicle ["ikarus", _axbusspawnpos, [], 0, "None"];
 
set the driver as setcaptive which prevents enemy attacking. it wont do anything if there are players in it probably

also, ai should not be attacking civilians so if you put a civ driver he wuld be safe too
 
Last edited:
Uh, yes that makes sense...changed the line now to theBus = _axeBus;
But marker still isn't displayed :confused:

what is the client side rpt saying now?

either post your relevent files for review or i can try to make a working script and post it. falling sheep sid he was going to, but work and the repack and the end project may have used up all his free time
 
set the driver as setcaptive which prevents enemy attacking. it wont do anything if there are players in it probably

also, ai should not be attacking civilians so if you put a civ driver he wuld be safe too

Not quite sure what you mean about the setcaptive part. When you say civilian, do you mean a skin that is not worn by players? I'm running Epoch, so a number of "civilian" skins are available to be worn so I'm not sure which ones you are referring to.
 
yes a skin that is on side civilian
https://community.bistudio.com/wiki/ArmA_2:_Infantry#Chernarussia.2FRussia
but upon more contemplation when you createunit make sure its using side civilian in the createcenter and creategroup code. it probably doesnt matter what skin you use if you set it to side civilian.

_busdriver setcapive true
https://community.bistudio.com/wiki/setCaptive

setcaptive is probably the best method since the entire purpose of the command is to prevent enemies from attacking a unit
 
Last edited:
what is the client side rpt saying now?

either post your relevent files for review or i can try to make a working script and post it. falling sheep sid he was going to, but work and the repack and the end project may have used up all his free time
Sorry, forgot to say that RPT shows nothing relevant about it.
Would be nice if that guy could handle and post it here.
 
I'm assuming you stuck this somwhere that it will actually run on the client since you are exiting out of it on the serverside. Since your bus variable is on the serverside though....

Code:
if (isserver) exitwith{};
while (true) do {
deleteMarker["MTVR";
_markerpos = createmarker["MTVR",getpos theBus];
_markerpos setMarkerType "mil_dot";
_markerpos setMarkerColor "ColorRed";
sleep 1;
};

If that doesn't do it for you, you are on your own till you read up on teh tutorials.
 
No luck with this...I think I give up, maybe someone can solve this miracle someday...

But...I tested the setcaptive command ShootingBlanks posted.
Works fine!

Code:
_axeBusUnit enableAI "TARGET";
     _axeBusUnit enableAI "AUTOTARGET";
     _axeBusUnit enableAI "MOVE";
     _axeBusUnit enableAI "ANIM";
     _axeBusUnit enableAI "FSM";
     _axeBusUnit allowDammage true;
     _axeBusUnit setCaptive true;
 
i was going to do this today, but got sidetracked on my website again.

I will do a script tonight at work and post, but it wont be tested.

i get home around midnight and might finish, test and post a final working script or I might have a beer ... you never know.
 
Here is your entire busroute from kamenka to berezino and back (I think, its an old script I had). Rather than create a second file, I just tacked the 3 lines of code that makes your marker onto the end of the busroute, so look at the bottom for the marker code. I tested this in the Mission Editor so I did not need or use the code that stops it from being deleted or exploding when you get into it during testing, I added it back in for this post. So I am not sure if that part is correct or will cause problems, I think not as this script was working last year.
If you are using Epuke or Overpuke or OverPukeCrapolaWhatEverModsYouAddon you need to change dayz_serverObjectMonitor to PVDZE_serverObjectmonitor.
And you might notice i solved the issue of the bus and driver being attacked by the AI .. they are invulnerable :D
This works on a local environment. I have to separate the busroute and the marker part to client side now and it will be working, but this shows it works anyways.


Code:
_this = createCenter civilian;
_center_2 = _this;
_grpBlue = createGroup _center_2;

//driver
  _this = _grpBlue createUnit ["Policeman", [1616.7765, 2233.0764, 1.4383841e-007], [], 0, "CAN_COLLIDE"];
  _unit_2 = _this;
  _this setUnitAbility 0.60000002;
  _grpBlue selectLeader _this;
       _this setVariable ["Sarge",1,true];
    _this allowDammage false;
     _this addEventHandler ["HandleDamage", {false}];

//the bus
  _this = createVehicle ["Ikarus", [1599.1127, 2242.4331, -2.3079338e-008], [], 0, "CAN_COLLIDE"];
  theBus = _this;
  _this setDir -71.269524;
  _this setPos [1599.1127, 2242.4331, -2.3079338e-008];
   _this setVariable ["Sarge",1,true];
    _this allowDammage false;
    _this addEventHandler ["HandleDamage", {false}];
    _this setVariable ["ObjectID", [getDir _this ,getPos _this] call dayz_objectUID2, true];
    dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_this];
    [_this,"Ikarus"] spawn server_updateObject;



_this = _grpBlue addWaypoint [[1594.5338, 2244.3137, 2.1127926e-007], 0];
_this setWaypointType "GETIN NEAREST";
_this setWaypointCombatMode "RED";
_this setWaypointSpeed "FULL";
_this setWaypointBehaviour "CARELESS";
_waypoint_0 = _this;

_this = _grpBlue addWaypoint [[732.96844, 1893.0231, -1.8595892e-007], 0];
_waypoint_1 = _this;

_this = _grpBlue addWaypoint [[678.28821, 1865.5563, 2.2065069e-007], 0];
_this setWaypointBehaviour "COMBAT";
_waypoint_2 = _this;

_this = _grpBlue addWaypoint [[650.99005, 1850.6868, 1.8210267e-007], 0];
_waypoint_3 = _this;

_this = _grpBlue addWaypoint [[690.61407, 1848.1786, 4.1011663e-007], 0];
_waypoint_4 = _this;

_this = _grpBlue addWaypoint [[790.48114, 1920.0989, 1.1124575e-007], 0];
_this setWaypointBehaviour "CARELESS";
_waypoint_5 = _this;

_this = _grpBlue addWaypoint [[1830.3545, 2214.7742, 1.029548e-007], 0];
_this setWaypointBehaviour "CARELESS";
_this setWaypointTimeout [10, 10, 10];
_waypoint_6 = _this;

_this = _grpBlue addWaypoint [[4517.0571, 2445.3359, 2.1862797e-007], 0];
_this setWaypointTimeout [10, 10, 10];
_waypoint_7 = _this;

_this = _grpBlue addWaypoint [[6348.7422, 2429.8325, 7.1187969e-008], 0];
_this setWaypointTimeout [10, 10, 10];
_waypoint_8 = _this;

_this = _grpBlue addWaypoint [[6566.2964, 2864.8196, 5.2154064e-008], 0];
_this setWaypointTimeout [10, 10, 10];
_waypoint_9 = _this;

_this = _grpBlue addWaypoint [[9966.5996, 2052.2791, -5.9138983e-008], 0];
_this setWaypointTimeout [10, 10, 10];
_waypoint_10 = _this;

_this = _grpBlue addWaypoint [[10408.438, 2246.1348, 1.0544318e-007], 0];
_this setWaypointTimeout [10, 10, 10];
_waypoint_11 = _this;

_this = _grpBlue addWaypoint [[10800.207, 2567.8381, 0.057557106], 0];
_waypoint_12 = _this;

_this = _grpBlue addWaypoint [[12009.484, 3479.1714, 7.6106517e-008], 0];
_this setWaypointTimeout [10, 10, 10];
_waypoint_13 = _this;

_this = _grpBlue addWaypoint [[13386.558, 5383.3008, 0], 0];
_this setWaypointTimeout [10, 10, 10];
_waypoint_14 = _this;

_this = _grpBlue addWaypoint [[13461.66, 6236.2959, -1.139706e-007], 0];
_this setWaypointTimeout [10, 10, 10];
_waypoint_15 = _this;

_this = _grpBlue addWaypoint [[13282.458, 6982.1265, 1.7404091e-007], 0];
_this setWaypointTimeout [10, 10, 10];
_waypoint_16 = _this;

_this = _grpBlue addWaypoint [[12989.876, 8336.4756, 0], 0];
_this setWaypointTimeout [10, 10, 10];
_waypoint_17 = _this;

_this = _grpBlue addWaypoint [[13100.437, 10335.808, 0], 0];
_this setWaypointTimeout [10, 10, 10];
_waypoint_18 = _this;

_this = _grpBlue addWaypoint [[13072.771, 10375.53, 0], 0];
_this setWaypointBehaviour "COMBAT";
_waypoint_19 = _this;

_this = _grpBlue addWaypoint [[12998.04, 10327.238, 0], 0];
_this setWaypointBehaviour "CARELESS";
_waypoint_20 = _this;

_this = _grpBlue addWaypoint [[12832.215, 9958.292, 0], 0];
_this setWaypointTimeout [10, 10, 10];
_waypoint_21 = _this;

_this = _grpBlue addWaypoint [[12308.234, 9552.7021, -2.1222513e-007], 0];
_this setWaypointTimeout [10, 10, 10];
_waypoint_22 = _this;

_this = _grpBlue addWaypoint [[12151.067, 9043.1436, -1.3522804e-006], 0];
_this setWaypointTimeout [10, 10, 10];
_waypoint_23 = _this;

_this = _grpBlue addWaypoint [[12823.489, 8593.7803, -2.8405339e-008], 0];
_waypoint_24 = _this;

_this = _grpBlue addWaypoint [[12916.135, 8521.3438, -2.2631139e-007], 0];
_this setWaypointBehaviour "COMBAT";
_waypoint_25 = _this;

_this = _grpBlue addWaypoint [[13277.846, 6979.3608, -1.8641003e-007], 0];
_this setWaypointBehaviour "CARELESS";
_this setWaypointTimeout [10, 10, 10];
_waypoint_26 = _this;

_this = _grpBlue addWaypoint [[13455.297, 6232.3125, 1.2273085e-007], 0];
_this setWaypointTimeout [10, 10, 10];
_waypoint_27 = _this;

_this = _grpBlue addWaypoint [[13383.92, 5478.1475, -7.1246177e-008], 0];
_this setWaypointTimeout [10, 10, 10];
_waypoint_28 = _this;

_this = _grpBlue addWaypoint [[12045.63, 3488.9026, -1.3016688e-007], 0];
_this setWaypointTimeout [10, 10, 10];
_waypoint_29 = _this;

_this = _grpBlue addWaypoint [[10888.996, 2773.6587, 1.6269041e-007], 0];
_this setWaypointTimeout [10, 10, 10];
_waypoint_30 = _this;

_this = _grpBlue addWaypoint [[10332.829, 2159.7454], 0];
_this setWaypointTimeout [10, 10, 10];
_waypoint_31 = _this;

_this = _grpBlue addWaypoint [[6424.7744, 2705.928, 0], 0];
_this setWaypointTimeout [10, 10, 10];
_waypoint_32 = _this;

_this = _grpBlue addWaypoint [[4570.7388, 2434.6482, -3.9755832e-008], 0];
_this setWaypointTimeout [10, 10, 10];
_waypoint_33 = _this;

_this = _grpBlue addWaypoint [[3581.5159, 2454.2285, -1.2641249e-007], 0];
_this setWaypointTimeout [10, 10, 10];
_waypoint_34 = _this;

_this = _grpBlue addWaypoint [[1853.936, 2230.4497, 1.0876101e-007], 0];
_this setWaypointTimeout [10, 10, 10];
_waypoint_35 = _this;

_this = _grpBlue addWaypoint [[1657.6793, 2222.6558, -1.6621925e-007], 0];
_waypoint_36 = _this;

_this = _grpBlue addWaypoint [[1633.3134, 2230.5825, 9.9928002e-008], 0];
_this setWaypointType "CYCLE";
_waypoint_37 = _this;


//-------------------------------------MARKER---------------------------
_markerpos = createmarker["buslocation",getpos theBus];
_markerpos setMarkerType "mil_dot";
_markerpos setMarkerColor "ColorRed";

while {true} do {
    "buslocation" setMarkerPosLocal getPos theBus;
    sleep 3;
    };
 
Last edited:
ok so here it is using axes loop already in the bus code, it also puts the word BUS above the marker (you can add the same to shootinblanks version above )

this uses a server side marker and works on a dedicated setup and a local setup

the final code at the end includeds fixes to stop AI shooting bus as well

i posted it cause choice is always a good thing


(its included in my repack to :p )

just add this
Code:
        //Create marker for bus
        deleteMarker "BUSMarker";
        _BUSMarker = createmarker ["BUSMarker", position _axeBus];
        _BUSMarker setMarkerText "Bus";
        _BUSMarker setMarkerType "DOT";
        _BUSMarker setMarkerColor "ColorRed";
        _BUSMarker setMarkerBrush "Solid";
        _BUSMarker setMarkerSize [1, 1];
        BUSMarker = _BUSMarker;
into this section in init_bus.sqf
Code:
        //Monitor Driver
        if((driver _axeBus != _axeBusDriver)||(driver _axeBus != _axeBusUnit))then{
        //diag_log format ["AXLOG:BUS: Driver Required:%1",driver _axeBus];
        units _axeBusGroup select 0 assignAsDriver _axeBus;
        units _axeBusGroup select 0 moveInDriver _axeBus;
        };
//ADD CODE HERE

    sleep 3;
    };

for ease of explaining hers what the whole file should look like
Code:
    private ["_axeBusUnit","_firstRun","_dir","_axWPZ","_unitpos","_rndLOut","_ailoadout","_aiwep","_aiammo","_axeBus","_axeBusGroup","_axeBuspawnpos","_axeBusWPradius","_axeBusWPIndex","_axeBusFirstWayPoint","_axeBusWP","_axeBusRouteWaypoints","_axeBusDriver","_axeBusLogicGroup","_axeBusLogicCenter"];
    _axeBusUnit = objNull;
    _axeBusGroup = createGroup west;
    _axeBuspawnpos = [13128.2,10381.9,0];
    _unitpos = [13125.2,10416,0];
    _axeBusWPradius = 2;//waypoint radius

    _axeBusDriver = objNull;

    //Set Sides
    _firstRun = _this select 0;
    if(_firstRun)then{
    createCenter RESISTANCE;
    RESISTANCE setFriend [WEST,1];//Like Survivors..
    RESISTANCE setFriend [EAST,0];//Don't like banditos !
    WEST setFriend [RESISTANCE,1];
    EAST setFriend [RESISTANCE,0];
    };

    //Load Bus Route
    _axWPZ=0;
    _axeBusWPIndex = 2;
    _axeBusFirstWayPoint = [13101.4,10339.1,_axWPZ];
    _axeBusWP = _axeBusGroup addWaypoint [_axeBusFirstWayPoint, _axeBusWPradius,_axeBusWPIndex];
    _axeBusWP setWaypointType "MOVE";
    _axeBusRouteWaypoints = [[12984,8362.67,_axWPZ],[13279.1,6991.32,_axWPZ],[13464.2,6255.24,_axWPZ],[13386.8,5405.25,_axWPZ],[12025.6,3481.76,_axWPZ],[10504.4,2324.99,_axWPZ],[10321.8,2149.75,_axWPZ],[10028,2071.8,_axWPZ],[9503.53,2028.21,_axWPZ],[6587.65,2884.59,_axWPZ],[6354.47,2452.24,_axWPZ],[4565.79,2432.13,_axWPZ],[1907.21,2240.25,_axWPZ],[1689.06,2209.53,_axWPZ],[1845.55,2219.14,_axWPZ],[1940.8,2255.24,_axWPZ],[3559.56,2448.9,_axWPZ],[4541.37,2443.16,_axWPZ],[5816.09,2167.39,_axWPZ],[6408.19,2685.99,_axWPZ],[6570.5,2877.59,_axWPZ],[9945.28,2049.85,_axWPZ],[10283.4,2146.71,_axWPZ],[10389.4,2221.85,_axWPZ],[10498.9,2320.29,_axWPZ],[10888.2,2772.58,_axWPZ],[12025.9,3485.04,_axWPZ],[13005.9,3816.02,_axWPZ],[13451.5,6211.28,_axWPZ],[13419.9,6557.19,_axWPZ],[13287.7,6961.19,_axWPZ],[12930.4,10133,_axWPZ]];

    {
    _axeBusWPIndex=_axeBusWPIndex+1;
    _axeBusWP = _axeBusGroup addWaypoint [_x, _axeBusWPradius,_axeBusWPIndex];
    _axeBusWP setWaypointType "MOVE";
    _axeBusWP setWaypointTimeout [20, 30, 35];
    diag_log format ["BUS:Waypoint Added: %2 at %1",_x,_axeBusWP];
    } forEach _axeBusRouteWaypoints;

    //Create Loop Waypoint
    _axeBusWP = _axeBusGroup addWaypoint [_axeBusFirstWayPoint, _axeBusWPradius,_axeBusWPIndex+1];
    _axeBusWP setWaypointType "CYCLE";

    //Create Bus
    _dir = 244;
    _axeBus = "Ikarus_TK_CIV_EP1" createVehicle _axeBuspawnpos;
    _axeBus setDir _dir;
    _axeBus setPos getPos _axeBus;
    _axeBus setVariable ["ObjectID", [_dir,getPos _axeBus] call dayz_objectUID2, true];
    _axeBus setFuel .3;
    _axeBus allowDammage false;
    //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];
    [_axeBus,"Ikarus_TK_CIV_EP1"] spawn server_updateObject;

    //Make Permanent on some builds.. No Need really,
    //dayzSaveVehicle = _axeBus;
    //publicVariable "dayzSaveVehicle";

    _axeBus addEventHandler ["HandleDamage", {false}];
    _axeBus setVariable ["axBusGroup",_axeBusGroup,true];
    _axeBus setVariable ["isAxeAIBus",1,true];
    _axeBus setVariable ["MalSar",1,true];
    _axeBus setVariable ["Sarge",1,true];

    //Create Driver and Drivers Mate
    for [{ x=1 },{ x <3 },{ x = x + 1; }] do {
        _rndLOut=floor(random 3);
        _ailoadout=
        switch (_rndLOut) do
        {
         case 0: {["AK_47_M","30Rnd_762x39_AK47"]};
         case 1: {["M4A1_AIM_SD_camo","30Rnd_556x45_StanagSD"]};
         case 2: {["Remington870_lamp","8Rnd_B_Beneli_74Slug"]};
        };
  
        "BAF_Soldier_L_DDPM" createUnit [_unitpos, _axeBusGroup, "_axeBusUnit=this;",0.6,"Private"];
  
        _axeBusUnit enableAI "TARGET";
        _axeBusUnit enableAI "AUTOTARGET";
        _axeBusUnit enableAI "MOVE";
        _axeBusUnit enableAI "ANIM";
        _axeBusUnit enableAI "FSM";
        //stop AI attacking bus
        _axeBusUnit setCaptive true;
        _axeBusUnit allowDammage true;

        _axeBusUnit setCombatMode "GREEN";
        _axeBusUnit setBehaviour "CARELESS";
        //clear default weapons / ammo
        removeAllWeapons _axeBusUnit;
        //add random selection
        _aiwep = _ailoadout select 0;
        _aiammo = _ailoadout select 1;
        _axeBusUnit addweapon _aiwep;
        _axeBusUnit addMagazine _aiammo;
        _axeBusUnit addMagazine _aiammo;
        _axeBusUnit addMagazine _aiammo;

        //set skills
        _axeBusUnit setSkill ["aimingAccuracy",1];
        _axeBusUnit setSkill ["aimingShake",1];
        _axeBusUnit setSkill ["aimingSpeed",1];
        _axeBusUnit setSkill ["endurance",1];
        _axeBusUnit setSkill ["spotDistance",0.6];
        _axeBusUnit setSkill ["spotTime",1];
        _axeBusUnit setSkill ["courage",1];
        _axeBusUnit setSkill ["reloadSpeed",1];
        _axeBusUnit setSkill ["commanding",1];
        _axeBusUnit setSkill ["general",1];
  
        if(x==1)then{
        _axeBusUnit assignAsCargo _axeBus;
        _axeBusUnit moveInCargo _axeBus;
        _axeBusUnit addEventHandler ["HandleDamage", {false}];
        }
        else{
        _axeBusGroup selectLeader _axeBusUnit;
        _axeBusDriver = _axeBusUnit;
        _axeBusDriver addEventHandler ["HandleDamage", {false}];
        _axeBus addEventHandler ["killed", {[false] execVM "scripts\busroute\init_bus.sqf"}];//Shouldn't be required
  
        //Test - Allow dev time to get in bus
        sleep 36;
  
        _axeBusUnit assignAsDriver _axeBus;
        _axeBusUnit moveInDriver _axeBus;
        };
    };

    waitUntil{!isNull _axeBus};
    //diag_log format ["AXLOG:BUS: Bus Spawned:%1 | Group:%2",_axeBus,_axeBusGroup];

    //Monitor Bus
    while {alive _axeBus} do {
    //diag_log format ["AXLOG:BUS: Tick:%1",time];
        //Fuel Bus
        if(fuel _axeBus < 0.2)then{
        _axeBus setFuel 0.3;
        //diag_log format ["AXLOG:BUS: Fuelling Bus:%1 | Group:%2",_axeBus,_axeBusGroup];
        };
  
        //Keep Bus Alive - Shouldn't be required.
        if(damage _axeBus>0.4)then{
        _axeBus setDamage 0;
        //diag_log format ["AXLOG:BUS: Repairing Bus:%1 | Group:%2",_axeBus,_axeBusGroup];
        };
  
        //Monitor Driver
        if((driver _axeBus != _axeBusDriver)||(driver _axeBus != _axeBusUnit))then{
        //diag_log format ["AXLOG:BUS: Driver Required:%1",driver _axeBus];
        units _axeBusGroup select 0 assignAsDriver _axeBus;
        units _axeBusGroup select 0 moveInDriver _axeBus;
        };
        //Create marker for bus
        deleteMarker "BUSMarker";
        _BUSMarker = createmarker ["BUSMarker", position _axeBus];
        _BUSMarker setMarkerText "Bus";
        _BUSMarker setMarkerType "DOT";
        _BUSMarker setMarkerColor "ColorRed";
        _BUSMarker setMarkerBrush "Solid";
        _BUSMarker setMarkerSize [1, 1];
        BUSMarker = _BUSMarker;

    sleep 3;
    };
 
Last edited:
Back
Top