Drinking water

Post » Sat May 28, 2011 6:45 am

Hey everyone, I'm hoping I can get some help. In Fallout 3, as you probably know, you can drink water on the ground (from a puddle, river, lake, etc.) and gain health from it. You can't do that in Oblivion, and being so used to Fallout 3, it's really irritating to me. How would I go about making a mod to enable the player to do this in Oblivion? I looked around and couldn't find an existing mod for it, so I have to make it. But I'm very inexperienced at scripting, though I have experience with the Construction Set. Tell me, is this even possible? If so, could someone please guide me in the right direction?

Thanks a lot!
User avatar
Stefanny Cardona
 
Posts: 3352
Joined: Tue Dec 19, 2006 8:08 pm

Post » Fri May 27, 2011 7:48 pm

I have two ideas:

  • Use http://cs.elderscrolls.com/constwiki/index.php/IsUnderWater to determine if the player is standing in water. An actor's position is at its feet, so I figure that makes them underwater as soon as their feet are. If that doesn't work you could drag an object along with the player (possibly below his/her feet) and test if that's underwater.
  • Use http://cs.elderscrolls.com/constwiki/index.php/GetCrosshairRef, and http://cs.elderscrolls.com/constwiki/index.php/GetObjectType. Maybe you'll get a 66 back (a WaterForm), but I'd first try the idea above.


For both you'll need a GameMode script (a script that runs constantly). Here's an example:

ScriptName blablablaBegin GameMode  if player.IsUnderWater ;; player is standing in water    if player.getAngle x > 80 ;; player is looking at its feet      if onControlDown 5 ;; activate key is pressed        ;; do whatever you want when activating water      endif    endif  endifEnd


It's probably better to hover an activator at the player's feet, that way you see the activation text. For this you'll need a custom mesh; something with non-collideable collision (like plants).

Note that you'll have to start the editor with OBSE if you want to use OBSE functions (you can't do this without).
User avatar
Jhenna lee Lizama
 
Posts: 3344
Joined: Wed Jun 06, 2007 5:39 am


Return to IV - Oblivion