[FREE] Dynamic Water / Tsunami

tofu-dynamic-water

This is a free educational resource that demonstrates how to load and manipulate water at runtime within FiveM. This means you no longer need to modify gta5.meta or restart your server to see changes.

Included are commands to load, reset, and flood the map within GTA5.

Included in the files are suggestions that could be made to further enhance the experience, such as changing the weather to rain/thunder, disabling artificial lights, and changing the WaveQuad amplitude for larger waves and swell.

The code in this repository represents the same “flooding” / “tsunami” which was demonstrated by Nikez a few months back, and is probably the same approach used for flooding the sewers / tunnels in NoPixel 4.0

13 Likes

nice i will edit this so i have random times where tsunami starts and it rises

1 Like

this would be insane to combine with those server restarts alerts, wow. Good stuff :slight_smile:

1 Like

DW, Iv reached out too him and wanna work on something to do this. As i already have an emailing alert system script already and think this would be great addition too the script! Tsunami Restart

3 Likes

wooow nice work

so this work on real time yeah so every time we dont need restart right ?

You just run the commands when needed :sunglasses:

1 Like

Made an Server Sided one for my Server, first script that even Worked thanks!

2 Likes

One Question I have, I have the problem, that some of the Water gets Invisible, if I am near it, do you know how to fix it?

There’s no easy way to handle this other than trial and error for each of the WaterQuads. Take note that if you only have a single WaterQuad defined in the xml file, the game engine will slice that up in to smaller chunks.

You can see how many WaterQuads are active with the following:

local waterQuadCount = GetWaterQuadCount()
print(waterQuadCount)

For each of the WaterQuads that are having rendering issues, you can try modifying the Type attribute to one of these values.

  • 0
  • 90
  • 180
  • 270

Example:

  <WaterQuads>
    <Item>
      ...
      <Type value="270" />
    </Item>
  </WaterQuads>
1 Like

When I spawn, in the character menu, my PED is swimming :slight_smile:
Hope someone utilize this soon and shares a working script :smiley:
This is so freaking cool, love it!

wanna provide the server sided code ?

If I get the allowence from the Official Script Maker then yes, but it seems to be a bit buggy

1 Like

For some reason it will not let me swim in the water? is this an intentional feature or is there something I’m doing wrong and is there any way to fix/change it.

I’ve noticied this happening occasionally as well (for players & peds), from what I’ve seen it seems to be a problem with the game engine failing to detect that you are underwater. Sometimes getting in and out of a vehicle can trigger the engine to correctly detect that you are underwater.

Some ideas which may help that you could try:

  • Use smaller WaterQuads, don’t cover the entire map.
  • Reduce the rate at which the WaterQuad height changes.
  • Compare the peds z with the height of the WaterQuads z, if lower try setting SetPedMaxTimeInWater(ped, duration) ??

I’ve just pushed a quick fix to force peds & players to be in a swimming state if they are within a WaterQuad, and their Z value is less than that of the WaterQuad … aka they are underwater. It’s not the nicest of solutions but it does work.

You can see the changes in this commit.

1 Like

Updated Tsunami Restart script, I will be chasing up the ped/local swimming issue shortly but as of now its all functions fine.

how do i get the file for this to put it into our server on FiveM

Can grab it from this link mate