Author Topic: Negative water height  (Read 3938 times)

Oh. Well to me it looks like you're standing right on it :/
Just a weird angle I took the pic.

Why just water?

Id like to see this applicable to grounds too.

Wait hold on guys just an idea.  Anyone remember these?  Is it possible to see this kind of thing to distort only the water layer, set far below an invisible ground layer so that when moving, it looks like a planet is rotating beneath.

Nope. Shaders are client-side, so clients would have to alter their shaders, then it'd just forget with people when they joined a different server.

Can shaders be toggled in-game from one type to another (while on main menu)?

Can be done mid-game if you wish.

okay i found this console command
SliderDefaultFOV.range = "20 180";
i look into it more and the water height slider is called EnvGui_WaterHeight with the range of 0 to 100
so theoretically if i were to make that console command
EnvGui_WaterHeight.range = "-100 100";
it should do what i want with a simple console command

testing...

EDIT: the water does not seem to want to go below the ground when using the gui, but it did in fact modify the slider
« Last Edit: September 18, 2014, 04:56:56 AM by Crispy_ »

Because there's also a serverside check
You need to use this too

$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

I only slightly understand that. But if nobody else is gonna do that, I'll try. Sigh.

I tried setting the water to a negative height and it did not work
Code: [Select]
package servercmdenvgui_setvar
{
  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");
    }
  }
};

Try this
Untested

Code: [Select]
package negativeWaterHeight
{
function serverCmdEnvGui_SetVar(%client,%var,%val)
{
if(%var $= "WaterHeight")
{
$EnvGuiServer::WaterHeight = mClampF(%value, -100, 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");
}
}
}
else
Parent::serverCmdEnvGui_SetVar(%client,%var,%val)
}
};
ActivatePackage(negativeWaterHeight);

Didn't seem to work. I have it in a Server_NegativeWater.zip with a description.txt and that code in a server.cs. Could I be packaging it wrong?

Oh I made a couple dumb mistakes: a missing semicolon and a mismatched variable name


I might as well just package it up and release it

Try this http://forum.blockland.us/index.php?topic=265761.msg7875054#msg7875054
« Last Edit: September 18, 2014, 07:34:20 PM by Headcrab Zombie »

(i used the code itself)

Holy crap, it worked!

I'll see if I can brew up a simple client mod that basically does the EnvGui_WaterHeight.range = "-100 100"; command on startup but hey, it seems the game is letting me make the water negative via the gui! Thank you so much.

I'll see if I can brew up a simple client mod that basically does the EnvGui_WaterHeight.range = "-100 100"; command on startup but hey, it seems the game is letting me make the water negative via the gui! Thank you so much.
The download link I gave already does that