Jump to content
csk222

Altimeter Script - Only Detected When Inside Vehicle

Recommended Posts

I have a simple altimeter script that I would like to use when parachuting out of helicopters. It works great when I'm in the helicopter and once my parachute is deployed, but I would like it to also display when I am free falling to know when to open my parachute.

---

show_altimeter script:

if !(isNull player) then {

private ["_soldier","_altitude","_text","_dsp"];

_soldier = _this select 0;

while {(!(vehicle player == player))} do {

sleep 1;

_altitude = (getPosATL _soldier) select 2;

_text = format["%1 %2","<t size='1'>" + "Altitude:" + "</t>" + "<br />",_altitude];

_dsp = [_text,0.01,0.01,10,-1,0,90]spawn bis_fnc_dynamicText;

};

terminate nulsalt;

};

---

while {(!(vehicle player == player))} do {

I believe that this is the line that needs to be changed but I don't know what replaces that.

Share this post


Link to post
Share on other sites

Tweaked. I'd personally do it a different way than dynamic text. My2C.

if (isDedicated) exitWith {};

private ["_soldier","_altitude","_text","_dsp"];
_soldier = _this select 0;

while {!isTouchingGround _soldier} do {
   sleep 1;
   _altitude = (getPosATL _soldier) select 2;
   _text = format ["%1 %2","<t size='1'>" + "Altitude:" + "</t>" + "<br />", _altitude];
   _dsp = [_text, 0.01, 0.01, 0] call bis_fnc_dynamicText;
};  

Edited by Iceman77

Share this post


Link to post
Share on other sites

I wrote you a toggleable altimeter. You can simply add or merge the contents of the example mission into your own. Let me know if there are issues. Cheers.

new_logo_shmodel-vfl9sSGTp.png

Edited by Iceman77

Share this post


Link to post
Share on other sites

Thank you very much it works great. Is there any way to reposition the watch over to the left or right? Once you deploy your chute the watch stays permanently on and blocks the center of the screen.

Share this post


Link to post
Share on other sites

No way to reposition it on the fly as is. You can only toggle the watch off and on atm.

Share this post


Link to post
Share on other sites

I don't really need to reposition it on the fly. If it is in a fixed location of the screen i.e. upper right corner under the ammo count would be a good spot.

Note:

Other small but not necessary suggestion, could the notification be in a hint instead or could it be removed altogether?

Thank you, I very much appreciate the help and work you've done.

---

Update: I made the following simple changes. The repositioning on the screen is beyond me.

[] spawn {
if (isDedicated) exitWith {};
waitUntil {!isNull player && {time > 0}};
toggleOn = 0;

_xIDx = player addAction ["Toggle Altimeter", {
	if (toggleOn == 0) then {
		//player sideChat "Altimeter Opened"; <<<---Not needed, It's obvious the watch is on screen
		toggleOn = 1;
		_xAltHudx = [player] call ICE_FNC_iceAltHUD;
	} else {
		//player sideChat "Altimeter Closed"; <<<--- Not needed
		toggleOn = 0;
		("ICE_Alt_Layer" call BIS_fnc_rscLayer) cutText ["","PLAIN"];
	};
}, [], 6, false, true, "", "getposATL _target select 2 >= 2"];

_xEHx = player addEventHandler ["respawn", {
	toggleOn = 0;
	_xIDx = player addAction ["Toggle Altimeter", {
		if (toggleOn == 0) then {
			//player sideChat "Altimeter Opened"; //<<<--- Not needed
			toggleOn = 1;
			_xAltHudx = [player] call ICE_FNC_iceAltHUD;
		} else {
			//player sideChat "Altimeter Closed"; //<<<--- Not needed
			toggleOn = 0;
			("ICE_Alt_Layer" call BIS_fnc_rscLayer) cutText ["","PLAIN"];
		};
	}, [], 6, false, true, "", "getposATL _target select 2 >= 2"];
}];

while {true} do {
	waitUntil {getposATL player select 2 > 10}; //<<<--- I raised it because when you walk up on to a high rock, it would trigger the altimeter enabled message
		Hint "Altimeter Enabled";

	waitUntil {getposATL player select 2 <= 2};
		Hint "Altimeter Disabled";
};
};

Edited by csk222

Share this post


Link to post
Share on other sites
//<<<--- I raised it because when you walk up on to a high rock, it would trigger the altimeter enabled message

Hmmm. Don't huge rocks count as terrain BI?! Ahh well.

Share this post


Link to post
Share on other sites

I changed the position of the altimeter to the upper left corner.

 class Controls
{

class HUD_alt_PIC : IceBasePictureHUD
{
text = "images\watch.paa";
idc = -1;
x = 0.1 * safezoneW + safezoneX;
y = 0.1 * safezoneH + safezoneY;
w = 0.25 * safezoneW;
h = 0.25 * safezoneH;
};

class HUD_Alt : IceBaseTextHUD
{
text = "";
idc = 720500;
sizeEx = "0.03 / (getResolution select 5)";
x = 0.190 * safezoneW + safezoneX;
y = 0.205 * safezoneH + safezoneY;
w = 0.06 * safezoneW;
h = 0.03 * safezoneH;
};

class HUD_time : IceBaseTextHUD
{
text = "";
idc = 720501;
sizeEx = "0.015 / (getResolution select 5)";
x = 0.2 * safezoneW + safezoneX;
y = 0.238 * safezoneH + safezoneY;
w = 0.04 * safezoneW;
h = 0.02 * safezoneH;
};



Once again thank you very much for this. Here are some images.

http://steamcommunity.com/sharedfiles/filedetails/?id=318044926

593BC3C6EAA071944AB525AD10E933483F2BDC49
http://steamcommunity.com/sharedfiles/filedetails/?id=318044913

8ED92E8275FC0852714D552340D4D44A25714104
http://steamcommunity.com/sharedfiles/filedetails/?id=318044905

3A76E54E3BC2E9A31CF4B451A4F957C4B5659D70
http://steamcommunity.com/sharedfiles/filedetails/?id=318044895

72176BD1140E495B7C20C5A92DF1F1A5D8CAB0C1

Edited by csk222

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×