Page 1 of 1

Player sprite for weapon

Posted: Thu Sep 13, 2012 5:35 pm
by Hece
How can I make player sprite to change if I switch weapon?
For example: If I use fist, player sprite switches (into one with fist)

RE: Player sprite for weapon

Posted: Thu Sep 13, 2012 6:05 pm
by TerminusEst13
I'd assume a LOT of A_JumpIfInInventory checks.

Every time the weapon raises and lowers, give or take a "WieldingWeaponX" dummy inventory item. And on the PlayerPawn, have an A_JumpIfInventory check for the item, then jump to the appropriate set of sprites.

RE: Player sprite for weapon

Posted: Thu Sep 13, 2012 6:25 pm
by Weiss
Actually if I remember right there's a bit of code, something like PrefferedSkin or something... I'm not sure though, since I don't code. I do know FOR SURE that it's been done though.

RE: Player sprite for weapon

Posted: Thu Sep 13, 2012 7:35 pm
by Slyfox
you could try seeing how hard-doom does it

RE: Player sprite for weapon

Posted: Thu Sep 13, 2012 10:22 pm
by Ijon Tichy
Weapon.PreferredSkin "<skinname>"

and define the skin in a SKININFO or S_SKIN lump

RE: Player sprite for weapon

Posted: Thu Sep 13, 2012 11:20 pm
by Llewellyn
Ijon Tichy wrote: Weapon.PreferredSkin "<skinname>"

and define the skin in a SKININFO or S_SKIN lump
Don't use S_SKIN if you plan on putting it with the rest of your mod.
Any wad with an S_SKIN lump, the rest is ignored (except sprites in SS_START/SS_END lumps because they're part of the SKIN namespace). SKININFO only works with Skulltag/Zandronum.