Item that can change Player.AirCapacity?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
Tera
Posts: 11
Joined: Sun Apr 29, 2018 5:22 pm
Graphics Processor: nVidia (Modern GZDoom)

Item that can change Player.AirCapacity?

Post by Tera »

I'm trying to make a Metroidvania Doom mod, and I want to make an item to permanently change the player's air capacity so they could be able to go through parts of different levels that are full of water without drowning.
I've found a few other methods like making a powerup item that nullifies drowning damage, but they end up not being able to be carried across into other maps.
User avatar
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Item that can change Player.AirCapacity?

Post by Enjay »

Is the MAPINFO AirSupply parameter any use to you?

AirSupply = <amount>
Specifies the time in seconds the player can remain under water without taking damage. Setting this to 0 allows the player to stay under water indefinitely. The default setting is 20 seconds which can be quite short if you wish to use extensive water areas within your map.

https://zdoom.org/wiki/MAPINFO/Map_definition
User avatar
Tera
Posts: 11
Joined: Sun Apr 29, 2018 5:22 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: Item that can change Player.AirCapacity?

Post by Tera »

Wouldn't that make it where the player has infinite air capacity in a map regardless of if they have the item meant for expanding air capacity?
User avatar
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Item that can change Player.AirCapacity?

Post by Enjay »

Yes, that's why I wasn't sure if it would be of use to you.

I'm sure what you are trying to do will be possible via zscript but I'm not familiar enough with it yet to say how.
User avatar
Apeirogon
Posts: 1605
Joined: Mon Jun 12, 2017 12:57 am

Re: Item that can change Player.AirCapacity?

Post by Apeirogon »

Drop it on gzdoom and print in console "give gills".
Also, I write it in notepad, so there are, probably, be errors.
Attachments
zscript.txt
(148 Bytes) Downloaded 44 times
User avatar
Tera
Posts: 11
Joined: Sun Apr 29, 2018 5:22 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: Item that can change Player.AirCapacity?

Post by Tera »

Oh wow, it works. Thanks.
I really, really should start doing ZScript now.
Post Reply

Return to “Scripting”