Jump to content
  • 0

How to create a drowning system when the player is underwater for too long?


Johnny_Vicc_007

Question

I wanted to create a drowning duration system where the player would drown if underwater for too long. Is it possible to achieve this using properties of the 3D floor texture of the water, or would it require an ACS script? If an ACS script is necessary, could you recommend a ready-made script that could work with the water texture? Just to clarify, I want the drowning duration to be 30 seconds, and when this time is up, the player will lose 5 health points in shallow waters and 10 health points in deeper waters.

Share this post


Link to post

3 answers to this question

Recommended Posts

  • 0

If any moderator comes across my post, I apologize for accidentally posting the same post twice. I even tried to find an option to delete this second post, but unfortunately, there isn't such an option on Doomworld. :(

Share this post


Link to post
  • 0
8 hours ago, Johnny_Vicc_007 said:

 of the 3D floor texture of the water, or would it require an ACS script?

 

It is simpler than that, just set the 3D control sector to swimmable.

Share this post


Link to post
  • 0

It won't achieve the exact effect you're after, but GZDoom handles drowning out of the box without any scripting. By default, the player has an "air supply" of 20 seconds, meaning that they can be underwater for 20 seconds before they start taking damage. You can increase it with the AirSupply property in MAPINFO. Example:

map MAP01 "yourmapnamehere"
{
    sky1 = "SKY1", 0.0
    par = 69
    airsupply = 30
}

 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...