Page 1 of 1

[SBARINFO] "underwater" sub-block

Posted: Sat Jun 13, 2009 12:28 pm
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.

Re: [SBARINFO] "underwater" sub-block

Posted: Sun Jun 28, 2009 9:21 am
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.

Re: [SBARINFO] "underwater" sub-block

Posted: Sun Jun 28, 2009 9:38 am
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.

Re: [SBARINFO] "underwater" sub-block

Posted: Sun Jun 28, 2009 10:09 am
by The Slimeinator
What about for a flamethrower weapon that cannot be used underwater? :D

Re: [SBARINFO] "underwater" sub-block

Posted: Sun Jun 28, 2009 10:13 am
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.

Re: [SBARINFO] "underwater" sub-block

Posted: Sun Jun 28, 2009 5:43 pm
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.

Re: [SBARINFO] "underwater" sub-block

Posted: Mon Nov 09, 2009 11:03 am
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.

Re: [SBARINFO] "underwater" sub-block

Posted: Wed Nov 25, 2009 4:56 pm
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.