Working Tavi 2.0 Halo Spawn

Tehdango

Member
OK here it is, a working halo spawn for Tavi 2.0. I would first like to say im still a little new to this so if i have done anything here that compromises any antihack or monitoring mods please say so immediately and i will pull this down!

If you go to the halo spawn in the tutorials then you will find the one i followed at the end of the thread in a link describing the new halo spawn tutorials. Like i said, I followed these two options and tweaked my own pbo to get this working.

OK the first step is navigating to the server_playersetup.sqf in the server file that you get from unpacking your PBO. Mine looks like:

dayz_server>compile>server_playerSetup.sqf
(you will open this with your notepad++ or whatever you use)

Around line 200( line 206 for me) you will see this block of code:

Code:
dayzPlayerLogin2 = [_worldspace,_state];
_clientID = owner _playerObj;
_clientID publicVariableClient "dayzPlayerLogin2";

You will need to change the dayzPlayerLogin2 = [_worldspace,_state]; to look like this

Code:
dayzPlayerLogin2 = [_worldspace,_state,_randomSpot];
_clientID = owner _playerObj;
_clientID publicVariableClient "dayzPlayerLogin2";

Now save the file and close it to avoid any mis clicks or unintended character changes.

The next thing you need to do is navigate to dayz_server>compiles>server_updateObject.sqf(again this is what my server folder is named. Yours may be named something else but you will still have the complies>server_updateObject.sqf (If you do not then something is seriously wrong.))

OK now this is one of the steps i fiddled with and finally after hours got the chute to not disappear 20 feet from the ground. Try this way first. If im correct this only handles disappearing chutes NOT chutes killing people. I will get to that in a bit.

You will again open this file with your notepad++ or w/e you use and scroll to about line 20 and look for this block of code pertaining to parachute:

Code:
if (!_parachuteWest) then {
    if (_objectID == "0" && _uid == "0") then
    {
        _object_position = getPosATL _object;
            diag_log(format["Deleting object %1 with invalid ID at pos [%2,%3,%4]",
            typeOf _object,
            _object_position select 0,
            _object_position select 1,
            _object_position select 2]);
            _isNotOk = true;
    };
};

All you need to do is add /* before the if and */ after the closing brackets. It should look like this:


Code:
if ((typeName _objectID != "string") || (typeName _uid != "string")) then
{ 
    diag_log(format["Non-string Object: ID %1 UID %2", _objectID, _uid]);
    //force fail
    _objectID = "0";
    _uid = "0";
};
/*
if (!_parachuteWest) then {
    if (_objectID == "0" && _uid == "0") then
    {
        _object_position = getPosATL _object;
            diag_log(format["Deleting object %1 with invalid ID at pos [%2,%3,%4]",
            typeOf _object,
            _object_position select 0,
            _object_position select 1, 
            _object_position select 2]);
            _isNotOk = true;
    };
};
*/
if (_isNotOk) exitWith { deleteVehicle _object; };

_lastUpdate = _object getVariable ["lastUpdate",time];
_needUpdate = _object in needUpdate_objects;
*/

Now save the file and close it to avoid any mis clicks or unintended character changes.

OK now this step confused me a lot so i will try to make this very easy to understand. Navigate to dayz_server>system>server_cleanup.fsm(once again this is what my server folder is called yours may be named different but you still have the system>server_cleanup.fsm(If not then once again you are in trouble.))

Once again open the file with your notepad++ or w/e you use and SEARCH(not scroll) search for hackers. There will be two different areas that come up so be sure you locate the block of code that looks like this:

Code:
"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

Now this was confusing to for tavi. Yours most likely has the // infront of "Check for hackers" \n like this:

Code:
"//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

What i did was literally copy and paste the section of code form the tutorial i followed to make it look like this:

Code:
"//Check for hackers" \n
      "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

Now my problem is that i use Sarge AI on our Taviana server. So mine looked 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

Now what i did was literally copy and paste over my sarge vehicle cleanup with the provided code i got from the tutorial i followed and all my ai seems to be working just fine. However i think this may cause helicopters that the ai leave once again obtainable by players. I plan to work with this to try and incorporate both statements in the future. So for now make it look like this:

Code:
"//Check for hackers" \n
      "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

COPY AND PASTE THIS. START FROM THE QUOTATION MARKS!
*****TWO PART TUTORIAL SEE NEXT POST*****
 
*****PART TWO*****

OK now on to the mission file changes.

First navigate to dayz_mission>init.sqf(remember that this is just what my mission folder is named you will still have the init.sqf(If not then well......lol))

Scroll to the very bottom of the file and paste this:

