HALO Spawn Altimeter..

Hey guys.
I've been lurking here for a while and would like to thank everyone who has contributed .

A few of my players have asked about an altimeter for the HALO spawns. There are a few threads on the BI forums about it but I don't have the knowledge to implement the .fsm I found.

Long story short I threw these 2 together. I have created one that uses a simple titletext and one that uses the hint format. If anyone has a better way of doing this I am open to suggestions.

So onto that fun stuff..
I used this HALO spawn

http://opendayz.net/threads/working-halo-jump-new-re-spawn-only.10403/

Here is a short video I made showcasing the 2 varients.
Sorry about the quality, had a bunch running while recording.
The message in the center is the titletext version and the hint box top right is the hint version, for those who don't know the diference.


Correction* My original code was copied from an older .sqf file I had. The code indicated below is updated and accurate.

Here is the code for the titletext version.
Code:
sleep 5;
_myalt = getPos player select 2;
_myalt = round(_myalt);
//debug start
diag_log(format["ALTIMETER STARTED: %1m ", _myalt]);
 
while {(_myalt) > 0} do {
 
// Display my altitude text.
_myalt = getPos player select 2;
_myalt = round(_myalt);
 
titleText [("                                      ALTITUDE: " + str _myalt + "\n\n                                      Scroll ""mouse"" select Open Chute"), "PLAIN DOWN", 0.1];
 
};
//debug Stop
diag_log(format["ALTIMETER STOPPED: %1m ", _myalt]);


And here is the code for the Hint version.

EDIT #1 : hint parseText format should be hintSilent parseText format.
This will remove the repeating tone while the altimeter is active..
Code Updated....

Code:
sleep 5;
_myalt = (round(getPosATL player select 2));
//debug start
diag_log(format["ALTIMETER STARTED: %1m ", _myalt]);
 
while {(_myalt) >    0} do {
 
    hintSilent parseText format ["
    <t size='1.35' font='Bitstream' align='left' color='#FFBB00'>ALTIMETER: </t><br/>
    <t size='1.5' font='Bitstream' align='center' color='#DDDDDD'>---------------------------</t><br/>
    <t size='1.15' font='Bitstream' align='left' color='#FFBB00'>Current Altitude: </t><t size='1.25' font='Bitstream' align='right'>%1 m</t><br/>
    <t size='1.25' font='Bitstream' align='right'>(%2 ft)</t><br/>
    <t size='1.15' font='Bitstream' align='left' color='#FFBB00'>HEADING: </t><t size='1.25' font='Bitstream' align='right'>%3</t><br/>
    <t size='1.5' font='Bitstream' align='center' color='#DDDDDD'>---------------------------</t><br/>
    <t size='1.15' font='Bitstream' align='center'>Don't deploy too Low.</t><br/>
    <t size='1.15' font='Bitstream' align='center'>You will get hurt!</t><br/><br/>
    <t size='1.15' font='Bitstream' align='center'>%4</t><br/>
    <t size='1.15' font='Bitstream' align='left' color='#16DB57'>Humanity: </t><t size='1.15' font='Bitstream' align='right'>%5</t><br/>
    <t size='1.15' font='Bitstream' align='left' color='#16DB57'>FPS: </t><t size='1.15' font='Bitstream' align='right'>%6</t><br/>",
    (round(getPosATL player select 2)),
    (round(getPosATL player select 2) * 3.28),
    (round(getdir player)),
    (name player),
    (player getVariable['humanity', 0]),
    (round diag_fps)
    ];
_myalt = (round(getPosATL player select 2));
//Checks every loop. Damn thats a lot of math.....
};
//debug Stop
diag_log(format["ALTIMETER STOPPED: %1m ", _myalt]);
hint "";
 
//uncomment below for welcome messages displayed after altimeter completes, change path for your messages.
//_nul = [] execVM "msg\respawnmsg.sqf";


Create an sqf file and name it what ever you like, I used altimeter.sqf. Place the desired code from above into your newly created .sqf file. Then place your file into your mission pbo, located in your scritpts folder or wherver you want it..... Find where you inserted this code in your init.sqf

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;
        };
    };
};

And add below
Code:
 player spawn MC_BIS_halo_spawn;

to look like this,

Code:
player spawn MC_BIS_halo_spawn;
_nul = [] execVM "folder\altimeter.sqf";

Be sure to change the file path and file name accordingly...
These were made quick and dirty. Some tweaks may be required, it's up to you. Feel free to edit as needed, but remember where you saw it first. ;)

Wiked Bubble,
Levelgamers.net
 
Back
Top