Jump to content
Sign in to follow this  
Boo

ArmA 3 Diving Depth Gauge

Recommended Posts

Hey guys, i was just wondering is there any kind of script where i could add depth gauge to my screen when diving, this would be really great so i could know wich depth am i on. This would add also a littlebit of realism also into the game, as reallife divers has depth gauge.

Ohh and also. Can i run out of oxygen while diving?

Edited by Boo
Wanted to add some one thing more.

Share this post


Link to post
Share on other sites

For your main question, you could probably use this command here to get the height - in your case depth - above/below the water level. And then have it display somewhere. For your second question : If you don't have a rebreather you can run out of Oxygen.

Share this post


Link to post
Share on other sites
For your main question, you could probably use this command here to get the height - in your case depth - above/below the water level. And then have it display somewhere. For your second question : If you don't have a rebreather you can run out of Oxygen.

How can i make it display it? Sry im newbie in scripting so i dont know how to make it display somewhere, so if you can give me the whole script (pos = getPosASLW diver;) and then how to display it

Share this post


Link to post
Share on other sites

Ok, copy and paste the following in the init line of the diver :

code = [] spawn {sleep 1;while {true} do {sleep 2;hint format["position under sea level: %1",(getPosASL player) select 2];};};

Share this post


Link to post
Share on other sites
For your main question, you could probably use this command here to get the height - in your case depth - above/below the water level. And then have it display somewhere. For your second question : If you don't have a rebreather you can run out of Oxygen.
Ok, copy and paste the following in the init line of the diver :

code = [] spawn {sleep 1;while {true} do {sleep 2;hint format["position under sea level: %1",(getPosASL player) select 2];};};

I love you guys! Thx so much!

Share this post


Link to post
Share on other sites

How would I be able to expand on this to have a trigger that will if the diver goes below 30 meters an alarm sounds, and then if they don't take corrective action the health starts to deteriorate for every meter the get deeper

Share this post


Link to post
Share on other sites

_nul = [this,-30] execVM "depth.sqf"

_unit = _this select 0;
_maxdepth = _this select 1;

while {(getPosASL _unit) select 2 < -1} do 
{
sleep 1; 
hint format ["Current Depth: %1", (getPosASL _unit) select 2];
sleep 1;
if ((getPosASL _unit) select 2 < _maxdepth) then {hintsilent parseText format ["<t color='#ff0000'>TOO DEEP, SURFACE.</t>"]};
};

hint "";

Now when you exit the water it wont show your height anymore and if you go below your max depth it will tell you. You can use sethit or setdamage commands to add damage when the diver goes below -30.

Edited by cobra4v320

Share this post


Link to post
Share on other sites

@Cobra4v320 Mate your are the best! Many thanks for this, how would I add the set damage as I want to be able to simulate the bends @ 32 meters and then if they dive down further then they loose vision and die (based on time) and if they stay at constant 32 meters they will black out (possible to add first aid ?)

Share this post


Link to post
Share on other sites

Here you go :D

/*
Script: depthgauge.sqf

Author:  Cobra4v320

Description:
Will tell you your exact depth, if you go below -30 it could be fatal.

Parameter(s):
_this select 0: this is the diver)
_this select 1: this is the max depth the diver can go.

Example(s):
null = [this,-30] execVM "depth.sqf"
*/

if !(isServer) exitWith {};
waitUntil {!isNull player};

_unit = _this select 0;
_maxdepth = if (count _this > 1) then {_this select 1} else {-30};

while {(getPosASLW _unit) select 2 < -1} do 
{
sleep 1; 
hintsilent format ["Current Depth: %1", (getPosASLW _unit) select 2];
if ((getPosASLW _unit) select 2 < _maxdepth) then 
{
	while {(getPosASLW _unit) select 2 < _maxdepth} do
	{
		sleep 1;
		hintsilent parseText format ["<t color='#ff0000'>TOO DEEP, SURFACE.</t>"];
		_unit setDamage (damage _unit) + 0.1;
	};
};
};

hint "";

if (true) exitWith {};

Edited by cobra4v320

Share this post


Link to post
Share on other sites

With this script you can get your depth and current oxygen level (kind of pointless right now with a re-breather), if you go below 30 meters you start to get the bends and your diver will slowly become damaged over time. One thing I would like to add is the sound effects and the screen blacking out like when a non-diver is underwater and starts to lose oxygen, does anyone know how to do this or can point me in the right direction?

