Deployable bike, scroll wheel issue

cen

Valued Member!
@DayzEpoch\addons\dayz_code.pbo (unpack it)

then it's in the compile folder.
 

planetrodriguez

New Member
Can anyone PLEASE, make a clean post on how to deploy bike in dayz? ive been trying for days and all the instructions are either scattered or they just dont work. PLEASE someone post the whole thing from beginning to end. There are many that are not very experienced and need a simple written directions.
thank you
 

DangerRuss

OpenDayZ Rockstar!
ok guys I haven't actually tried this but what Cen is telling you is REALLY basic stuff.
First off the fn_selfactions.sqf is in you dayz code on your CLIENT side... not your server... so on my pc its in my steam > steam apps> common>arma 2 oa > @Dayz (or @dayzepoch/overwatch) >addons > dayz_code (its a PBO and you need to unpack it w/ a pbo manager) > compile > fn_selfactions.sqf

Now that you have that SQF you need to add it to your server. The way I do it, and most other people do it, is you make a folder in the root of your mission file on your server, and name it whatever the hell you want. I name mine custom.... inside the custom folder is where you slap this lovely fn_Selfactions.sqf.... BUT the server doesn't give a shit that you've bothered to make a custom folder and put that fn_selfactions.sqf in it because it doesn't know it's even there! So you have to tell the server to look for that custom folder. This is actually a 2 part process.

The first part (since you're already in the custom folder) would be to add the compiles.sqf from your client side dayz_code.pbo to this same custom folder OR and considerably easier.. just make a blank .sqf document and name it compiles.sqf and add it to the custom folder. No in that blank compiles.sqf add this
Code:
fnc_usec_selfActions = compile preprocessFileLineNumbers "custom\fn_selfActions.sqf";            // fnc_usec_selfActions - adds custom actions to dayz code
Now the second part.. you need to tell the server to look for that custom folder! So with that in mind go ahead and open up your init.sqf which is also located in the root of your mission folder. Now find this line
Code:
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";                    //Compile regular functions
and DIRECTLY UNDERNEATH OF IT add this
Code:
call compile preprocessFileLineNumbers "custom\compiles.sqf"; //Compile custom compiles
So it should look like this
Code:
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";                    //Compile regular functions
call compile preprocessFileLineNumbers "custom\compiles.sqf"; //Compile custom compiles
Now keep in mind, Ive named the folder custom , you can name it whatever you want BUT IF YOU DO YOU MUST CHANGE "custom" TO WHATEVER YOU NAMED IT. So if you called it "anus" the line would look like
Code:
fnc_usec_selfActions = compile preprocessFileLineNumbers "anus\fn_selfActions.sqf";            // fnc_usec_selfActions - adds custom actions to dayz code
and

Code:
call compile preprocessFileLineNumbers "anus\compiles.sqf"; //Compile custom compiles
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Now back to the bike thing. As far as the fn_selfactions.sqf part of the instructions, you can apparently copy/paste the code provided at the top of this thread for that respective part anywhere within the fn_selfactions.sqf just make sure you're not pasting it over existing code.

as for the deploy.sqf and the pack.sqf it would appear that you can just copy paste those into a .sqf document, add them to the root of your mission folder, and probably just call them in your init.sqf. Or you could make a folder name it whatever you want, put them both in it, put that folder in your mission folder, and call that folder/pack.sqf or folder/deploy.sqf.... Im not 100% sure on this since Ive never added this mod before but that looks like what makes sense to me. Give that a try and see what ya get. Good luck
 

planetrodriguez

New Member
Thanks DangerRuss for the detailed instructions but the last part of your instructions you dont really explain. you say to copy the deploy and pack sqf to the root and call them in your init.sqf... well im not so good at this, so that part is not very clear to me. how do you call a document in init.sqf. i see how other call lines are put there but you need to have the proper wording and i dont know how to do that. im sure many others also cant. could you help please.

and if someone could actually verify if this works that would help others from having to experiment on their servers and having to reset them over and ove. I think ive reset my server at least 30 times now. Just wanting some help guys.
thanks very much for your help
 
Last edited:

DangerRuss

OpenDayZ Rockstar!
Sure no problem I apologize for being vague I was rushing a bit cause that was quite a wall of text :D
Also, I was wrong, you don't need to call them in your init.sqf because they are being called in the script you're adding to the fn_selfactions. And if you followed my previous instructions, the fn_selfactions.sqf is being called in your init.sqf already because we put it in that "custom" folder.

place these 2 documents (deploy and pack.sqf) in your mission folder (i believe cen said to put them in a folder called deploys)

EDIT- I just had a look at the code and if you look at the part where you're supposed to copy paste into your fn_selfactions.sqf that it says

Code:
("Deploy Bike") +"</t>"),"deploys\bike\deploy.sqf","",
so you're going to want to make a folder called deploys and inside that put another folder called bike, and inside that put the deploy.sqf and the pack.sqf!!


