Author Topic: Negative water height  (Read 3548 times)

Without the need to use console commands or mission editor.
But why do this in the first place? For effects like this:

Would be a nice addition.

Also a less needed but welcome ability would be to have multiple water layers, to make it look like there are clouds above those buildings but still below you.


With a few configurations it is possible.

The slider in the env gui for water height has a range, 0 to 500 I think. Would it be possible for a script to change the range to -500 to 500?


The slider in the env gui for water height has a range, 0 to 500 I think. Would it be possible for a script to change the range to -500 to 500?
Certainly, if you trace what the function and args are for changing water height. I'll look into it once i get home

oh hey
Quote
Entering serverCmdEnvGui_SetVar(19787, WaterHeight, 14.871795)
waterheight is probably a global variable, and the last numbers in the function are probably the height
19787 looks like an object id
no loving clue how to change water height with that lol
« Last Edit: September 16, 2014, 09:20:15 PM by -Setro- »

19787 looks like an object id
it's a serverCmd, the first argument is always the client
waterheight is the name of the value it's changing, the third is the height

it's a serverCmd, the first argument is always the client
Well it's not like he's wrong, that'd be the client's object ID in this case.

$waterheight = 1; is not working
am i doing something terribly wrong

Are you sure it's actually a global variable and not just a normal variable for the command to determine what it's changing? Another fact of the matter is there may be an if(%number<0)%number=0; in the command. Wouldn't it be easier to raise the ground and change the build load offset?

Are you sure it's actually a global variable and not just a normal variable for the command to determine what it's changing?
It's the latter
The only global variable for water height is $Water::Height and changing it doesn't do anything

The correct answer is waterPlane.setTransform("0 0 " @ %height); followed by waterPlane.sendUpdate();
That only changes the visible water though, there's another object for the physical zone

Code: [Select]
$EnvGuiServer::WaterHeight = mClampF(%value, 0, 100);

    if (isObject(WaterPlane))
    {
      %pos = getWords(GroundPlane.getTransform(), 0, 2);
      %pos = vectorAdd(%pos, "0 0" SPC $EnvGuiServer::WaterHeight);

      WaterPlane.setTransform(%pos SPC "0 0 1 0");
      WaterPlane.sendUpdate();

      updateWaterFog();

      if (isObject(WaterZone))
      {
        %pos = vectorSub(%pos, "0 0 99.5");
        %pos = vectorSub(%pos, "500000 -500000 0");
        WaterZone.setTransform(%pos SPC "0 0 1 0");
      }
    }

from the "WaterHeight" case from some of port's code

Now, in theory, you can just take that code, remove the mClampF call, and throw it in a packaged servercmdenvgui_setvar, inside an if that checks if the second argument is WaterHeight. That, paired with a client mod that's little more than EnvGui_WaterHeight.range = "-100 100"; should give you what you want
« Last Edit: September 16, 2014, 11:46:47 PM by Headcrab Zombie »

Wait what effect is it for? The blue tint on the edge of the fog?

To make it look like you are miles above the town or whatever. Like that old skyhigh map.

To make it look like you are miles above the town or whatever. Like that old skyhigh map.
Oh. Well to me it looks like you're standing right on it :/