Jump to content

"Reloadable" rebreather


Andyno

Recommended Posts

Sorry about the stupid title.

 

All I want to achieve is to make a rebreather with limited oxygen. As soon as player gets under water, the rebreather starts to drain oxygen from the oxygen supply. When the supply is depleted (for example after 1 minute), it starts to drain player's original oxygen reserves. Then the player should "reload" the rebreather with oxygen cannister to fully restore oxygen level.

 

Is something like this possible?

 

Any advices welcomed...

Link to comment
Share on other sites

  • Replies 95
  • Created
  • Last Reply

Top Posters In This Topic

Howdy Andy ... it's been awhile since I worked with the geck , but it seems like it should be possible.

Just not sure how nitty gritty difficult it would become to get it working smoothly with the way you mention you want it to render.

 

Is there some specific story content your writing that you want it to work like this for ? Or is it just a free style addition item ?

Because one question comes to mind for the free style ... what item is going to be used for the canister refill ? Because it seems like a lot of backing details , for what may eventually just be a game play nuisance.

 

But anyways ... the base effect "Water Breathing" is what seems to suspend the game setting functions of ...

"fActorSwimBreathBase" = 10.0 (default)

"fActorSwimBreathDamage" = 0.2 (default)

"fActorSwimBreathMult" = 0.5 (default)

 

And I guess the breath count down gets triggered when this function is true "If player.getpos Z < 10500"

Not sure if the NVSE "IsPlayerSwimming" would work better or "Getpos"

 

Check this geck wiki page ... http://geck.bethsoft.com/index.php?title=IsSwimming

 

So to just turn off the bypass effect you can insert something into the "VMS15RebreatherScript"

And not really sure the best way to do that without some further investigation.

 

But 2 other ways come to mind that might be simpler , albeit not render how you want it.

 

#1 would be to try and damage the item based on the swimming condition of the player , then make your canisters it's repair item. That way time under water is tracked simply by the rebreathers health condition.

 

#2 Have the rebreather when equipped adjust the game setting "fActorSwimBreathBase" so that the breath timer lasts a lot longer.

Although it would end up refilling when ever you resurfaced. But you could run a timer script for the player swimming condition , and store the value upon script effect end. But then that's starting to get complicated like the attempt to just rewrite the original script.

 

IDK ... shoot back your thoughts ... and I'll look into the details a bit more.

Link to comment
Share on other sites

Hi.

Yes, there is some kind of specific story content - the player needs to get through an underwater area, but according to long distance I realized the player simply can't make it. Actually, I'm trying to add this feature to my Fallout 3 mod I'm still working on. I used New Vegas forum only to simplify the situation, because there's no rebreather in Fallout 3.

 

The canister for refill is probably not a problem - I can simply retexture Flamer Fuel Ammo or Anesthesia Machine. Or mix those two together... :yes:

 

Well, by the rest of your post I'm kinda overwhelmed as usual. :laugh:

 

