
The Soldier Pack contains the following files:
- soldier.dts > the dts shape
- soldier.cs > cs file to link the dsq's to the dts
- soldier_root.dsq > Idle looping animation
- soldier_run.dsq > Forward run animation
- soldier_back.dsq > Backwards run animation
- soldier_side.dsq > Sidestep animation
- soldier_jump.dsq > Jump animation
- soldier_recoil.dsq > Recoil animation
- soldier_headside.dsq > Head look left to right animation
- soldier_head.dsq > Head look up to down animation
- soldier_look.dsq > Arms move up to down animation for freelook
- soldier_gogogo.dsq > Waves for others to go on
- soldier_freeze.dsq > Holds up hand in stop signal
- soldier_death.dsq >Death animation
- gasmask.dts > The gasmask dts shape (with 1 skin)
- ruck.dts > The rucksack dts shape (with 1 skin)
- helmet.dts> The helmet dts shape (with 3 skins)
- M16.dts> The M16 dts shape
- soldierbase.max > Base file used for modifing soldier model/animations, versions for Max 5 and Max 7
- gasmask.max> Gasmask ready to export for Max 5 and Max 7.
- helmet.max> Helmet ready to export for Max 5 and Max 7.
- rucksack.max> Rucksack ready to export for Max 5 and Max 7.
- m16.max> M16 ready to export for Max 5 and Max 7.
- soldiermesh.fbs> Soldier mesh exported to fbx for import into other 3d applications.
- 19 png skin files> Various textures saved as png for ingame use.
- 1 psd skin file > Texture for soldier including layers for easy customization.
- m16.cs > Basic weapon script for m16.
- soldier_accessories.cs > Datablocks and toggle functions for his accessories.
- soldierGui.gui > Gui for toggling accessories on and off, and changing texture ingame.
- this documentation


Getting the player ingame is fairly straightforward.
First create a folder in starter.fps/data/shapes/ named soldier. Then copy all the files from the torque_player folder of the content pack to this new folder.
Also copy whatever extra player and/or helmet textures you want to use with it from the source_files/alternate_textures folder to the soldier folder you created.
Next go to starter.fps/server/scripts/ and open player.cs.
In player.cs, at the top of the file, change exec("~/data/shapes/player/player.cs"); to exec("~/data/shapes/soldier/soldier.cs");
Then scroll down to the PlayerBody datablock, and change the shapefile variable from "~/data/shapes/player/player.dts"; to "~/data/shapes/soldier/soldier.dts";
Save player.cs, run the game, and you should now spawn as the Soldier model instead of the orc.

To make the soldier use the M16 instead of the all powerfull crossbow, first copy m16.cs from the /scripts/ folder of the content pack to /starter.fps/server/scripts/.
Then open game.cs and at the bottom of the exec("./<somefile>.cs") list, add exec("./m16.cs");.
Now open player.cs and scroll down till you see several lines that start with maxInv. These tell the player what items he can hold, and how many of them he can have.
Beneath these, add maxInv[M16] = 1; and maxInv[M16Ammo] = 100;. The player can now carry one M16, and 100 bullets for it.
Go back to game.cs and change
%player.setInventory(Crossbow,1);
%player.setInventory(CrossbowAmmo,10);
%player.mountImage(CrossbowImage,0);
to
%player.setInventory(M16,1);
%player.setInventory(M16Ammo,100);
%player.mountImage(M16Image,0);
This tells the game to spawn the player with one M16 and 100 bullets for it, and to mount it to slot 0.

The pack includes several accessories for the soldier: a rucksack, helmet, and gasmask
The soldier is setup with 4 mount points in the dts for mounting his accessories:
The M-16 is mounted on mount0
The rucksack is mounted on mount1
The helmet is mounted on mount2
The gasmask is mounted on mount3
To mount the rucksack, helmet, and/or gasmask to the player, copy soldier_accessories.cs from the scripts folder of the content pack to /starter.fps/server/scripts/
Then open game.cs and at the bottom of all the exec("./<somefile>.cs"); add exec("./soldier_accessories"); so the engine will load this new script file.
Now that the engine knows they exist, to actually mount them on the player, you have two options: You can mount them when the player spawns like you do the M16, or mount them later with a function from the soldier_accessories.cs script.
To mount them when the player spawns, scroll down in game.cs to where you have %player.mountImage(M16Image,0); and beneath it, and any (or all) of these:
%player.mountImage(Rucksack,1);
%player.mountImage(Helmet,2);
%player.mountImage(Gasmask,3);
This mounts each of the accessories in a seperate slot so you can easily unmount them singly later on if you wish.
If you want to mount them at a time other than when the player spawns, soldier_accessories.cs contains three functions that check if the accessory is already mounted or not, and changes its state. So if it is mounted, it unmounts it, if it isnt mounted, it mounts it.
These three functions are named toggleRucksack(<playerId>); toggleHelmet(<playerId>); and toggleGasmask(<playerId>); Replace <playerId> with the Id of the player you want to affect.