So having a look at what we just did I'll some it up briefly. We told the server that we want it to look in a custom folder we created to find a text document that will tell the server to launch the fn_selfactions.sqf we edited, and not the generic one. This way we can edit the actions our players can do and the server will launch that edited version. We then edited the selfactions so that it will run the code found in the pack and deploy.sqf. In the script that we place in the fn_selfactions.sqf it is telling the server to look for deploy.sqf and pack.sqf in a folder called bike which is inside another folder called deploys which is why you want those files to be in there otherwise it wont be able to find them and wont work. This process is almost identical to what you would need to do if you wanted to add self blood bag to your server. In fact you've done half of the work already. All you would need to do is add the self blood bag script to the fn_selfactions.sqf and place the bloodbag.sqf or whatever its called in a folder which the previous script tells the server to look for. But that's another story.
After you get this to work you may have a some issues where the server thinks that the bicycles the player makes are "hacked" bicycles and may kill your players. We'll cross that bridge when you come to it.
 
Last edited:

Fubar22

New Member
HELLO COMMUNITY - NEED HELP WITH DYING PLAYERS WHEN GETTING ON BIKE
I am still having a problem with players dying when they get on to ride the newly deployed bike. (Running EPOCH 1.0.3.1) I have all the files for deploying the bike in the all right places as shown in this post, but there is something that is causing the players to instantly die when trying to ride it.
People have replied previously saying there needs to be an "exception" in the antihack....but that has changed since 1.0.3. So, does anyone have this working? If so, would you mind helping out with how to keep players from dying?
 

DangerRuss

OpenDayZ Rockstar!
HELLO COMMUNITY - NEED HELP WITH DYING PLAYERS WHEN GETTING ON BIKE
I am still having a problem with players dying when they get on to ride the newly deployed bike. (Running EPOCH 1.0.3.1) I have all the files for deploying the bike in the all right places as shown in this post, but there is something that is causing the players to instantly die when trying to ride it.
People have replied previously saying there needs to be an "exception" in the antihack....but that has changed since 1.0.3. So, does anyone have this working? If so, would you mind helping out with how to keep players from dying?
The easiest way to do this is to quote out the kill a hacker line within your server_cleanup.fsm
So in your Server PBO > system > server_cleanup.fsm you'll see this
Code:
       "Check for hackers" \n
       " {" \n
       "     if(vehicle _x != _x && (vehicle _x getVariable [""Sarge"",0] != 1) && !(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
