Is there a way to detect if the player is standing in water?

Post » Sat Nov 17, 2012 3:42 am

It would be mega useful for me if there was some easy way to detect if the player is standing in water.
One of my original thoughts on the topic would be to test to hear what walking sounds you make when moving. If those sounds are water splashing then return true. I don't know if this is even remotely possible though...

Also, a different question: Is there an easy way to detect if the player is swimming in water?

Anyone know?
User avatar
+++CAZZY
 
Posts: 3403
Joined: Wed Sep 13, 2006 1:04 pm

Post » Sat Nov 17, 2012 7:50 am

It would be mega useful for me if there was some easy way to detect if the player is standing in water.
[...]
Is there an easy way to detect if the player is swimming in water?

These are two different questions: which do you need to know? And how quickly do you need to be able to tell?
User avatar
Emilie M
 
Posts: 3419
Joined: Fri Mar 16, 2007 9:08 am

Post » Sat Nov 17, 2012 9:10 am

Both questions could be easily useful for me. Though standing in water would be most ideal.

Once every 1-2 seconds.
User avatar
.X chantelle .x Smith
 
Posts: 3399
Joined: Thu Jun 15, 2006 6:25 pm

Post » Sat Nov 17, 2012 11:27 am

I see nothing under the scripting reference, but found http://www.creationkit.com/IsSwimming. If you want to know if the player is simply standing in water and not swimming, I don't think there is an easy way to do so.
User avatar
Jason Wolf
 
Posts: 3390
Joined: Sun Jun 17, 2007 7:30 am

Post » Sat Nov 17, 2012 4:47 pm

Ill have to check to see if IsSwimming actually works. If it does I suppose I could just use that.
User avatar
Pat RiMsey
 
Posts: 3306
Joined: Fri Oct 19, 2007 1:22 am

Post » Sat Nov 17, 2012 5:13 am

Swimming is fairly easy, you can http://www.creationkit.com/Passing_Conditions_to_Papyrus to have a magic effect start and stop when the IsSwimming condition is true. That "magic effect" wouldn't actually have to be magic, it could just do whatever you need done.

I believe you can also register for updates with an interval of a second or two, and test whether PlayerREF.GetAnimationVariableInt("iState") == 63

Standing in water would be trickier. You could perhaps have a tiny invisible actor following the player closely, and use one of the above techniques to test if that tiny actor was swimming.
User avatar
Veronica Martinez
 
Posts: 3498
Joined: Tue Jun 20, 2006 9:43 am

Post » Sat Nov 17, 2012 3:25 pm

I have a trick in my Eat and sleep mod which detects if the player is near objects that could be in water. It's not at the best method because the Water objects in the Form List I check against are huge - i.e. checking the player's distance from their meshes' 0,0,0 is not a good check. But it works (i.e. the player replenishes his Hydration) when the player nears one of those objects. E.g. while crossing the bridge at Riverwood, my auto-drink feature kicks in.
User avatar
Bedford White
 
Posts: 3307
Joined: Tue Jun 12, 2007 2:09 am

Post » Sat Nov 17, 2012 9:54 am

I was thinking about this one a bit and I am still not quite sure how I want to solve the problem. Ill have to test and see if IsSwimming actually works. If it does that might be what I use for this.
User avatar
Flesh Tunnel
 
Posts: 3409
Joined: Mon Sep 18, 2006 7:43 pm


Return to V - Skyrim