Mountable Vehicles

XianGriM

New Member
So here's the story, my clan and I were trying something new the one night a few weeks ago and played Taki Life instead of DayZ. One of the coolest features we saw in the server we were on was the ability to climb into the back of vehicles, for example, the White Pickup.

Your character would kneel down in the back and stay as though "attached". Yet, you could still "move/look" around and even fire from that position. I've managed to get my hands on the server files but alas, my knowledge of scripting only goes so far. I've been trying to dissect different parts of it but nothing I've tried has worked so far.

I KNOW it can be done so what I'm asking is if anyone knows someone whos already ported this over to DayZ or is currently working on it? If not, should I upload a copy of the files from that Taki Life, maybe someone with more knowledge than I can take a crack at it?
 
Did you get this to work?
Cause i'm interested of trying it out

Wish I could say I did but I spent the better part of two weeks dissecting these files and trying to get them ported over to DayZ. I know for a fact they work, as I got them from a Taki Life server. I just don't have enough knowledge about scripting to get it to work for us.

As I've mentioned, I'd more than happy to supply all the necessary files for someone more skilled to take a whack at it
 
I can get this to work but antihack blocks you from getting out of the vehicle.
Backspace is used for getting out. How would I whitelist backspace to ah?
 
To setup this (This is from from piXel`s addin)

Bottom of init.sqf add
Code:
_nul = [] execVM "vehInit.sqf";    //vehicle climb

Then just throw these 3 files in your mission folder.

vehInit.sqf
Code:
//===================piXel 12-02-2013============
if (isServer) exitwith {};
waitUntil {sleep 2; count vehicles > 1};
sleep 10;
{
If (typeOf _x in ["Old_bike_TK_CIV_EP1","VolhaLimo_TK_CIV_EP1","Volha_2_TK_CIV_EP1","Volha_1_TK_CIV_EP1","car_sedan","car_hatchback","Lada2_TK_CIV_EP1","Lada1_TK_CIV_EP1","Skoda","Lada1","Lada2","LadaLM","SkodaRed","SkodaGreen","SkodaBlue","datsun1_civil_3_open","datsun1_civil_1_open","hilux1_civil_1_open","hilux1_civil_3_open_EP1"]) then
{
nul = _x addAction ["Climb on back","vehClimb.sqf",[],-5,false,true,"","(vehicle player != _target)"];
};
} forEach (vehicles);

vehClimb.sqf
Code:
//===================piXel 12-02-2013============
if (isserver) exitwith {};
private["_carrier","_player","_anim","_anim2","_anim3","_anim4","_sitPosture","_display"];
 
// bug in animationstate filter
_carrier = _this select 0;
_player = _this select 1;
_anim = animationState (nearestObjects [_carrier, ["man"], 4] select 0);
_anim2 = animationState (nearestObjects [_carrier, ["man"], 4] select 1);
_anim3 = animationState (nearestObjects [_carrier, ["man"], 4] select 2);
_anim4 = animationState (nearestObjects [_carrier, ["man"], 4] select 3);
_sitPosture = "sitUnarm_L_idleLoop_inUH1Y";
 
if (_anim == _sitPosture || _anim2 == _sitPosture || _anim3 == _sitPosture || _anim4 == _sitPosture) exitWith
{[nil, _player, "loc", rTITLETEXT, "There is only space for one", "PLAIN DOWN"] call RE;};
 
if (_carrier iskindOf "Old_bike_TK_CIV_EP1") then
    {
    _player attachTo [_carrier,[0,-0.6,-0.94]];
    _player setDir 180;
    };
 
If (typeOf _carrier in ["VolhaLimo_TK_CIV_EP1","Volha_2_TK_CIV_EP1","Volha_1_TK_CIV_EP1","car_sedan","car_hatchback"]) then
    {
    _player attachTo [_carrier,[0,-2,-1.3]];
    _player setDir -90;
    };
   
If (typeOf _carrier in ["Lada2_TK_CIV_EP1","Lada1_TK_CIV_EP1","Skoda","Lada1","Lada2","LadaLM","SkodaRed","SkodaGreen","SkodaBlue"]) then
    {
    _player attachTo [_carrier,[-0.55,-1.6,-1.35]];
    _player setDir -10;
    };
   
If (typeOf _carrier in ["datsun1_civil_3_open","datsun1_civil_1_open","hilux1_civil_3_open_EP1","hilux1_civil_1_open"]) then
    {
    _player attachTo [_carrier,[-0.7,-1.2,-1.25]];
    _player setDir 30;
    };
_player setPos getPos _carrier;
[nil,_player,rSwitchMove, _sitPosture] call RE;
//_player setFaceAnimation 0.5;
 
backSpace = compile preprocessFile "vehKey.sqf";
disableSerialization;
_display = findDisplay 46;
_display displaySetEventHandler ["KeyDown","_this call backSpace"];
 
[nil, _player, "loc", rTITLETEXT,"To get off press 'BACKSPACE'", "PLAIN DOWN"] call RE;

vehKey.sqf
Code:
//===================piXel 12-02-2013============
private["_player","_handled","_display"];
 
_player = player;
_handled = false;
switch (_this select 1) do
    {
    //BACKSPACE
    case 14:
        {
        detach _player;
        [nil,_player,rSwitchMove, "AcrgPknlMstpSnonWnonDnon_AmovPercMstpSrasWrflDnon_GetOutHigh"] call RE;
        _display = findDisplay 46;
        _display displaySetEventHandler ["KeyDown", ""];
        _handled = true;
        };
    };
_handled;
 
The code I listed is completely different from his work. Pixels only allows the player to ride "shotgun" on these vehicles. The code I am trying to work with would actually allow the player to "kneel" in the back of a pickup truck and constantly move around AND shoot at the same time.

I can't stress enough that the coding WORKS, on Taki Life, I am just looking for someone skilled enough to help bring it over to DayZ.
 
i wouldnt mind seeing this come to life, sounds like an awesome addition that SHOULD already be ingame.
 
could you possibly upload the pbo and not just that pastebin as there might be missing code in other arma files
 
Back
Top