Dayz - Bus with driver

littlerock

New Member
Hi

I have a problem with creating a bus with a busdriver. I want that the busdriver drive the bus to serveral waypoints in a loop. If I take a bus spawned by the Editor. The bus explodes, so i decided to spawn a bus though the Database. The busdriver enters the bus and drive it. So far no problem.
Several action with the depends on the textfield, defined in the editor. Am I able to define that field afterwards to the bus where the driver is in? For example can i define the bus initline after i spawned the bus by DB? Also i am not able to define the busdriver as the driver. So every player in the bus can change to driver seat.

Busdefinition from the sqm.
Code:
class Vehicles
    {
        items=1;
        class Item0
        {
            position[]={13110.666,4.667295,3877.0073};
            azimut=40;
            id=2;
            side="EMPTY";
            vehicle="Ikarus";
            leader=1;
            skill=0.60000002;
            text="bus";
            init="this addEventHandler[""handledamage"", {false}];";
        };
    };

Busdriver defintion from mission.sqm

Code:
class Vehicles
            {
                items=1;
                class Item0
                {
                    position[]={13120.206,4.9263587,3859.9148};
                    id=0;
                    side="WEST";
                    vehicle="USMC_LHD_Crew_Purple";
                    leader=1;
                    rank="MAJOR";
                    skill=0.60000002;
                    text="busfahrer";
                    init="this addEventHandler[""handledamage"", {false}]; busfahrer assignAsDriver bus;  busfahrer orderGetIn true; this allowfleeing 0; this setBehaviour ""Careless"";";
                };
            };
 
I've tried this myself and even if you do succeed in getting the AI bus driver , you've got all the Battle Eye restrictions to clean up, there are also a tonne of AI actions stripped out of the dayz code, which you'd have to work around. On my old map I had AI sentry guards, but for that I had to practically turn off BE.. Sorry this wasn't helpful in anyway, but I would hate to see you waste your time on something that probably wont work. :(
 
He dont have to do much and at the moment he drives the bus perfectly. The problem is, that the bus is spawned by db, so I have to reset the bus with a php-script on each restart. The problem for example is, that the bus isnt indestructable and the player can switch to driver seat. If i could get the two things working, it would be enough, for the simple bus driving and stupid users trying to destruct all things :).
 
Well, if you do that get that working and you're ok with it, I'd love to have the script . Full credit will be given of course and I'll even buy you a beer next time you're in London :)
 
Ok if we want him to drive we need to deaktivate the "addaction to driver's seat" or we can define the "busfahrer" as driver of the bus.

Code:
busfahrer assignAsDriver bus;

If I change "bus" with "this", the player still can change the seat.

I'll try to make the bus indestructable with:

Code:
this setvehicleinit "this addEventHandler[""handledamage"", {false}];"

Anyone knows if we can define the "text" field in the sqm, after starting the mission? It would be more easy if we could name the Bus.
 
Yeah, when the bus script is finished I'd love to see your scripts.txt file. You know way more about this stuff than I do, hope you nail this project dood :D
 
This is code that is blowing up the bus when you enter the bus via the mission.sqm / editor:

/dayz_server/system/server_cleanup.fsm

"//Check for hackers" \n
" {" \n
" if(vehicle _x != _x && !(vehicle _x in _safety) && (typeOf vehicle _x) != ""ParachuteWest"") then {" \n
" diag_log (""CLEANUP: KILLING A HACKER "" + (name _x) + "" "" + str(_x) + "" IN "" + (typeOf vehicle _x));" \n
" (vehicle _x) setDamage 1;" \n
" _x setDamage 1;" \n
" };" \n
" } forEach allUnits;" \n

If you remove that you can spawn vehicles with the mission file.

Note I am not entirely sure of the consequences of doing this. I don't believe there are any at all, as it won't stop hackers injecting createvehicles using battleye bypassers etc. So to my knowledge the only thing that code does is stop admins adding vehicles within the mission file outside of the dayzmod.com hive (where as you have a private server).
 
For multiply reasons i dont want to turn off the hackerprotection. I first want to figure out, if we can use the script with an Bus correctly spawned by DB.

At the moment I spawned an Ikarus right in front of my driver. He gets in and drive the bus.

So far no problems. But I try to assign the bus a name for future scripts. For example assign the driver to prevent switching to driver's seat.

Maybe I can define the class as indestrucable. In Chernarus I can select the Ikarus or Ikarus_TK_CIV_EP1, the players dont care if the bus is blue or red. So if I or You can figure out how to define the class "Ikarus" indestructable or assign the "busfahrer" as driver, that would be helpful.
 
This is code that is blowing up the bus when you enter the bus via the mission.sqm / editor:

/dayz_server/system/server_cleanup.fsm



If you remove that you can spawn vehicles with the mission file.

Note I am not entirely sure of the consequences of doing this. I don't believe there are any at all, as it won't stop hackers injecting createvehicles using battleye bypassers etc. So to my knowledge the only thing that code does is stop admins adding vehicles within the mission file outside of the dayzmod.com hive (where as you have a private server).

Thanks for this. I am going to be trying this after work tonight. I personally do not care if it is disabled because as you have said, hackers are going to spawn shit anyways no matter what. The bypassers they are using just slap BE in the face anyways. If this does work, this opens a whole lot of doors for things I want to incorporate.
 
Back
Top