Spike wrote: Each entity has a .colormap field. This .colormap field refers to a player slot.
When the player dies, the model and colormap of the player is copied over to a new entity (part of the bodyqueue).
Ok, I'm a little confused at this point as to what a "colormap" actually is.
I thought 'colormap' referred to: "the colour to change lines 2 and 7 of the quake palette to". So when a player joins the Blue team, their 'colormap' is Blue (or something), then if a Blue engineer builds a SentryGun, we display the sentry mdl, and then go:
sentrygun.owner = <the blue engineer>
sentrygun.colormap = sentrygun.owners.colormap;
.. and this will switch ('map') all the colours used (in the sentry skin) from lines 2 and 7 of the Quake palette, to their Blue equivalents.
But Frag Machine
recently saidhowever said that 'colormap' refers to the whole skin/texture: "In graphic programming terms, the colormap is the array of pixels that describe the colors. Modern game engines don't use just color pixels in skins: usually you can have additional images to represent bumpmapping, luminosity, transparency and other effects"
Spike wrote: When drawing the entity, the client looks at the colormap field. if its set, it recolours the entity according to the colour of the player indicated, and if its player.mdl then it also gets the player's skin too.
(note: vanilla glqw does not support colouring of models other than player.mdl).
The gamecode has no real control over the skin or colours used. Any checks (which are pretty common) are basically hacks for the simple reason that it cannot control skins on entities individually, it can traditionally only ask the client to update its settings.
Spike wrote:
Side note: with QuakeWorld protocols, players have a hardcoded .colormap field equal to their own player slot.
When a player respawns, is there an 'update' on what skins the other players are wearing, or does that information 'persist' beyond the respawning process? I'm dealing w a bug at the moment in my 'DoomFace' mod,
[EDIT: The bug has since been fixed, BIG thanks to Spike and Taniwha for their help! The prob was related to the 'SkinBlind' mod with a section I had written (and forgotten about!) which restored all skins in case a player died whilst in a hallucinogenic state. It of course restored skins to the default skins. I also overlooked it because it was in PlayerDeathThink() which for some reason I missed whilst tracing the death related functions] where respawning clients see other players with default TF skins, rather than the new versions I made.
Here's a step by step description:
Game begins
Player1 has skinA
Player2 has skinB
They can see each other wearing the correct skins.
Player1 dies.
As he's lying there dead, Player1 can still see Player2 still wearing skinB.
BUT (!!) after Player1 respawns, he now sees Player2 (and all other players) wearing 'regular' TF skins... why?
Note: to an observer ( ie a Player3), nothing has changed (ie Player1 has skinA and Player2 has skinB), so somehow, somewhere, during his 'respawn procedure' Player1 was told to 'change the skins he is looking at'. But where... how? I've looked at respawn related functions like clientconnect() and bodyque stuff but cannot see anywhere that tells a respawning client to change/check *other* players skins. Any ideas?