detecting water

Posted By: Stansmedia

detecting water - 09/19/11 00:03

I was wondering if anybody could share their method for detecting if a player is within water and what you use (wmb? wed block?). The manual seems to be filled with obsolete calls.
Posted By: Superku

Re: detecting water - 09/19/11 00:25

A simple way would be to place regions in WED, call them "water" and use region_check("water",player.x,...).
Posted By: Stansmedia

Re: detecting water - 09/19/11 00:45

Thanks!
Posted By: JoGa

Re: detecting water - 09/19/11 02:46

another simply workaround would be:

Take a terrain or a flat modell and make it passable.
Code:
#define object_type skill30 // in skill30 is the type of entity stored

var obj_id_slippery_banana = 50;
var obj_id_water = 51;
var obj_id_lava = 52;



Now you can let your player trace at the ground.
If you want to have something like water, check if you is filled after the trace and check with "if(you.object_type == obj_id_water)" if it's water and now you can eg. emit some water-particles in the instructions of your if-query.
I don't know if its the best solution, but it works for me :-D (because my water is not as deep as the origin of the player, so he is always on top of it and find the watersurface with his gravity-trace)
© 2023 lite-C Forums