Changing Models and Skins
Quake2 Demo Editing Tutorial

Written 5/99 by Overman
Special Thanks to Kemosabe for his research on this topic.

          

Changing the models and skins of players in your demo is very straightforward in concept, but can be tedious to actually perform.  In this tutorial, we'll cover everything you need to know to have complete control over the look of your players.

First Things First

Open up the demo of your choice, preferably one where there are several players involved.  Try to avoid a demo with bot-players, as they are sometimes handled a bit differently... and we won't be covering those differences in detail until the tutorial on Mod-Specific Demo Editing.

Open the Demo Information dialog.  On the left hand side is the now familiar list of configstrings from the precache list.  Scroll all the way down to the bottom of the list, and you will see several entries starting with "Skins[0]", and going up in number, one for each player in the demo ("Skins[1]", "Skins[2]", etc.).  These are the player model/skin entries for each player, numbered in the order that they connected to the server.

Click on Skins[0], and you should see the index and value of that configstring.

Player 0 will always be configstring # 1312, and other players will be numbered up from there (player 1 = 1313, player 2 = 1314, etc.)   NOTE:  Now is a good time to issue the reminder that Entity # is always 1 greater than player #.  So, Player 0 = Entity 1 = configstring 1312, etc. etc.   Remember this so you don't get confused if you ever need to track down a player in your demo with the Show Entity feature enabled on the camera. 

Notice the format of each of these configstrings:

NAME\MODEL/SKIN

The MODEL/SKIN portion refers to the subdirectory and skin file under quake2\baseq2\players\  that corresponds with the model and skin the player was wearing.  You can edit these entries here to whatever you wish.  If you pick a model and skin that the person watching your demo does not have, then the player in question will appear as male/grunt (the Quake2 default). 


Changing Model/Skin in Mid-Demo

Changing the precache skin entry (like we just discussed) will cause a whole new model and skin to be loaded when the demo starts.  If you want to change this entry midway through the demo, can you guess how we would do that?  We simply insert a new configstring message with the same index, and that replaces the old one.  So, for example, if you want to change the skin for Player 0 at block 100, simply select block 100 on the filmstrip, then Insert - New Message, type:  configstring.  Index:  1312 (because we're changing Player 0). 

For the value of the configstring itself, we use exactly the same format as we did in Demo Information, NAME\MODEL/SKIN.  It's that simple.

Issues to Consider

Sometimes Quake2 inserts skin configstrings into your recording.   With some mods they occur every time a player dies and respawns.  These can get in your way if you are trying to change skins either from the beginning or throughout the demo.  For this reason, it is a good idea to use the Find Dialog to delete any existing configstrings that are referring to player model/skin entries before you do anything else.  That way, if you decide to insert your own later on, you will have no trouble telling the difference between your entry and the junk entries sometimes inserted by Quake2.  To do this, open the Find dialog, Find Type: Delete, messagetype:  configstring, and then carefully examine each configstring before deleting... you definitely do not want to delete ALL configstrings, only the ones having to do with players.

Another factor is that by changing the model or skin midway through the demo to one that is not in the precache list, there can be a stutter while Quake2 loads the skin on the spot.  This can cause a noticable moment of lag in your demo, which is of course undesirable.  While we learn how to take care of this problem, we are also going to learn how to have total control over the player's appearance, right down to the Visible Weapon model he/she is holding at any given time.  Sound good?   Read on.


Total Control from the Precache List

If you are going to have a lot of model and skin switching on players in your demo, you are going to want to take full advantage of the precache list of configstrings.  As we noticed earlier, configstring 1312 is Skin[0], 1313 is Skin[1], etc.  These can go as high as Skin[255] (configstring 1567), for a total of 256 different model/skin combinations that you can tell Quake2 to load when your demo loads.  

Here's where we get into the nitty gritty.  Remembering that Player 0 = Entity 1, let's examine one of the packetentities messages for Entity 1.   You can do this by opening up the Block Tree and finding one (they occur in each block in order of their entity #. 

Notice the Skin parameter.  This refers to the [ ] number for the Skin in question.  But wait!  This says 256?  How can that be, when the highest Skin[#] is only 255?   Here's how it works. 

Packetentities:Skin value Meaning
0 - 255 skin[0] - skin[255] with base weapon (i.e. single
shotgun for standard iD models)
256 - 511 skin[0] - skin [255] with blaster
512 - 767 ... with shotgun
768 - 1023 ... with super shotgun
1024 - 1279 ... with machinegun
1280 - 1535 ... with chaingun
1536 - 1791 ... with grenade
1792 - 2047 ... with grenade launcher
2048 - 2303 ... with rocket launcher
2304 - 2559 ... with hyperblaster
2560 - 2815 ... with railgun
2816 - 3071 ... with BFG

In light of this, the 256 value makes perfect sense.  At that point in the demo, our player was wearing Skin[0] and carrying the blaster.  Sounds like he needs to find a weapon fast!

Using the Find/Replace dialog, you can use this chart to exert complete control over your players' appearance by first selecting a range, and then replacing the Skin parameter values for all of your player's packentities messages for that range.  It's complicated, but it's the best way to have precise control, with no playback pauses.

In Closing

So, if you need to make simple, basic changes to the models and skins in your demo, it would be wise to stick with the simpler procedures covered in the first half of this tutorial.  However, if you are working on a complicated movie or merging several demos together, then you may require the kind of advanced procedures we've just finished discussing.  Of course, merging material from several sources can lead to other issues, which we will get to in due time.  For now, take one of your demos and give yourself a virtual makeover... into whatever you like!