PLAYERPAWN.CANTJUMP and PLAYERPAWN.CANTCROUCH
Moderator: GZDoom Developers
PLAYERPAWN.CANTJUMP and PLAYERPAWN.CANTCROUCH
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.
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.
- 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
Not needed. Just override the playerpawns' jumping and crouching virtuals in ZScript.
Re: PLAYERPAWN.CANTJUMP and PLAYERPAWN.CANTCROUCH
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.
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.
- Caligari87
- Admin
- Posts: 6174
- Joined: Thu Feb 26, 2004 3:02 pm
- Preferred Pronouns: He/Him
- Contact:
Re: PLAYERPAWN.CANTJUMP and PLAYERPAWN.CANTCROUCH
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.
Okay, so slippery slope fallacy I know, but sometimes that's what stuff like this seems to be.
Re: PLAYERPAWN.CANTJUMP and PLAYERPAWN.CANTCROUCH
Yes, Cali, I know it appears that way, but my main concern is not that.
It's more, this:
It's more, this:
And I am in full agreement here.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.
Re: PLAYERPAWN.CANTJUMP and PLAYERPAWN.CANTCROUCH
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?Major Cooke wrote:Not needed. Just override the playerpawns' jumping and crouching virtuals in ZScript.
EDIT: Oh wait nevermind, I had an older version of GZDoom. I can see what you're talking about, now.
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?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.
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?
- 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
Well, the title has PLAYERPAWN prefixing the flags. Non-players, all you'd have to use GetPlayerInput and just not check for BT_JUMP.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.
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.
- 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
Set the class' jump sound to dsempty.Turret49 wrote:...however the class' jump sound will still play whenever a jump attempt is made, which is not good.
- 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
To disable jumping/crouching on playerpawns based on an inventory check:
This will also prevent the jumping sound from playing.
Again, IMO no need to introduce more flags. This right here will suffice.
Code: Select all
override void CheckJump()
{
if (!CountInv("ItemNameThatBlocksJumping"))
Super.CheckJump();
}
override void CheckCrouch(bool totallyfrozen)
{
if (!CountInv("ItemNameThatBlocksCrouching"))
Super.CheckCrouch(totallyfrozen);
}
Again, IMO no need to introduce more flags. This right here will suffice.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49056
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: PLAYERPAWN.CANTJUMP and PLAYERPAWN.CANTCROUCH
This sounds like something that really doesn't warrant some explicit coding. The few mods that need it can just do as MC suggests.
Re: PLAYERPAWN.CANTJUMP and PLAYERPAWN.CANTCROUCH
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!