GROUND_WATER_HEIGHT

GROUND_WATER_HEIGHT

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
VonGratz
Posts: 471
Joined: 03 May 2005, 05:25

GROUND_WATER_HEIGHT

Post by VonGratz »

Hi!
What means exactly the application of GROUND_WATER_HEIGHT in BOS script?
Is it about the height of the unit relation with interface enviroments water/ land below Y-zero coordinate?
SPRING dont read the old TA scripts that show bubbles when a thing emerges like this below.
MotionControl()
{
WHILE ( TRUE )
{
IF (bMoving )
{
IF (bLevel_0 == 3 )
{
EMIT-SFX SFXTYPE_SUBBUBBLES FROM emit1;
EMIT-SFX SFXTYPE_SUBBUBBLES FROM emit2;
EMIT-SFX SFXTYPE_SUBBUBBLES FROM emit3;
EMIT-SFX SFXTYPE_SUBBUBBLES FROM emit4;
}
}
SLEEP <150>;
}
}
Can I utilize in BOS script something like..
IF GROUND_WATER_HEIGHT "would be negative"

{
EMIT-SFX SFXTYPE_SUBBUBBLES FROM emit1;
EMIT-SFX SFXTYPE_SUBBUBBLES FROM emit2;
EMIT-SFX SFXTYPE_SUBBUBBLES FROM emit3;
EMIT-SFX SFXTYPE_SUBBUBBLES FROM emit4;
}
....for seaplanes and other things effect???
VonGratz :wink:
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Post by yuritch »

As far as I know GROUND_WATER_HEIGHT returns positive values when the unit is on land (or in the air) and negative values if the unit is in water.
I'm not sure what will happen when this is called for a plane that flies over water, though. It should work reliably for ground units.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

GROUND_HEIGHT reports the distance between the piece's origin and the ground. On water it's always 0.

I can only assume that GROUND_WATER_HEIGHT does the same but ignoring the water. Or it reports the distance to the ground when over water but will be 0 when the unit is not in/on water, i.e. the opposite of the above.

edit:
Oops, I guess yuritch got it right.
Post Reply

Return to “Engine”