But I think I like more your 2nd idea (because damaging rebreather isn't very realistic). But when the rebreather is equipped, what will determine how long player can stay underwater? For example let's say that rebreather has limited capacity for 60 seconds. Player equips a rebreather but gets underwater after some time (for example after 50 seconds). Then player starts to swim, but has only remaining 10 seconds, and that is not very useful.

Link to comment
Share on other sites

OKies ... well I've been trying to get it working with "Player.ModAV WaterBreathing 1" in an object script ... Which just sets the player to unlimited time underwater. Same thing the Fallout NV rebreather did basically.

But I can't get it working properly with checking inventory for canisters , then removing 1 like every 15 sec.

Plus like you mention , its using the canisters no matter if your swimming.

 

Although I think oxygen use can be limited to swimming only , through a script condition of

"Player.GetPos Z < (water height) "

I messed with it a bit , but wasn't able to sort it out just yet , because of other issues and maybe just buggyness.

Or possibly using area triggers to trigger a count down of oxygen use if its just gona be a specific place the player needs it.

 

However I did get the other method to work ... Just modifying the players breath time ... so see if this script will get ya close to what you want. Just place it on what ever peice of apparel that you want.

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

SCN MyWaterBreathScript

 

Begin OnEquip
If Player.GetItemCount MyOxygenCan > 0
SetNumericGameSetting fActorSwimBreathBase 30 ; set this number for desired seconds
Player.RemoveItem MyOxygenCan 1 1
endif
End
Begin OnUnEquip
SetNumericGameSetting fActorSwimBreathBase 10 ; this sets it back to game default
End
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Or if you don't want it dependent on oxygen cans since it refills every time you resurface.
Just remove the 2 lines with "MyOxygenCan" in them and the "endif"
I guess it could be like your breathing from the air in a helmet or bag ?
Or maybe from taking a drug that extends your breath capacity ?
Edited by Mktavish
Link to comment
Share on other sites

Well, modifying player's breath time sounds good, but according to the script it automatically removes oxygen canisters the player has in inventory, if I understand it right. And that's not very realistic. I suppose it should start counting down the original oxygen reserves as soon as the canister is empty. That's why I wrote "reload" - player needs to manually refill oxygen levels in the rebreather.

 

Or maybe I got another idea that should work with your script: the rebreather can be simply used only one time - the same way as consumables. Player will "eat/use" a rebreather and it automatically appears on player's face. When the time runs out, the rebreather dissapears from player's face. I know it's not very realistic either, but I think it's the best compromise. What do you think about that?

Link to comment
Share on other sites

Well, modifying player's breath time sounds good, but according to the script it automatically removes oxygen canisters the player has in inventory, if I understand it right. And that's not very realistic. I suppose it should start counting down the original oxygen reserves as soon as the canister is empty. That's why I wrote "reload" - player needs to manually refill oxygen levels in the rebreather.

 

Or maybe I got another idea that should work with your script: the rebreather can be simply used only one time - the same way as consumables. Player will "eat/use" a rebreather and it automatically appears on player's face. When the time runs out, the rebreather dissapears from player's face. I know it's not very realistic either, but I think it's the best compromise. What do you think about that?

 

I set it to remove oxygen canisters from inventory upon equip , to simulate you were loading the rebreather with them. And with the idea they are not reusable.

 

But I now see you Did Not want it to automatically change them out while under water , from the inventory.

Which should make it easier for that script I was having problems with.

 

But one question ... should they be changeable while under water ? Which is possible script wise , just not to have an animation.

 

I actually had it glitch working to refill the breath count down at one point ... which I think I can reproduce simply by adjusting the breath capacity setting. (a toggle)

 

So do you have a rebreather mask ported/created you are wanting to work with ?

Because just adjusting the breath timer , you could simulate by taking pills (no mask needed) And have that effect run for a certain amount of time ... like 10 minutes real time. But the breath capacity underwater is still 30-60 sec ... restarted when surfacing.

 

Actively changing out the canisters will be easier. But also with the idea ... once equiped/loaded , it is using the oxygen no matter swimming or not.

But will only start the default 10 sec breath countdown when under water. And there will be no count down of oxygen , but could throw up low oxygen warning message just before the 10 sec count down.

 

IDK ... just shoot back the specific direction you are thinking.

Edited by Mktavish
Link to comment
Share on other sites

Sorry for the late reply - I didn't receive any notification in my mailbox.

 

Well, if you can make it so canisters shouldn't be changed under water, then do it! :smile: Although I'm not sure what animation are you talking about...

 

Of course some magic pills could do the trick, but that's not very real, isn't it. :wink: 10 minutes in real time is too much - I always try to make my mods with as many survival aspects as possible. In real time it should be 1 minute max. The canisters will be very rare, so the player cannot just simply swim here and there like a fish. :laugh:

 

But maybe my idea I was talking about was all about that pills. But the pills should be replaced by oxygen canisters of course. By this I think the script will be very simple, I suppose.

 

EDIT: I'm not sure but I found some related topics that should possibly help:

https://forums.nexusmods.com/index.php?/topic/860948-how-to-get-the-effect-water-breathing-works/
https://forums.nexusmods.com/index.php?/topic/316073-how-to-add-underwater-breathing-to-an-item/
Edited by Andyno
Link to comment
Share on other sites

 

Well, if you can make it so canisters shouldn't be changed under water, then do it! :smile: Although I'm not sure what animation are you talking about...

 

I was talking about if you wanted a reload type animation (which was just an aesthetic consideration)... since when ever an actor is in water deeper than mid chest height , they quit standing and start the water treading (swim animation) Which will overide any other animations , and is what makes combat impossible while swimming. Although the player can still activate items ... like open doors and containers. And most notably in this situation , access their inventory still , which will pause the breath timer count down. But allowing them to refill their status of water breathing ability ... which for all intensive purposes , just causes the oxygen timer while UnderWater to not count down.

So in order for them to not be able to just click on an inventory item. You would have to be able to check their Z height above water.

And that is proving not so easy. Except in the case of just modifying the breath timer ... which has a built in hard coded way of checking that.

 

Of course some magic pills could do the trick, but that's not very real, isn't it. :wink: 10 minutes in real time is too much - I always try to make my mods with as many survival aspects as possible. In real time it should be 1 minute max. The canisters will be very rare, so the player cannot just simply swim here and there like a fish. :laugh:

 

I didn't mean 10 minutes under water ... just 10 minutes of being able to hold their breath for an increased duration ... (example : some where between 30-60 sec) And for 10 minutes (or whatever duration , maybe just 3-5 min) They can resurface ... then go back under for the 30-60 sec.

 

But maybe my idea I was talking about was all about that pills. But the pills should be replaced by oxygen canisters of course. By this I think the script will be very simple, I suppose.

 

Well it doesn't have to be pills , there are other ingestibles which are not ... like the stealthboy. And its script could equip your mask item.

But the main point is , once it gets used , its gone. And its duration count down starts no matter swimming or not. Plus you could even throw in some side effects (addiction chance)

 

 

 

Link to comment
Share on other sites

Alright, so what will be the script for equipping a mask? I'm not sure, but in those 2 links I posted yesterday there's something mentioned about some kind of problems with object effects - so I just can't simply add MirelurkWaterBreathing effect to the mask.

 

In the case that once it's equipped it's gone, the player should really know that before using. I suppose it's not a problem, because every effect is described in PipBoy. So yes - its duration starts countdown no matter if the player is swimming or not.

 

Addiction? Only if the oxygen will be replaced by helium. :laugh:

Edited by Andyno
Link to comment
Share on other sites

Alright, so what will be the script for equipping a mask? I'm not sure, but in those 2 links I posted yesterday there's something mentioned about some kind of problems with object effects - so I just can't simply add MirelurkWaterBreathing effect to the mask.

 

The Problem with waterbreathing not applying through an object , is it is not adjusting the value (magnitude) of the actor.

Hence it has to be an actor effect. And you cannot attach an actor effect to an object , it must be an object effect.

But anyways ... we can simply bypass all that through making a base effect which is a "script" archetype ... and attaching a script to that by selecting your script as the associated item.

 

In the case that once it's equipped it's gone, the player should really know that before using. I suppose it's not a problem, because every effect is described in PipBoy. So yes - its duration starts countdown no matter if the player is swimming or not.

 

If the oxygen canister is an ingestible which shows up under aid in their inventory ... then that should be making them aware it is a one time use item ... no ???

 

 

So the easiest way I can see is to just write one script which will both give water breathing and equip the mask.

And make a script archetype base effect which you place on the oxygen canister as an ingestible.

On the ingestible is where you set the duration , no magnitude necessary with script.

Flag the base effect with "Recover , Self , NoMagnitude , DisplayName Only " And what you write in the Name field ... is what will show up for effects when looking at the item in pip boy.

 

 

Here is the script I suggest ... "Effect" type script .

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SCN MyWaterBreathScript

 

Begin ScriptEffectStart

 

If Player.GetItemCount MyBreathMask > 0 ; checks mask in inv , so won't get water breath without

Player.EquipItem MyBreathMask 0 1 ; player has to have it in inventory to equip

Player.SetAV WaterBreathing 1

 

endif

End

 

Begin ScriptEffectFinish

 

Player.UnEquipItem MyBreathMask ; will return it to inventory

Player.SetAV WaterBreathing 0

 

End

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

This method shows no oxygen countdown until the effect wears off ... which is however long you set the duration on the ingestible (Oxygen canister) But then it ticks down for the default 10 sec.

 

If you would like it to count down based on how long they are under water. You would then replace the line ...

 

"Player.SetAV WaterBreathing (0/1) " with " SetNumericGameSetting fActorSwimBreathBase 30 " or set that last number to how ever long you want them to be able to last under water. And it will refill everytime they resurface.

But in the scripteffectFinish block you would put " SetNumericGameSetting fActorSwimBreathBase 10" Which will put it back to the default 10 sec of underwater breath count.

And the "ScriptEffectFinish" Block runs when the duration you set for the ingestible expires. Which when that setting gets modified , will reset to full. So if the time expires while underwater , it will refill to a 10 sec countdown.

 

Hope all that makes sense ? And ofcourse it can get tailored a bit more for how ever you want it to specifically render.

Edited by Mktavish
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...