Weapon Skins
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Weapon Skins
Is it possible to skins for weapons? Similar to how a player skin swaps out corresponding images for PLAYXXXX, and sounds, does ZDoom support skins for weapons?
- Tapwave
- Posts: 2096
- Joined: Sat Aug 20, 2011 8:54 am
- Preferred Pronouns: No Preference
- Graphics Processor: nVidia with Vulkan support
Re: Weapon Skins
You could do this by making class-based replaces (Wasn't there something for this on recent versions?) but that's not really a "skin" per se.
Re: Weapon Skins
Couldn't you have states in the player actor definition check for currently equipped weapon and then have if true, have it jump to a version of the state with appropriate sprites?
Re: Weapon Skins
Can I actually check for the players skin? I was going to include both a normal doom guy and the DE-gal in the next beta. Was thinking of making modified weapons for weapons where the hands are visible.
- NeuralStunner
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: Weapon Skins
I know you can define mugshots in skin defs, but I'm pretty sure there is no similar case for weapons.
Personally I think you should make them into separate classes, and skip the skin system.
Personally I think you should make them into separate classes, and skip the skin system.
- cq75
- Posts: 1212
- Joined: Sun Dec 27, 2009 9:28 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Just beyond the line horizon
Re: Weapon Skins
I currently use classes as skins in my mod, the only real disadvantage is that players need to die before changing a skin for the change to take effect.
EDIT - also, skins are clientside, classes are not.
EDIT - also, skins are clientside, classes are not.
Re: Weapon Skins
i'd say use a dummy tagger fake inventry item for your charater, then use a a_jumpifininventory to jump to the approprate weapon skin, its what i use in my mod urban pacification.
like Player A has start item purse, and player B has start item watch, when you pick up the weapon, if you have start item purse, The jump will let you'll have the female handed weapon, if you have start item watch, you get the male handed weapon for instance.
like Player A has start item purse, and player B has start item watch, when you pick up the weapon, if you have start item purse, The jump will let you'll have the female handed weapon, if you have start item watch, you get the male handed weapon for instance.
Re: Weapon Skins
hm...using classes is way too much work to something that does nothing but change the appearance. Guess I'll just leave it as the female only.
Re: Weapon Skins
Skulltag has this built in, but the only real way to do that in (G)ZDoom is with A_JumpIfInventory in the player's states and have the weapon give a fake inventory item to check for in the Select state and take it away in Deselect.
- NeuralStunner
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: Weapon Skins
Seems to be confusion about what Eriance is asking for. I got the impression he wants the HUD sprites to change based on the chosen skin.
Re: Weapon Skins
Oh, derp. Yeah, I can't think of a way.
Re: Weapon Skins
Yes that.NeuralStunner wrote:Seems to be confusion about what Eriance is asking for. I got the impression he wants the HUD sprites to change based on the chosen skin.
- zrrion the insect
- Posts: 2432
- Joined: Thu Jun 25, 2009 1:58 pm
- Location: Time Station 1: Moon of Glendale
Re: Weapon Skins
I've ran into similar problems, here's what I've done:
I edited the weapon so that it never actually spawns in game, but a "powerup" spawns instead.
This powerup would look like the weapon, but when you pick it up it would check for which player you were, and give you a different weapon.
It gets really complicated, especially if you change the amount of ammo/Powerup duration based on class the classes.
I edited the weapon so that it never actually spawns in game, but a "powerup" spawns instead.
This powerup would look like the weapon, but when you pick it up it would check for which player you were, and give you a different weapon.
It gets really complicated, especially if you change the amount of ammo/Powerup duration based on class the classes.
- ChronoSeth
- Posts: 1631
- Joined: Mon Jul 05, 2010 2:04 pm
- Location: British Columbia
Re: Weapon Skins
Again, that works for player classes, not skins.
Re: Weapon Skins
If you have the HUD weapon sprites in double, then you have the hardest part behind you already. The rest is a question of copy/pasting.
Make either the male or the female player class get a token item among its startup items. Let's say the male player class.
Now, for the weapon class:
What is happening here? Simple: the [wiki]sprite[/wiki] name #### means "keep previous sprite name". When the weapon is selected, that sprite name is initialized to PISG, which is the DoomGirl HUD sprite set. But we've got a check to see if there is a DoomGuyToken in the player inventory. If so, we go to the ManlySelect state, where the sprite name is changed to PIS2, which is the DoomGuy HUD sprite set. Afterwards, the sprite name is never changed.
Note the flash states. I left them as they are, assuming that the flash sprite itself (just the muzzle flash and lit up parts of the gun) would be identical across all players. If that's not the case, you can use the same trickery, basically, though there's some added subtlety.
Make either the male or the female player class get a token item among its startup items. Let's say the male player class.
Now, for the weapon class:
Code: Select all
ACTOR DEPistol : Pistol 5010
{
States
{
Ready:
"####" A 1 A_WeaponReady
Loop
Deselect:
"####" A 1 A_Lower
Loop
Select:
PISG A 0 A_JumpIfInventory("DoomGuyToken", "ManlySelect")
PISG A 1 A_Raise
Loop
ManlySelect:
PIS2 A 1 A_Raise
Loop
Fire:
"####" A 4
"####" B 6 A_FirePistol
"####" C 4
"####" B 5 A_ReFire
Goto Ready
Flash:
PISF A 7 Bright A_Light1
Goto LightDone
PISF A 7 Bright A_Light1
Goto LightDone
Spawn:
PIST A -1
Stop
}
}
Note the flash states. I left them as they are, assuming that the flash sprite itself (just the muzzle flash and lit up parts of the gun) would be identical across all players. If that's not the case, you can use the same trickery, basically, though there's some added subtlety.