Your AI driver is on a different side to you. Enemy vehicles don't allow you access..Hi im having trouble entering the bus? when i scroll it just says save and no other options. any ideas?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Your AI driver is on a different side to you. Enemy vehicles don't allow you access..Hi im having trouble entering the bus? when i scroll it just says save and no other options. any ideas?
if ((!isServer) && (isNull player) ) then
{
waitUntil {!isNull player};
waitUntil {time > 3};
};
if ((!isServer) && (player != player)) then
{
waitUntil {player == player};
waitUntil {time > 3};
};
if (isServer) then {
//Bus Route
[true] execVM "busroute\init_bus.sqf";
_serverMonitor = [] execVM "\z\addons\dayz_code\system\server_monitor.sqf";
"PVDZ_sec_atp" addPublicVariableEventHandler {
_x = _this select 1;
if (typeName _x == "STRING") then {
diag_log _x;
}
else {
_unit = _x select 0;
_source = _x select 1;
if (((!(isNil {_source})) AND {(!(isNull _source))}) AND {((_source isKindOf "CAManBase") AND {(owner _unit != owner _source)})}) then {
diag_log format ["P1ayer %1 hit by %2 %3 from %4 meters",
_unit call fa_plr2Str, _source call fa_plr2Str, _x select 2, _x select 3];
if (_unit getVariable["processedDeath", 0] == 0) then {
_unit setVariable [ "attacker", name _source ];
_unit setVariable [ "noatlf4", diag_ticktime ]; // server-side "not in combat" test, if player is not already dead
};
};
};
};
};
if (!isDedicated) then {[] execVM "Scripts\kh_actions.sqf";
//Conduct map operations
waitUntil {!isNil "dayz_loadScreenMsg"};
dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");
//Bus Route
[] execVM "busroute\player_axeBus.sqf";
//Run the player monitor
_id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
_playerMonitor = [] execVM "\z\addons\dayz_code\system\player_monitor.sqf";
"heliCrash" addPublicVariableEventHandler {
_list = nearestObjects [_this select 1, ["CraterLong"], 100];
{deleteVehicle _x;} foreach _list;
};
if (dayz_antihack == 1) then {
[] execVM "\z\addons\dayz_code\system\antihack.sqf";
};
};
"//Check for hackers" \n
" {" \n
" if(vehicle _x != _x && !(vehicle _x in _safety) && (typeOf vehicle _x) != ""ParachuteWest"" && (vehicle _x getVariable [""DZAI"",0] != 1)) 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
"" \n
"dayz_serverObjectMonitor = _safety;"/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
if (isServer) then {
//Bus Route
[true] execVM "busroute\init_bus.sqf";
};
if (!isDedicated) then {
//Bus Route
[] execVM "busroute\player_axeBus.sqf";
};
if (!isDedicated) then {
//Client Bus
["","","",[false,objNull]] execVM "busroute\init_bus.sqf";
};
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)The bus will loop the block at the start point..Code:axBusRouteWaypoints = [[12981.6,10062.9,_axWPZ],[12963.9,10209.5,_axWPZ]];//Test Waypoints
Also a modified admin tools esp script could work,maybe need the player have gps to track busThere was the question in this thread how to add a marker to the moving bus, so anyone can check where it is actually.
This would be a really cool feature, but unfortunately I'm not a scripter at all to achieve this.
Maybe someone can have a look at the Radio Communication Script:
http://epochmod.com/forum/index.php?/topic/9593-release-radio-communication-script/
The code for this purpose is in there, but how to implement it to the Bus Script?
Thx in advance!
RC_addMarker = {
_unit = _this select 0;
_index = _this select 1;
_pos = getPosASL _unit;
_pos resize 2;
_marker = createMarkerLocal [_index, _pos];
_index setMarkerTypeLocal RC_markerType;
if (RC_markerShowName) then {
_index setMarkerTextLocal name _unit;
};
_index setMarkerColorLocal RC_markerColor;
_index setMarkerAlphaLocal RC_markerAlpha;
_index setMarkerDirLocal getDir _unit;
_index setMarkerSizeLocal [RC_markerSize,RC_markerSize];
_index setMarkerPosLocal _pos;
};
[] spawn {
while {not isnull unit} do { "markerUnit" setmarkerpos getpos unit; sleep 0.5; };
};
if (isserver) exitwith{};
while (true) do {
_markerpos = createmarker["buslocation",getpos theBus];
sleep 1;
};
thebus = "Ikarus_TK_CIV_EP1";
_axeBusUnit = objNull;
.
.
_axeBus = "Ikarus_TK_CIV_EP1" createVehicle _axeBuspawnpos;
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 RESISTANCE;
_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];
//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";
_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 "custom\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;
};
sleep 3;
};
if (isserver) exitwith{};
while (true) do {
_markerpos = createmarker["MTVR",getpos theBus];
"MTVR" setMarkerType "mil_dot";
"MTVR" setMarkerColor "ColorRed";
sleep 1;
};