/*
Script: depthGauge.sqf

Author:  Cobra4v320

Description:
Will tell you your depth and oxygen level, if you go below -30 meters it could be fatal.

Parameter(s):
_this select 0: this is the diver
_this select 1: this is the max depth the diver can go.

Example(s):
null = [this,-30] execVM "depthGauge.sqf"
null = [this] execVM "depthGauge.sqf"
*/

if !(isServer) exitWith {};
waitUntil {!isNull player && isPlayer player};

_diver = _this select 0;
_maxdepth = if (count _this > 1) then {_this select 1} else {-30};

if (!surfaceIsWater position _diver) then
{
waitUntil {sleep 1; surfaceIsWater position _diver};
};

while {surfaceIsWater position _diver} do 
{
sleep 1; 
hintsilent format ["Current Depth: %1 \n Oxygen Remaining: %2", (getPosASLW _diver) select 2, getOxygenRemaining _diver];

if ((getPosASLW _diver) select 2 < _maxdepth) then 
{
	while {(getPosASLW _diver) select 2 < _maxdepth} do
	{
		sleep 1;
		hintsilent parseText format ["<t color='#ff0000'>TOO DEEP, SURFACE to 30 Meters.</t>"];
		_diver setDamage (damage _diver) + 0.01;
	};
};

if (!surfaceIsWater position _diver) then
{
	hintsilent "";
	waitUntil {sleep 1; surfaceIsWater position _diver};
};
};

hintsilent "";

if (true) exithWith {};

Edited by cobra4v320

Share this post


Link to post
Share on other sites

Thanks Tajin, played with that a little bit, I will have to experiment some more. Made some changes, the hints will only show for the diver using the script and not every player, also added a heartbeat sound.

/*
Script: depthGauge.sqf

Author:  Cobra4v320

Description:
Will tell you your depth and oxygen level, if you go below -30 meters it could be fatal.

Parameter(s):
_this select 0: this is the diver
_this select 1: this is the max depth the diver can go.

Example(s):
null = [this,-30] execVM "depthGauge.sqf"
null = [this] execVM "depthGauge.sqf"
*/

if !(isServer) exitWith {};
waitUntil {!isNull player && isPlayer player};

_diver = _this select 0;
_maxdepth = if (count _this > 1) then {_this select 1} else {-30};

if (!surfaceIsWater position _diver) then
{
waitUntil {sleep 1; surfaceIsWater position _diver};
};

while {surfaceIsWater position _diver} do 
{
sleep 1; 
if (player == _diver) then {hintsilent format ["Current Depth: %1 \n Oxygen Remaining: %2", (getPosASLW _diver) select 2, getOxygenRemaining _diver]};

if ((getPosASLW _diver) select 2 < _maxdepth) then 
{
	while {(getPosASLW _diver) select 2 < _maxdepth} do
	{
		if (player == _diver) then 
		{
			hintsilent parseText format ["<t color='#ff0000'>Too Deep, Surface to 30 Meters.</t>"];
			_diver setDamage (damage _diver) + 0.05;
			playSound "heartbeat";
			sleep 7; //allows sound to play through without repeating over itself
		};
	};
};

if (!surfaceIsWater position _diver) then
{
	hintsilent "";
	waitUntil {sleep 1; surfaceIsWater position _diver};
};
};

hintsilent "";

if (true) exitWith {};

Edited by cobra4v320

Share this post


Link to post
Share on other sites

@cobra4v320

Mate I hope BIS take this on board ! Cant thank you enough this,

Hopefully BIS will expand on the whole rebreather / diving thing to include the old school open ciruit system as well as mixed gases etc

Share this post


Link to post
Share on other sites

Like this?

http://oi50.tinypic.com/1411j0p.jpg (1465 kB)

Something I was working on.

Planning to change the - to an actual 'positive' depth and add a fancy icon with oxygen levels and add pressure effects :D

*RAGE* Why won't my images show on these forums?!

Edited by Tonic-_-

Share this post


Link to post
Share on other sites

Thats pretty cool and I was thinking about doing the same thing. I was going to use an Oris Dive watch. Cant wait to try this out when you release it.

---------- Post added at 01:42 ---------- Previous post was at 01:31 ----------

How about this one? Navy Dive Watch

http://ep.yimg.com/ca/I/yhst-13255692613510_2249_204613160

Share this post


Link to post
Share on other sites
Thats pretty cool and I was thinking about doing the same thing. I was going to use an Oris Dive watch. Cant wait to try this out when you release it.

---------- Post added at 01:42 ---------- Previous post was at 01:31 ----------

How about this one? Navy Dive Watch

http://ep.yimg.com/ca/I/yhst-13255692613510_2249_204613160

o.O

I'm no diving expert and I am already completely lost by all the numbers -_-

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
Sign in to follow this  

×