OceanLevel visual update...

Hi everyone! Im new, and too lame :D

And sorry for my english...

Maybe whoever can help me.

If i trying set oceanlevel, it setted, but not visual updated... any way for update this???

WaterSystem.OceanLevel = 3.0f; 
// or
ConVar.Env.oceanlevel = 3.0f; 

 

You can run it as a server command.  This works:

rust.RunServerCommand("oceanlevel 5");

Zugzwang

You can run it as a server command.  This works:

rust.RunServerCommand("oceanlevel 5");

I know that, but it this is not suitable for me. 

It gets the job done.  I'm not sure if there is any other way to do it.  I'm curious why it isn't suitable for your needs.  You could just put it in place of your other lines of code that aren't working.

Zugzwang

It gets the job done.  I'm not sure if there is any other way to do it.  I'm curious why it isn't suitable for your needs.  You could just put it in place of your other lines of code that aren't working.

Example, for smooth change ocean level you need change it very often. And it make flood in console and log. Anyway... I'm examine how it work... For that i need any method make visualy update. In class WaterSystem

  public static float OceanLevel
  {
    get => WaterSystem.oceanLevel;
    set
    {
      value = Mathf.Max(value, 0.0f);
      if (Mathf.Approximately(WaterSystem.oceanLevel, value))
        return;
      WaterSystem.oceanLevel = value;
      WaterSystem.UpdateOceanLevel();
    }
  }​
have WaterSystem.UpdateOceanLevel(); but it not visualy update... Maybe need use NetworkUpdate??? Any idea?

p.s. I think, use rust.RunServerCommand("oceanlevel 5"); absolutle wrong! It not directly call... You call one system, then it called other, etc...

I made a flood effect with a transition that was smooth and satisfying.  I was incrementing the water level by 0.018f each step, with steps happening every 0.06f seconds.  Using rust.RunServerCommand. 

Zugzwang

I made a flood effect with a transition that was smooth and satisfying.  I was incrementing the water level by 0.018f each step, with steps happening every 0.06f seconds.  Using rust.RunServerCommand. 

I don't say it impossible. I says, it wrong, many reason...

You should be able to track down what the server command does with a decompiler.

Zugzwang

You should be able to track down what the server command does with a decompiler.

It fun, because oceanlevel  call SetOveride = (Action<string>) (str => Env.oceanlevel = str.ToFloat()) and if i try

ConVar.Env.oceanlevel = 1f;
ocean level updated, but not visualy ))) player drowning on air )