Flag to prevent player sprite squish when crouching?

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

User avatar
Zan
Posts: 338
Joined: Sat Oct 22, 2016 12:43 pm
Location: The depths of Hedon.
Contact:

Flag to prevent player sprite squish when crouching?

Post by Zan »

Hey, would something that prevents any visual change on the player's sprite when crouching be possible?
A flag that would no longer make the sprite distort to half its' height or something like a +PLAYERPAWN.NOCROUCHMORPH

I get the point that a squished sprite is still better representation of crouch than nothing, but I think people should be able to opt out, and simply have crouch not modify anything visual. This also ties up to possible inconsistency issues when the player sprite has more skins like for different weapons, but the engine only allows for one set of crouch sprites, so the crouch animation will only be available for one of the skins, while the rest will do the standard morph.
User avatar
Rachael
Posts: 13542
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Flag to prevent player sprite squish when crouching?

Post by Rachael »

What happens when you define "Player.CrouchSprite" to simply be the same sprite set as the one you are already using?

I am not sure if it'll work but it's something worth a try.

[wiki]Classes:PlayerPawn[/wiki]
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: Flag to prevent player sprite squish when crouching?

Post by Matt »

I just tried this in a playerpawn's Tick() and it works:

Code: Select all

        if(player.getgender())crouchsprite=getspriteindex("TROOA1");
        else crouchsprite=getspriteindex("PLYCA1");
 
It didn't work when I tried it almost a year ago but I'm glad it does now!

EDIT: Wait, I hadn't checked if this works:

Code: Select all

        if(player.getgender()){
            sprite=getspriteindex("SARGA1");
            crouchsprite=getspriteindex("TROOA1");
        }else{
            sprite=getspriteindex("PLAYA1");
            crouchsprite=getspriteindex("PLYCA1");
        } 
User avatar
Zan
Posts: 338
Joined: Sat Oct 22, 2016 12:43 pm
Location: The depths of Hedon.
Contact:

Re: Flag to prevent player sprite squish when crouching?

Post by Zan »

Rachael wrote:What happens when you define "Player.CrouchSprite" to simply be the same sprite set as the one you are already using?

I am not sure if it'll work but it's something worth a try.

[wiki]Classes:PlayerPawn[/wiki]
It only works for the default states. But if I crouch in my other spawn/see states (defined for other weapons), I get the shrink effect.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: Flag to prevent player sprite squish when crouching?

Post by Matt »

Matt wrote:

Code: Select all

        if(player.getgender()){
            sprite=getspriteindex("SARGA1");
            crouchsprite=getspriteindex("TROOA1");
        }else{
            sprite=getspriteindex("PLAYA1");
            crouchsprite=getspriteindex("PLYCA1");
        }
Expected/hoped:
SARG while not crouching and non-male
TROO while crouching and non-male
PLAY/PLYC while male

Actual:
SARG while not crouching and non-male
SARG-squished while crouching and non-male
PLAY/PLYC while male

It's the same as it was when I posted that other thread.


We still have no way at all of properly replacing all the player sprites dynamically including the crouch sprites (at least without some really gross morph hack and I don't even know if that would work), so this is still an open issue.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49066
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Flag to prevent player sprite squish when crouching?

Post by Graf Zahl »

That's simply because the player wasn't made for more than one sprite name. It was made even less for such sprite name hacks.
Post Reply

Return to “Feature Suggestions [GZDoom]”