[TUTORIAL] Deployable bike. {1.7.7.1}

Does this work on 1.8?
I tried Lazyink's method and got nothing, but when I tried RichyM92's method I got the scroll option but no bike spawned.
 
I think it has to do with the combat system changing.

I removed the below line and the closing }; from bike.sqf and bike2.sqf and it worked.
The only problem is it kills you when you try to get on the bike is there a solution for this?

if (dayz_combat == 1) then {
cutText [format["You are in Combat and cannot build a bike."], "PLAIN DOWN"];
} else {
 
Really love how all the code posted here has been ripped out of my servers mission file without any permission but go ahead it's far too late now. Just don't expect any support from me. I guess from now on I'll just have to protect the code on my server until I'm ready to release it.
 
Nothing was ripped out of the mission file, you posted on the first page of how to do it and I had posted in the Overwatch part of the forums for people who were having issues of how to add it in and gave credits to you for providing the code. http://opendayz.net/threads/auto-refuel-deploy-able-bikes.13707/page-2#post-71635, the other people posting in here had taken the code that I provided in the other forum and posted it in here.
 
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
 
thanks or the post, but what goes where? could you please specify which sqf goes in which folder. thats what i was meaning by clear instructions. some of you guys are very familiar with this stuff so no need for the details but the noobs like me need the step by step. i appreciate your time.

thanks
 
If you guys are also running Sarge AI you could try setting the variable it spawns with to Sarge instead:

Change this:

Code:
 _object = "Old_bike_TK_CIV_EP1" createVehicle (position player);
        _object setVariable ["ObjectID", "1", true];
        _object setVariable ["ObjectUID", "1", true];

to this:

Code:
 _object = "Old_bike_TK_CIV_EP1" createVehicle (position player);
        _object setVariable ["Sarge", "1", true];

Assuming you have your server_updateObject.sqf and server_cleanup.fsm edited to deal with Sarge AI I don't see why that wouldn't work with this as well.




This worked perfect for me... no more dieing when getting on deployed vehicles.. I don't even have sarge Ai on the server and just doing like drunkenjawa posted above worked...Also good thing I have a lot of experience with sarge AI so was easy for me...heres what I did with my server_updateObject.sqf and server_cleanup.fsm...

in your server pbo
1. adjust this line in your server_cleanup.fsm : (system\server_cleanup.fsm)

Code:
  if  (!(vehicle _x in _safety) && ((typeOf vehicle _x) != ""ParachuteWest"") ) then {" \n
Change it to
Code:
  if  (!(vehicle _x in _safety) && ((typeOf vehicle _x) != ""ParachuteWest"") && (vehicle _x getVariable [""Sarge"",0] != 1) ) then {" \n
Or if your line looks like this
Code:
  if(vehicle _x != _x  && !(vehicle _x in _safety) && (typeOf vehicle _x) != ""ParachuteWest"") then {" \n
Change it to
Code:
  if(vehicle _x != _x && (vehicle _x getVariable [""Sarge"",0] != 1) && !(vehicle _x in _safety) && (typeOf vehicle _x) != ""ParachuteWest"") then {" \n
also in your server pbo
2. In your server_updateObject (Compile\server_updateObject.sqf) find this line ( should be around line 18-22 )
Code:
if (_objectID == "0" && _uid == "0") then
Change it to
Code:
if (_objectID == "0" && _uid == "0" && (vehicle _object getVariable ["Sarge",0] != 1)) then
Hope this helps those having the instant death when getting on a deployed vehicle... If anyone needs help with this or a lot of other things join my TS3: always happy to help IP: ts55.light-speed.com:4176
 
Last edited:
thanks or the post, but what goes where? could you please specify which sqf goes in which folder. thats what i was meaning by clear instructions. some of you guys are very familiar with this stuff so no need for the details but the noobs like me need the step by step. i appreciate your time.

thanks

Join my TeamSpeak 3 planetrodriguez I will guide you step by step... IP: ts55.light-speed.com:4176 just message me (SyCo) if im in a channel you cant get in...
 
Interesting problem. The script works fine however, from time to time when you repack it, it also can delete something nearby. things that get deleted range from any kind of vehicle, map additions like fort walls and barracks that are nearby.
 
Use this version for 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"];
    };
};
 
Players can't interrupt deploying a bike, and it happens alot when trying to trade items. Kind of annoying. Anyway I can make it so you can interrupt the action?

Guessing: r_interrupt=True?
 

The above return:

trans_psychobox-vflrMCkh5.png

Nothing Here
The file you're looking for has been deleted or moved.
if you are going to do a "tutorial" maybe you should keep the files available for everyone or else it's a bit pointless? [ I think so ]
 
I have a scroll wheel bike script that allows you to interrupt by moving when deploying. I'll post it here after work.
I don't like deploy bike as a right click button because players will never know about it.
 
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";
    _dis=10;
    _sfx = "repair";
    [player,_sfx,0,false,_dis] call dayz_zombieSpeak;
    [player,_dis,true,(getPosATL player)] spawn player_alertZombies;
 
    r_interrupt = false;
    r_doLoop = true;
    _finished = false;
    _finishedTime = diag_tickTime +8;
 
    while { r_doLoop } do {
        if (diag_tickTime >= _finishedTime) then {
            r_doLoop = false;
            _finished = true;
        };
        if (r_interrupt) then {
            r_doLoop = false;
        };
        sleep 0.1;
    };
if (_finished) then {
    _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"];
    sleep 10;
    cutText [format["Warning: Spawned bikes DO NOT SAVE after server restart!"], "PLAIN DOWN"];
} else {
    r_interrupt = false;
    player switchMove "";
    player playActionNow "stop";
    player addWeapon "ItemToolbox";
    cutText ["Building cancelled!", "PLAIN DOWN"];
    };
};
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"];
    };
};
fn_selfActions.sqf
Code:
// -------------------------------------- Deploy Bike --------------------------------------
_weapons = [currentWeapon player] + (weapons player) + (magazines player);
_isBike = typeOf cursorTarget in ["Old_bike_TK_INS_EP1","Old_bike_TK_CIV_EP1"];
// -------------------------------------- BIKE DEPLOY --------------------------------------
if ("ItemToolbox" in _weapons) then {
        hasBikeItem = true;
    } else { hasBikeItem = false;};
    if((speed player <= 1) && hasBikeItem && _canDo) then {
        if (s_player_deploybike < 0) then {
            s_player_deploybike = player addaction[("<t color=""#b4b700"">" + ("Deploy Bike") +"</t>"),"deploys\bike\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=""#b4b700"">" + ("Re-Pack Bike") +"</t>"),"deploys\bike\pack.sqf","",5,false,true,"", ""];
    };
} else {
    player removeAction s_player_deploybike2;
    s_player_deploybike2 = -1;
};
// --------------------------------------  PACK BIKE --------------------------------------
 
Back
Top