Because the soldier has so many possible textures, it was exported so they could be easily swapped from ingame. You can do so using <playerId>.setSkinName(<someName>); where <playerId> is the Id of the player and <someName> is the name of the texture to switch to. So for example, 1507.setSkinName(blue); would set the player with id 1507 to the blue texture.
To find the name of the other textures, just look at the image name. The name is composed of three parts: the first part is name torque wants for setSkinName(), the second is the name of the group of skins (in this case soldier) and the last part is the file extension.

To simplify toggling the accessories on and off as well as changing the skin, a simple gui is included.
To install the gui, copy soldierGui.gui to /starter.fps/client/ui/
Now open up init.cs in /starter.fps/client/ and scroll down to the list of scripts exec'ed. Add exec("./ui/soldierGui.gui");.
So you dont have to open it up with a console command everytime, open default.bind.cs and scroll down about 3/4 the way to Helper Functions. Add:
function bringUpSoldierGui(%val)
{
    if (%val)
       Canvas.pushDialog(soldierGui);
}
GlobalActionMap.bind(keyboard, "ctrl s", bringUpSoldierGui);
Now ingame, you can just press ctrl+s to bring up the Soldier Gui.
To use the gui, first enter the Id of the player you want to affect. You can find the id by opening the Mission Editor, then looking at the player for the 4 numbers drawn on it (though note, if you want to affect yourself, first press ctrl+c to drop the camera seperate). After entering the player Id, you can use the first three buttons to toggle the Accessories on and off. In the bottom text box, you can enter the name of the texture you want to change to, and hit apply to see it.

In addition to the normal run, jump, etc animations, the soldier pack comes with two additional animations designed to be played by the client when they press the proper key.
To set these up, navigate to /starter.fps/client/scripts and open default.bind.cs.
Scroll about halfway down to Misc Player Stuff, and beneath the line for the suicide key, add:
GlobalActionMap.bindCmd(keyboard, "ctrl g", "commandToServer('playCel',\"gogogo\");", "");
GlobalActionMap.bindCmd(keyboard, "ctrl f", "commandToServer('playCel',\"freeze\");", "");
if you go ingame now, switch to 3rd person camera, and press either ctrl+g or ctrl+f you'll see the soldier play the matching animation.

You'll need an image editing program such as Photoshop or the Gimp (though note that Gimp will not show the layer colors talked about later in this doc). It contains the soldier skin with all its layers to hide/show or edit as your wish.
As a general rule, ALWAYS backup a layer before making a change to it (right-click on the layer>>duplicate layer)
If you want to export to 512*512 or smaller size, save the texture at the 1024*1024 size as a jpg or png, then open it up and resize it.
To change the color of a layer, use the Hue/saturation tool (Ctrl+U).
In order to easily use the file, a few rules has been established with layer colors:
![]() |
- Gray : Don't edit, remove or hide a gray layer. (They are used often for shadows and highlights.) - Red : Don't hide or remove a red layer, but you can edit it (the color for example, or add an element) - Yellow : You can Hide/show and edit a yellow layer (most of yellow layers are premade variations, such as different camos or jackets) - Green: You can Hide/show, edit and move a green layer (used for symbols or other moveable items) - Blue: Blue layers are properties layer (brightness/colors). Editing/hiding/showing these layers will change an element's color or brightness. |

Some layer sets with the word "Constructor" in them are able to create new content more easily.
The Face constructor has a base skin background and a guide layer to help you place a photo. You can then use picture of your friend or from the net to create new faces.
The Jacket and Clothes constructor has both a "folds" layer wich contain the light and shadow data. Any color/camo/textile/whatever you want placed before this layer will receive the shape of the jacket or cloth.
In short, take a flat camo texture, place it before the folds layer and it will look like the original skin with your own camo.

The Soldier pack uses both normal and blend animations. The soldier_look.dsq, soldier_headside.dsq, soldier_head.dsq, and soldier_recoil.dsq animations are blend animations - they "add on" to the existing animation of the other dsq's. This means you can use them while the soldier is also playing other animations.
The Gogogo and Freeze animations can be played using a key, like the wave and salute animations the orc has. Animations to be played by key press need cel prepended to the name of the sequence dummy, so, for instance, an animation you want to call freeze should be named celfreeze.
Soldierbase.max is setup as a blank canvas for creating new animations.
Using 3dsmax 5.0 or newer, open the file soldierbase.max that came in the source files folder of the soldier pack. The soldier will appear with all the unnecessary elements hidden or frozen.
The soldier's rig was created using Jeff Gran's Torque Skeleton Generator. The arms and legs all have IK setup with Control shapes in the scene to make it easy to manipulate. To animate, simply move the slider to the frame you want, move the ik controls (or the bones directly for things like fingers) and add a keyframe.
Once your animation is done, you can setup the sequence dummy. Simply select the dummy (it's named sequencedummy) and rename it to an apprioriate name corresponding to your animation (walk2, death2, strafe...).
With the sequence dummy selected, you should see two keys for it in the Time Slider. Move these so there is one at the beginning and one at the end of your animation.
Export the sequence as a DSQ with DTS export utility or with max export to your_action.dsq.
Repeat this process for any new animation.