Animated,scrolling water that pushes player
This tutorial and prefab covers how to make animated water and scroll the texture and last move the player in right direction as it would in real life.
this prefab is made in little scale just to explain how it works.
Here is the prefab, extract it in etmain of your mapping directory.
add liquids2 to your shaderlist.txt
Beware that the water texture I’ve used is only tileable one way, so you will have to fit it to your top of water brush.
Now to explain the water shader and what you may alter:
qer_editorimage textures/liquids/water1.tga //path to maintexture
qer_trans .8 // makes the water 0.2 transparent if you lower it to 0.5 it will be 50%
cull disable // wont see texture on both sides
nofog //no fog on surface
surfaceparm nomarks//as it is water nothing will leave permanent mark on it
surfaceparm nonsolid // nonsolid as it water
surfaceparm trans // so you can see through
surfaceparm water // self explaining
//map $lightmap won use on this texture, doesnt look good
animMap 5 textures/liquids2/water1.tga textures/liquids/water2.tga textures/liquids2/water3.tga textures/liquids2/water4.tga textures/liquids2/water5.tga textures/liquids2/water6.tga textures/liquids2/water7.tga textures/liquids2/water8.tga textures/liquids2/water7.tga textures/liquids2/water6.tga textures/liquids2/water5.tga textures/liquids2/water4.tga textures/liquids2/water3.tga textures/liquids2/water2.tga //the line with how the images will animate, you can use up to 8 images and the animp 5 sets speed 5 on animation
blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA
tcmod scroll 0.05 0 //move water slowly,raise for faster
now the prefab itself.
If you open it in gtk you will see the water in the middle, if you select the water and press “H” you will notice there are a trigger-multiple underneath targeting an target-push. and if you select the target push entity and press “N” you will see that angle is set to work in the right direction. You may ofcourse alter this in your map the way you need it to push.
The prefab really explains itself.
Best regards Thunder