[SBARINFO] "underwater" sub-block

Moderator: GZDoom Developers

Post Reply
User avatar
Setzer
Posts: 124
Joined: Mon Mar 13, 2006 11:12 pm
Location: nowhereville

[SBARINFO] "underwater" sub-block

Post by Setzer »

Though the new AirTime counter is lovley, at the moment there is no way to check whether the player is actively underwater or not. A special type of sub-block that executes when underwater would be very handy.

I can see someone using this to emulate Duke 3D's scuba tank effect, among other things.
User avatar
The Slimeinator
Posts: 44
Joined: Fri Jun 26, 2009 1:23 pm

Re: [SBARINFO] "underwater" sub-block

Post by The Slimeinator »

I don't think this would be useful as far as SBARINFO goes, but instead as an "inventory" function. For example, an extension to A_JumpIf.

Such as, in a CustomInventory item:

A_JumpIf(playerwaterlevel > 2, "Use2")

And then the item would jump to a state and then carry out its function that changes or could only work while underwater.
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Re: [SBARINFO] "underwater" sub-block

Post by XutaWoo »

Code: Select all

A_JumpIf(waterlevel > 2, "Use2")
There you go.

No, seriously, that will work.

In the pickup and use states and states that follow them, anyway. But I can't think of a use for a inventory item to check for a player's water level except in those conditions.
User avatar
The Slimeinator
Posts: 44
Joined: Fri Jun 26, 2009 1:23 pm

Re: [SBARINFO] "underwater" sub-block

Post by The Slimeinator »

What about for a flamethrower weapon that cannot be used underwater? :D
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Re: [SBARINFO] "underwater" sub-block

Post by XutaWoo »

Weapons are inventory items.

I probally should've explained better; checks with items that are in a player's inventory call the player's value, so as long as you're not doing something silly like putting it in the Spawn state, it'd jump if the player was underwater.
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: [SBARINFO] "underwater" sub-block

Post by Xaser »

The Slimeinator wrote:What about for a flamethrower weapon that cannot be used underwater? :D
I've used the method XutaWoo posted to do just that. You just can't check for this with SBARINFO and that's the reason this suggestion's here.
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: [SBARINFO] "underwater" sub-block

Post by Xaser »

Hmm, I normally don't condone bumping of suggestion threads, but I'm bringing this to light again now that the SBARINFO rewrite is done-ish.

I tried to go ahead and implement an AirTime counter in Psychic's numbers-only minimal-HUD when I realized that because of the way things work, the AirTime counter would always be displayed, which looks pretty silly telling you there's still 20 seconds worth of air left even when you're above water. :P

Basically, without a way to check if the player's actually underwater or not, I can't see the AirTime counter getting much use, leaving the feature a bit crippled in its current state.
User avatar
MG_Man
Posts: 1401
Joined: Sat Jul 28, 2007 1:24 pm
Contact:

Re: [SBARINFO] "underwater" sub-block

Post by MG_Man »

Xaser wrote:Hmm, I normally don't condone bumping of suggestion threads, but I'm bringing this to light again now that the SBARINFO rewrite is done-ish.

I tried to go ahead and implement an AirTime counter in Psychic's numbers-only minimal-HUD when I realized that because of the way things work, the AirTime counter would always be displayed, which looks pretty silly telling you there's still 20 seconds worth of air left even when you're above water. :P

Basically, without a way to check if the player's actually underwater or not, I can't see the AirTime counter getting much use, leaving the feature a bit crippled in its current state.
Perhaps you can have a sub-block appear only when the airtime is less than the max?

Judging on how the number differs per map I don't think this would be as reliable though, but it's a start.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”