Code:
MC_BIS_halo_spawn = compile preprocessFileLineNumbers "fixes\haloInit.sqf";
private["_mkr"];
_mkr = "spawn" + str(round(random 4));
if (!isDedicated) then {
    [] spawn {
        waitUntil { !isNil ("dayz_Totalzedscheck") and
!(player getVariable ["humanity",0] > 5000 and
typeOf player == "Survivor2_DZ") and
!(player getVariable ["humanity",0] < -2000 and
(typeOf player == "Survivor2_DZ" or
typeOf player == "SurvivorW2_DZ") ) and
!(player getVariable ["humanity",0] > 0 and
(typeOf player == "Bandit1_DZ" or
typeOf player == "BanditW1_DZ") )
};
 
        if (dayzPlayerLogin2 select 2) then
        {
            _pos = position player;
            _mkr setMarkerPos [_pos select 0, _pos select 1];
            player spawn MC_BIS_halo_spawn;
        };
    };
};

Now close and save this to prevent any mis clicks or character changes.

OK this is the step that i had to play with a while before i figured it out. According to the chernarus tutorial i followed your supposed to REPLACE:

Code:
_playerMonitor =    [] execVM "\z\addons\dayz_code\system\player_monitor.sqf";

with this line:

Code:
_playerMonitor =    [] execFSM "fixes\player_monitor.fsm";

However when i do this on tavi 2.0 it prevents any loot and zeds from spawning on the map. Sarge AI will still function though. The solution i am using currently without any issues that i have noticed is to use BOTH lines like this:

Code:
if (!isDedicated) then {
    [] execVM "effects.sqf";
    [] ExecVM "axs_gearmanagement\doGear.sqf";
    0 fadeSound 0;
    0 cutText [(localize "STR_AUTHENTICATING"), "BLACK FADED",60];
    //_id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
    _playerMonitor =    [] execVM "\z\addons\dayz_code\system\player_monitor.sqf";
    _playerMonitor =    [] execFSM "fixes\player_monitor.fsm";
    _nul = [] execVM "camera\loginCamera.sqf";
    _nul = [] execVM "addin\plrInit.sqf";
};

NOTICE HOW MY BLOCK OF CODE HAS OTHER LINES. THESE ARE OTHER MODS I HAVE RUNNING. IF YOU DO NOT HAVE THESE ACT LIKE THEY DO NOT EXIST!!!!

Now close and save this to prevent any mis clicks or character changes.

Now the fix for battle eye is on every tutorial pertaining to this halo jump. It is the basic change a line to this line kind of thing. I will not include this because it is everywhere.

Alright now we need to cover the antihack part. Pay close attention to this please. ON YOUR PC navigate to:

your hard drive>program files>steam>steamapps>common>arma 2 operation arrowhead>@dayz>addons>right click dayz_code(not day_z code.pbo.dayz.bisgn) now select unpack and unpack this to where you want it. I unpack it in the folder ur in right now.

WHEN YOU UNPACK navigate to:

dayz_code>system>player_monitor.fsm

Create a folder called fixes if you do not already have one in your mission folder. Move this file into your fixes folder.

Now open the player_monitor.fsm that you just moved into your fixes folder with you notepad++ or w/e you use and SEARCH for execVM(make sure your search options you unclick the check box for match whole word only and match case. This just makes it easier to find things.) There will be two instances of execVM. You want the one that says:

Code:
"[] execVM ""\z\addons\dayz_code\system\antihack.sqf"";" \n

now just put this in front of it // so it looks like this:

Code:
//"[] execVM ""\z\addons\dayz_code\system\antihack.sqf"";" \n

Now close and save this so you do not make any mis clicks or character changes.

If you use AntiHack you will need to add the addaction for the halo jump to your white-list. The addaction is bis_fnc_halo_action

There is another tutorial that shows how to white-list addactions as well.

And that should be it. Now repack your folders into pbo format and upload to your server. ;)
 
Also i forgot to add credits in but i did mention this is not my idea just a modified version to make it work on Tavi 2.0
All credits go to Unkinhead, Hangender, VentZero, and TorturedChunk.
THANKS A BUNCH GUYS YOU ROCK!!!!:D
 
i have also added the functions to move your character during halo spawn and to move your chute once it deploys. The actions i have listed are:
Code:
bis_fnc_halo_para_vel,bis_fnc_halo_para_velLimit,bis_fnc_halo_para_velAdd,bis_fnc_halo_para_dir,
                bis_fnc_halo_para_dirLimit,bis_fnc_halo_para_dirAdd,bis_fnc_halo_para_keydown,bis_fnc_halo_para_loop,
                bis_fnc_halo_para_keydown_eh,bis_fnc_halo_para_mousemoving_eh,bis_fnc_halo_para_mouseholding_eh,bis_fnc_halo_action

Actually these do not seem to allow players that are not admin or jr. admin to control halo fall or chute. The halo_actions one seems to stop players form being killed upon opening the chute however.
 
i have been testing extensively and discovered a few thigns i was able to cleanup. This tutorial WILL get it working but i need to update it to work alongside sarge ai cleanup. Those newbs cant use my ai helis lol.
 
Back
Top