PLAYERPAWN.CANTJUMP and PLAYERPAWN.CANTCROUCH

Moderator: GZDoom Developers

Post Reply
Turret49
Posts: 92
Joined: Sat Aug 29, 2015 1:40 pm

PLAYERPAWN.CANTJUMP and PLAYERPAWN.CANTCROUCH

Post by Turret49 »

Simply put, a couple of flags that completely override all MAPINFO and Gameplay settings, disabling the PlayerPawn's ability to jump or crouch midgame. This could allow for situations were you absolutely don't want the player to be able to perform either action, for example they may be carrying a heavy object, are manning a gun emplacement (PROP_FROZEN does not disable jumping or crouching), doing a special manoeuvre like a sliding dodge or a charging attack, the player character is actually Mega Man and will never crouch, etc.

Now, you could say disabling jump midgame can already be done by altering the player's JumpZ, however the class' jump sound will still play whenever a jump attempt is made, which is not good.

Disabling crouch also allows greater use of A_SetSize, letting the modder make their own crouch system or alternatives to crouching, maybe the player has a shrinking ability, or the previously mentioned sliding dodge.
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: PLAYERPAWN.CANTJUMP and PLAYERPAWN.CANTCROUCH

Post by Major Cooke »

Not needed. Just override the playerpawns' jumping and crouching virtuals in ZScript.
User avatar
Rachael
Posts: 13532
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: PLAYERPAWN.CANTJUMP and PLAYERPAWN.CANTCROUCH

Post by Rachael »

That only works if you are inheriting and defining your own PlayerPawn. I think there may be times you may not want to do that.

I'll leave that open for Graf and _Mental_ to decide. It may be "LTFZS" or it may not be, it's more philosophical than anything else right now, I think.
User avatar
Caligari87
Admin
Posts: 6174
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Re: PLAYERPAWN.CANTJUMP and PLAYERPAWN.CANTCROUCH

Post by Caligari87 »

It feels to me like just another feature "arms race". An override for an override for an override, and eventually you have flags like "REALLYREALLYREALLYCANNOTJUMP" on the player and "Force allow jumping even if the flag has three reallys" in the menu.

Okay, so slippery slope fallacy I know, but sometimes that's what stuff like this seems to be. :shrug:

8-)
User avatar
Rachael
Posts: 13532
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: PLAYERPAWN.CANTJUMP and PLAYERPAWN.CANTCROUCH

Post by Rachael »

Yes, Cali, I know it appears that way, but my main concern is not that.

It's more, this:
Graf Zahl in [url=https://forum.zdoom.org/viewtopic.php?p=531036#p531036]another thread[/url] wrote:I wouldn't add this to the first post but it needs to be said here, too:

If you want to suggest a workaround for a requested feature please think first if your workaround meets the suggester's needs. I have seen it too many times that some people post stuff that completely ignores the original post's motivation or suggests some laborious things that would be more an annoyance than anything else to do repeatedly. Often these things come equipped with the word 'just' as if it was the most normal thing to do repeated cumbersome routines.

Such posts tend to create tension because the OP might feel ignored on purpose by that. Here's a good example of this kind of behavior which I really don't want to see anymore on the Feature Suggestions forum.
And I am in full agreement here.
Turret49
Posts: 92
Joined: Sat Aug 29, 2015 1:40 pm

Re: PLAYERPAWN.CANTJUMP and PLAYERPAWN.CANTCROUCH

Post by Turret49 »

Major Cooke wrote:Not needed. Just override the playerpawns' jumping and crouching virtuals in ZScript.
Well one I have no idea how to do that, and two I can't even find these virtuals that you seem to be referring to. In the zscript player.txt file I can only find the JumpZ property for jumping, and the only crouch stuff I see is information related stuff under PlayerInfo?

EDIT: Oh wait nevermind, I had an older version of GZDoom. I can see what you're talking about, now.
It feels to me like just another feature "arms race". An override for an override for an override, and eventually you have flags like "REALLYREALLYREALLYCANNOTJUMP" on the player and "Force allow jumping even if the flag has three reallys" in the menu.
Why would someone want to enable jumping or crouching in the middle of what was designed to be a scripted action or complete inability, though? That's just breaking stuff for the sake of breaking them. Or are you worried someone will use the flags in a script run at the start of a level to disable jumping and crouching without using MAPINFO, and overriding gameplay options entirely?

I'm hoping this isn't a case of "ZScript is out now, figure it out yourself", either. I really don't know what's been going on with (G)ZDoom scripting features these days. Is this sort of thing (toggling a player's ability to crouch/jump midgame) possible with ZScript right now and there's documentation for it?
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: PLAYERPAWN.CANTJUMP and PLAYERPAWN.CANTCROUCH

Post by Major Cooke »

Rachael wrote:That only works if you are inheriting and defining your own PlayerPawn. I think there may be times you may not want to do that.
Well, the title has PLAYERPAWN prefixing the flags. Non-players, all you'd have to use GetPlayerInput and just not check for BT_JUMP.

Cali: I'm pretty certain he's referring specifically for a mod and not a mapset that's compatible with any mod.
Last edited by Major Cooke on Fri Aug 04, 2017 12:32 pm, edited 4 times in total.
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Re: PLAYERPAWN.CANTJUMP and PLAYERPAWN.CANTCROUCH

Post by Ed the Bat »

Turret49 wrote:...however the class' jump sound will still play whenever a jump attempt is made, which is not good.
Set the class' jump sound to dsempty.
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: PLAYERPAWN.CANTJUMP and PLAYERPAWN.CANTCROUCH

Post by Major Cooke »

To disable jumping/crouching on playerpawns based on an inventory check:

Code: Select all

override void CheckJump()
{
	if (!CountInv("ItemNameThatBlocksJumping"))
		Super.CheckJump();
}

override void CheckCrouch(bool totallyfrozen)
{
	if (!CountInv("ItemNameThatBlocksCrouching"))
		Super.CheckCrouch(totallyfrozen);
}
This will also prevent the jumping sound from playing.
Again, IMO no need to introduce more flags. This right here will suffice.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: PLAYERPAWN.CANTJUMP and PLAYERPAWN.CANTCROUCH

Post by Graf Zahl »

This sounds like something that really doesn't warrant some explicit coding. The few mods that need it can just do as MC suggests.
Turret49
Posts: 92
Joined: Sat Aug 29, 2015 1:40 pm

Re: PLAYERPAWN.CANTJUMP and PLAYERPAWN.CANTCROUCH

Post by Turret49 »

Alright, I guess my lack of ZScript knowledge really shows. At least anyone in the future could look up this thread if they had the same silly idea as I did. Also thanks Cooke!
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”