or something very similar (one or two of the lines will look a bit different but you mainly want to focus on finding that killing a hacker part...

and you want to make it look like this

Code:
       "//Check for hackers" \n
       "// {" \n
       "//      if(vehicle _x != _x && (vehicle _x getVariable [""Sarge"",0] != 1) && !(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
But BE WARNED!!!!!! The reason it is killing your players is it thinks they are hackers spawning in bicycles. If you quote out this part hackers will be able to spawn vehicles on your server with no consequence unless you or battleye catches them. If you're active and you have admin tools this isn't a big deal, otherwise you'll want to find another solution. The solution would be some kind of addion to this line I think...

Code:
f(vehicle _x != _x && (vehicle _x getVariable [""Sarge"",0] != 1) && !(vehicle _x in _safety) && (typeOf vehicle _x) != ""ParachuteWest"") then {" \n
What exactly you would need to add or change is beyond me, and this line will most likely look different for you because mine was edited for running NPC missions with Sarge AI.
 
Last edited:

fkh

New Member
Hi guys

I am currently trying to get cen's script running on my Epoch 1.0.4.2 server. Everything is working fine except that I only get the mousewheel option (deploy bike) once I face a target (vehicle, item ...). When I am not focusing anything I do not get this option. Do you guys have any clue what I am doing wrong here?

This is what I have done so far:
Added a custom (blank) compiles.sqf to the mission and call it in init.sqf
Code:
call compile preprocessFileLineNumbers "custom\compiles.sqf";
compiles.sqf has only two lines
Code:
// self bloodbagging & take clothes & deploy bike
fnc_usec_selfActions = compile preprocessFileLineNumbers "custom\fn_selfActions.sqf";
// change clothes while having backpack on
player_wearClothes = compile preprocessFileLineNumbers "custom\player_wearClothes.sqf";
fn_selfActions.sqf has the following code (slightly modified) right before the self bloodbag part
Code:
_items = [currentWeapon player] + (weapons player) + (magazines player) + (items player);
_hasToolbox = "ItemToolbox" in _items;
_hasWheel = "PartWheel" in _items;
_hasScrapmetal = "PartGeneric" in _items;
_hasBikeItem = _hasToolbox && _hasWheel && _hasScrapmetal;
_isBike = typeOf cursorTarget in ["Old_bike_TK_INS_EP1","Old_bike_TK_CIV_EP1"];

// deploy bike
if((speed player <= 1) && _hasBikeItem && _canDo) then {
    if (s_player_deploybike < 0) then {
            s_player_deploybike = player addaction[("<t color=""#00ff00"">" + ("Deploy Bike") +"</t>"),"custom\deploy.sqf","",5,false,true,"", ""];
    };
} else {
    player removeAction s_player_deploybike;
    s_player_deploybike = -1;
};

//pack bike
if((_isBike) and _canDo) then {
    if (s_player_deploybike2 < 0) then {
        s_player_deploybike2 = player addaction[("<t color=""#00ff00"">" + ("Re-Pack Bike") +"</t>"),"custom\pack.sqf","",5,false,true,"", ""];
    };
} else {
    player removeAction s_player_deploybike2;
    s_player_deploybike2 = -1;
};
I am also running infiSTAR's antihack tool and added s_player_deploybike and s_player_deploybike2 to _dayzActions. I do not understand why I only get the deploy bike option when facing some other target. Does someone have a clue what is going wrong here? Any help is much appreciated.

Cheers
fkh
 

DangerRuss

OpenDayZ Rockstar!
Hi guys

I am currently trying to get cen's script running on my Epoch 1.0.4.2 server. Everything is working fine except that I only get the mousewheel option (deploy bike) once I face a target (vehicle, item ...). When I am not focusing anything I do not get this option. Do you guys have any clue what I am doing wrong here?

This is what I have done so far:
Added a custom (blank) compiles.sqf to the mission and call it in init.sqf
Code:
call compile preprocessFileLineNumbers "custom\compiles.sqf";
compiles.sqf has only two lines
Code:
// self bloodbagging & take clothes & deploy bike
fnc_usec_selfActions = compile preprocessFileLineNumbers "custom\fn_selfActions.sqf";
// change clothes while having backpack on
player_wearClothes = compile preprocessFileLineNumbers "custom\player_wearClothes.sqf";
fn_selfActions.sqf has the following code (slightly modified) right before the self bloodbag part
Code:
_items = [currentWeapon player] + (weapons player) + (magazines player) + (items player);
_hasToolbox = "ItemToolbox" in _items;
_hasWheel = "PartWheel" in _items;
_hasScrapmetal = "PartGeneric" in _items;
_hasBikeItem = _hasToolbox && _hasWheel && _hasScrapmetal;
_isBike = typeOf cursorTarget in ["Old_bike_TK_INS_EP1","Old_bike_TK_CIV_EP1"];
 
// deploy bike
if((speed player <= 1) && _hasBikeItem && _canDo) then {
    if (s_player_deploybike < 0) then {
            s_player_deploybike = player addaction[("<t color=""#00ff00"">" + ("Deploy Bike") +"</t>"),"custom\deploy.sqf","",5,false,true,"", ""];
    };
} else {
    player removeAction s_player_deploybike;
    s_player_deploybike = -1;
};
 
//pack bike
if((_isBike) and _canDo) then {
    if (s_player_deploybike2 < 0) then {
        s_player_deploybike2 = player addaction[("<t color=""#00ff00"">" + ("Re-Pack Bike") +"</t>"),"custom\pack.sqf","",5,false,true,"", ""];
    };
} else {
    player removeAction s_player_deploybike2;
    s_player_deploybike2 = -1;
};
I am also running infiSTAR's antihack tool and added s_player_deploybike and s_player_deploybike2 to _dayzActions. I do not understand why I only get the deploy bike option when facing some other target. Does someone have a clue what is going wrong here? Any help is much appreciated.

Cheers
fkh
does your antihack have check actions set to true in the config file?
If yes, set it to false and see if it works. If it works with that false, you know its your antihack. In which case you're probably not gonna get much help here.
 

cen

Valued Member!
Use these, they are updated.

deploy.sqf
Code:
if (false) then {
    cutText [format["You are in combat and cannot build a bike."], "PLAIN DOWN"];
} else {
    player removeAction s_player_deploybike;
    closeDialog 602;
    player removeWeapon "ItemToolbox";
    player playActionNow "Medic";
    r_interrupt = false;
    _dis=10;
    _sfx = "repair";
    [player,_sfx,0,false,_dis] call dayz_zombieSpeak;
    [player,_dis,true,(getPosATL player)] spawn player_alertZombies;
   
    sleep 6;
   
    _object = "Old_bike_TK_INS_EP1" createVehicle (position player);
    _object setVariable ["ObjectID", "1", true];
    _object setVariable ["ObjectUID", "1", true];
   
    player reveal _object;

    cutText [format["You've used your toolbox to build a bike! How magical!"], "PLAIN DOWN"];
   
    r_interrupt = false;
    player switchMove "";
    player playActionNow "stop";
   
    sleep 10;
   
    cutText [format["Warning: Spawned bikes DO NOT SAVE after server restart!"], "PLAIN DOWN"];
   
};
//bike deploy script by Player2 - OpenDayz Release Coming Soon!
pack.sqf
Code:
if (false) then {
// player is in combat and cant pack his bike
    cutText [format["You are in combat and cannot re-pack your bike."], "PLAIN DOWN"];
} else {
    if (typeOf cursorTarget == "Old_bike_TK_INS_EP1" || typeOf cursorTarget == "Old_bike_TK_CIV_EP1") then {
    // player is looking at a bike and the target has a bike classname
    // delete it first to avoid player changing to another target
        deletevehicle cursorTarget;
        player removeAction s_player_deploybike2;
        player playActionNow "Medic";
        r_interrupt = false;
        player addWeapon "ItemToolbox";       
        _dis=10;
        _sfx = "repair";
        [player,_sfx,0,false,_dis] call dayz_zombieSpeak;
        [player,_dis,true,(getPosATL player)] spawn player_alertZombies;
        sleep 6;
        cutText [format["You have packed your bike and been given back your toolbox"], "PLAIN DOWN"];
        r_interrupt = false;
        player switchMove "";
        player playActionNow "stop";
    } else {
        // player is not looking at a bike, or target does not have a bike classname
        cutText [format["You have to be facing your bike to re-pack it!"], "PLAIN DOWN"];
    };
};
 

fkh

New Member
Hi guys

does your antihack have check actions set to true in the config file? [..]
Check actions was set to false (_CSA = false; ). I set up a new local server and redid all the steps and so far it is working. My guess is that another script of mine is breaking the functionality. Need to check which one it is. Thank you for the help though.

Use these, they are updated.[/CODE]
Thank you for the update. I updated my files with your modifications.

Cheers
fkh
 
Last edited:

DangerRuss

OpenDayZ Rockstar!
Use these, they are updated.

deploy.sqf
Code:
if (false) then {
    cutText [format["You are in combat and cannot build a bike."], "PLAIN DOWN"];
} else {
    player removeAction s_player_deploybike;
    closeDialog 602;
    player removeWeapon "ItemToolbox";
    player playActionNow "Medic";
    r_interrupt = false;
    _dis=10;
    _sfx = "repair";
    [player,_sfx,0,false,_dis] call dayz_zombieSpeak;
    [player,_dis,true,(getPosATL player)] spawn player_alertZombies;
  
    sleep 6;
  
    _object = "Old_bike_TK_INS_EP1" createVehicle (position player);
    _object setVariable ["ObjectID", "1", true];
    _object setVariable ["ObjectUID", "1", true];
  
    player reveal _object;
 
    cutText [format["You've used your toolbox to build a bike! How magical!"], "PLAIN DOWN"];
  
    r_interrupt = false;
    player switchMove "";
    player playActionNow "stop";
  
    sleep 10;
  
    cutText [format["Warning: Spawned bikes DO NOT SAVE after server restart!"], "PLAIN DOWN"];
  
};
//bike deploy script by Player2 - OpenDayz Release Coming Soon!
pack.sqf
Code:
if (false) then {
// player is in combat and cant pack his bike
    cutText [format["You are in combat and cannot re-pack your bike."], "PLAIN DOWN"];
} else {
    if (typeOf cursorTarget == "Old_bike_TK_INS_EP1" || typeOf cursorTarget == "Old_bike_TK_CIV_EP1") then {
    // player is looking at a bike and the target has a bike classname
    // delete it first to avoid player changing to another target
        deletevehicle cursorTarget;
        player removeAction s_player_deploybike2;
        player playActionNow "Medic";
        r_interrupt = false;
        player addWeapon "ItemToolbox";      
        _dis=10;
        _sfx = "repair";
        [player,_sfx,0,false,_dis] call dayz_zombieSpeak;
        [player,_dis,true,(getPosATL player)] spawn player_alertZombies;
        sleep 6;
        cutText [format["You have packed your bike and been given back your toolbox"], "PLAIN DOWN"];
        r_interrupt = false;
        player switchMove "";
        player playActionNow "stop";
    } else {
        // player is not looking at a bike, or target does not have a bike classname
        cutText [format["You have to be facing your bike to re-pack it!"], "PLAIN DOWN"];
    };
};
Is there any possibility with these causing issues to my fn_selfactions.sqf? Players on my server are no longer able to rotate tents before placing, they are unable to interrupt the self blood bagging process, the crafting menu is no longer able to be opened by pressing "I"... stuff like that.. trying to narrow down where this issue originates from.
 

James Cochran

New Member
Implemented this script, and it kills players..... Any idea? Tried looking inot the server_cleanup.fsm file, and there is nothing in there about check for hackers.
 
Last edited:
Top