Jump to content

IsSwimming option in FNV?


Greslin

Recommended Posts

I haven't done much FNV modding over the last year or so, but am now dusting off my skills a bit to try and update one of my mods. Basically I seem to have an issue with player swimming, and am trying to find a solid, clean method of determining whether the player is currently underwater.

 

According to GECK docs, this was fairly easy in FO3. Now IsSwimming doesn't work for the player, the landscape is littered with placeable water that precludes the option of simply checking the player's Z position, and there doesn't seem to be another way to do it in FNV.

 

The other options I've considered:

 

1. Checking for playing state of the swimming animation. Unfortunately, not finding any reference to that specific anim on GECK docs, so right now I don't even know the anim's name or if this is possible.

 

2. Something connected to the water breathing effect or rebreather? Is there a clean way to detect if the player is breathing underwater? (The issue I have only really matters if the PC is underwater for any length of time.)

 

3. I've thought about simply hardcoding to detect whether the current player position is in Lake Mead or Lake Vegas, but that's an ugly ugly hack idea. No way.

 

4. Somehow using a custom NPC actor (possibly a very small, invisible one) positioned near the player to detect IsSwimming status, since IsSwimming still apparently applies to NPCs. That just seems to be a giant pain, not to mention a resource drag, as I would have to continually enable and disable the actor fairly regularly to provide enough ping quality to be useful.

 

There has GOT to be some option here for cleanly detecting whether the player is swimming or otherwise underwater. Has anyone managed to tackle this one, or am I basically DOA here?

 

Link to comment
Share on other sites

GetPos Z would be hard to do because the water above the Hoover Dam is 2600 and below the dam is -2300.

You can do cells though, for instance Ultra-Luxe bath:

if player.getincell ULBath == 1 && GetPos Z < 1172

But trying to detect all swimming might be a tough one.

The rebreather use can be detected with HasMagicEffect VMS15WaterBreathing.

Link to comment
Share on other sites

The Item 3 method is actually used in the vanilla game - not for swimming, but other things - and in just two dimensions. An ugly hack, perhaps, but at least there is a precedent for it :)

Player.GetAV waterbreathing returning > 0 will detect if player is underwater for a extended time because that's the only way to be able to do that.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...