Change Player skin mid-game

Discuss all aspects related to modding Zandronum here.
Post Reply
RobbyPants
 
Posts: 37
Joined: Wed Mar 13, 2013 12:53 am

Change Player skin mid-game

#1

Post by RobbyPants » Sat Jan 30, 2016 6:34 pm

Is there a way to change a player's skin upon picking up a custom inventory item?

User avatar
Ænima
Addicted to Zandronum
Posts: 3578
Joined: Tue Jun 05, 2012 6:12 pm

RE: Change Player skin mid-game

#2

Post by Ænima » Sat Jan 30, 2016 7:04 pm

RobbyPants wrote: Is there a way to change a player's skin upon picking up a custom inventory item?
You could put a bunch of custom states in the player actor's DECORATE and then use A_JumpIfInventory.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

RobbyPants
 
Posts: 37
Joined: Wed Mar 13, 2013 12:53 am

RE: Change Player skin mid-game

#3

Post by RobbyPants » Sat Jan 30, 2016 7:51 pm

Ænima wrote: You could put a bunch of custom states in the player actor's DECORATE and then use A_JumpIfInventory.
Can that change the skin?

I want to do this because the player's skin is what's used in GLDEFS for giving the player a light source. I wanted to have a flashlight item, that if possessed, would make the player "glow". It's easy enough for me to set this to always be on, but I'd like it if it would start off and only work once the player picks the flashlight up.

User avatar
Ænima
Addicted to Zandronum
Posts: 3578
Joined: Tue Jun 05, 2012 6:12 pm

RE: Change Player skin mid-game

#4

Post by Ænima » Sat Jan 30, 2016 7:59 pm

I told you how to do it in the other thread ...

Do you want the player's skin to be changed? In other words do you want this to work with custom skins or are you forcing a certain set of sprites on every player?
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

RobbyPants
 
Posts: 37
Joined: Wed Mar 13, 2013 12:53 am

RE: Change Player skin mid-game

#5

Post by RobbyPants » Sat Jan 30, 2016 8:20 pm

Ænima wrote: I told you how to do it in the other thread ...

Do you want the player's skin to be changed? In other words do you want this to work with custom skins or are you forcing a certain set of sprites on every player?
I'll take a look at that one, again.

The map is made for just a single player, so I don't particularly care what the skin looks like. I just need a way to differentiate two different sprites in GLDEFS based on the presence or absence of an inventory item.

User avatar
Ænima
Addicted to Zandronum
Posts: 3578
Joined: Tue Jun 05, 2012 6:12 pm

RE: Change Player skin mid-game

#6

Post by Ænima » Sat Jan 30, 2016 8:35 pm

So then make an identical copy of all your PLAY* sprites but rename them PLA2 or something. Then make a seperate set of See, Pain, Spawn, Melee, and Missile states that are exactly the same as the normal player states, just with PLA2 instead of PLAY. Make sure you put a A_JumpIfInventory at the beginning of all your "normal" states and make it jump to the PLA2 version of that state if the flashlight is equipped. Then go into GLDEFS and attach the light to PLA2 on your player actor.

It might even be easier to just have an ACS script that spawns an invisible actor (TNT1A0) from the player every single tic, and spawn it using the player's x,y,z velocity so that it stays MOSTLY sync'd with the player's movement. Then just attach the GL light to that actor. It won't look 100% as smooth as using the player themself as the light origin but if it's singleplayer I don't think anyone will notice.
Last edited by Ænima on Sat Jan 30, 2016 8:38 pm, edited 1 time in total.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

RobbyPants
 
Posts: 37
Joined: Wed Mar 13, 2013 12:53 am

RE: Change Player skin mid-game

#7

Post by RobbyPants » Sat Jan 30, 2016 8:42 pm

That separate object thing is actually a really good idea. Thanks.
The separate object thing had too many odd side effects. The light would disappear when I got next to a wall or went up stairs, but would come back if I moved or went down. I might have been able to tweak the spawn height, but I ultimately made the extra player sprites and states, and it worked great! Thanks for the advice!
Last edited by RobbyPants on Sat Jan 30, 2016 9:38 pm, edited 1 time in total.

Post Reply