## Wolfenstein Enemy Territory Headquarters Manual

Welcome to the ET Headquarters Manual. Here you will find all the info you need to get started with this mod.

Contents:

- Mod Installation
- Server Configuration
- Database Backend
- Lua
- Omnibot
- Character Customization Guide

### Mod Installation

The mod is installed like any other mod. It contains a client .pk3 and server binaries. Optionally you can install character customization packs (see Character Customization Guide).

The current build requires Lua and SQLite libraries to be installed:

1. Download the Libraries for your operating system:

   Linux:
   Go to Lua Binaries for Linux and download the file `lua5_1_4_Linux26g4_lib.tar.gz` (sha1: `aeb43ea226dea77ad2528acc18175c6ad72e68c1`).
   Download (in this example Ubunutu Precise i386) Lib: Ubuntu Precise i386 (sha1: `70b8895578a2fd29f2394e731ce11c55ac400dcc`).

   Windows:
   For Lua go to LuaBinaries for Windows and download the file `lua5_1_4_Win32_dll9_lib.zip` (sha1: `d16c25c64c41c34964d8504c475b69cdce6e517b`).
   For SQLite go to Sqlite Download Page and download the file `sqlite-dll-win32-x86-3080200.zip` (sha1: `3583caa55518d68e92c96fef0980980f449489ce`).

   Alternatively you can go to the lib directory from this download and get the files from there.

2. Install the two libraries in your systempath or in your ET exe directory.

### Server Configuration

There are very little options yet. Add these two lines to your server.cfg:

> +set g_xpsave 1
> +set g_dbpath "path/to/database.db"

### Database Backend

Once you have started the mod for the first time and want to enable datasavings you need to create a database. In server console you type `newdb_all`. When everything goes fine an empty database should be created at your g_dbpath. If it did not create a database, make sure you have set g_xpsave to 1 and that your g_dbpath setting is correct (it needs the name of the database file at the end of the path). Also ensure you have permissions.

Now restart the server, as otherwise it will not save already connected clients. Once restarted, type `db_status` in server console to see if everything is initialized. You should see `xpsave: initialized` and `moditemsave: initialized`. The most likely problems which can occur here are that your moditemsave is not initialiazed. This might happen when you have not configured your character customization pack correctly (see Character Customization Guide).

### Lua

The mod features a server side Lua interface. It is heavily based on etpub, which in turn is based on ETpro. This feature still needs to be tested extensively. There are likely bugs to appear and scripts which work for etpro might not work for etpub. Also: this interface is a reduced set of etpub's interface, so scripts which rely on etpub features are likely not to work in this mod. See the ETpro Lua documentation to write Lua scripts for this mod. In the future an own Lua documentation for this mod will be written.

### Omnibot

For Omnibots (the KI support for this mod) visit the Omnibots Homepage. The latest build should work. Recommended is that you do not go lower than version 0.82.

### Character Customization Guide

You can install optional character customization packs. In this small guide i am going to show you how this system works, so you can create your own item packs.

Quick Guide

If you do not want to read through the complete guide, here is what you must do to get going quickly. First download yourself an official standard item pack for this mod. It is a .pk3 file. This .pk3 file needs to be placed in the hq mod folder. Always ensure you have just one item pack installed on your server. Everything the server references will be referenced by clients.

Make adjustments to this pack or start a new one entirely from scratch. Read through mods/mods.cfg to see how it works. Then work on your .skin files, shaders and the related media. Zip it up again and place the resulting .pk3 in your hq folder. Make sure old packs are deleted before you start the server.

Overview

The system takes as input a .cfg file. This file must be located at mods/mods.cfg. If such a file is present, the mod parses the .cfg and loads up any items defined in this config file. If no file is present, no items will be loaded.

Currently the mod supports five different item types: bodyskin, faceskin, helmetskin, rankskin and headaccessoir. Each item in the mods.cfg starts with a header to identify the item. The five headers are: `BodySkin`, `FaceSkin`, `HelmetSkin`, `RankSkin`, `HeadAcc`.

Item Configuration

Each item needs to be configured. Here what each configuration token pair does.

`team <value>`
An item requirement for this item to be selected. 0 = axis, 1 = allies, 2 = none. Example: `team 1` means only Allies can apply this item.

`playerclass <value>`
An item requirement for this item to be selected. 0 = soldier, 1 = medic, 2 = engineer, 3 = fieldops, 4 = covertops, 5 = none Example: `playerclass 2` means only Engineers can apply this item.

`adminlevel <value>`
A requirement for this item to be purchased. `(not implemented yet)`

`rank <value>`
A requirement for this item to be purchased. If a clients rank is less than `<value>` he can not purchase this item.

`price <value>`
A requirement for this item to be purchased. If a clients gc bank is less than `<value>` he can not purchase this item.

`needspw <value>`
A requirement for this item to be purchased. `(not implemented yet)`

`name <string>`
A name for the item. It can not be longer than 16 chars.

`shadername <string>`
Points the mod to either a .skin file or to a shader.

`modelpath <string>`
Points the mod to a model .md3 file. This token pair is only available in item type head accessoir.

The most important are the `shadername` and `modelpath` (in case of HeadAcc), because it is here where you link the mod to your actual media files.

PackId

The mod requires you to have a section called `PackId` in `mods/mods.cfg`. It looks like this:

`PackId
{
name "somename"
}`

This has two purposes. First it tells any clients on your server what the packname is. Second, this name is connected to the database schema. So whenever you create a new pack, you should change the name, so the mod knows this is a new pack and can create a new database for it. It is needed that this name does not contain any characters which are not allowed in sqlite create table commands. So something like whitespaces will not allow the mod to create a database. Also other characters are disallowed. Best is to name it something like "justSomePack". The name defined here can be maximum 16 chars.

Examples Overview

The following examples describe how you create an item for each item type. Make adjustments wherever you need to.

We base the examples on vanilla .skin files in most cases. Note that sometimes only half of the information in the .skin files is used. The system is likely going to change in this regard in the future.

Example BodySkin

In this example we create a Bodyskin for allied, soldier.

First we define a new moditem in mods/mods.cfg

`BodySkin
{
team 1
playerclass 0
adminlevel 0
rank 1
price 1
needspw 0
name "Al Sol 01"
shadername mods/al/1/body_s.skin
}`

Then we create a .skin file for allied, soldier. Copy and rename "models/players/temperate/allied/soldier/body_soldier.skin" to "mods/al/1/body_s.skin". Open the file, it should look like this:

`md3_back, "models/players/temperate/allied/soldier/acc/backpack.md3"
md3_hat, "models/players/temperate/allied/helmet.md3"
md3_rank, "models/players/temperate/common/rank_helmet.md3"
l_legs, "models/players/temperate/allied/leg01.tga"
u_body, "models/players/temperate/allied/soldier/body.tga"
u_rthand, "models/players/temperate/allied/soldier/body.tga"
u_lfthand, "models/players/temperate/allied/soldier/body.tga"
`

md3_back, md3_hat and md3_rank is NOT USED in this mod. We need to change l_legs, u_body, u_rthand and u_lfthand. Point these to your own custom content (shaders, tga's or jpg's). Once you are done or want to test it, load it into hq mod by creating a .pk3 file of all your content. Put that .pk3 file into your hq mod folder.

Example Faceskin

In this example we create a Faceskin for no specific team or class.

First we define a new moditem in mods/mods.cfg

`FaceSkin
{
team 2
playerclass 5
adminlevel 0
rank 1
price 1
needspw 0
name "Face01"
shadername mods/none/face01.skin
}`

Then we create a .skin file for it. Copy and rename "models/players/hud/allied_soldier.skin" to "mods/none/face01.skin". Open the file, it should look like this:

`head, "models/players/hud/allied_soldier"
teeth, "models/players/hud/teeth01"
eye1, "models/players/hud/eye01"
eye2, "models/players/hud/eye01"
`

Point these to your own custom content (shaders, tga's or jpg's). Once you are done or want to test it, load it into hq mod by creating a .pk3 file of all your content. Put that .pk3 file into your hq mod folder.

Example Helmetskin

In this example we create a Helmetskin for allied, soldier.

First we define a new moditem in mods/mods.cfg

`HelmetSkin
{
team 1
playerclass 0
adminlevel 0
rank 1
price 1
needspw 0
name "Al Sol 01"
shadername mods/al/1/helmet_s.skin
}`

Then we create a .skin file for it. Copy and rename "models/players/temperate/allied/helmet_soldier.skin" to "mods/al/1/helmet_s.skin". Open the file, it should look like this:

`helmet, models/players/temperate/allied/soldier/helmet
inside, models/players/temperate/allied/inside
strap, models/players/temperate/allied/strap
`

Point these to your own custom content (shaders, tga's or jpg's). Once you are done or want to test it, load it into hq mod by creating a .pk3 file of all your content. Put that .pk3 file into your hq mod folder.

Example Rankskin

In this example we create a Rankskin for no specific team or class.

First we define a new moditem in mods/mods.cfg

`RankSkin
{
team 2
playerclass 5
adminlevel 0
rank 1
price 1
needspw 0
name "Rank 01"
shadername mods/rankmods/rank01
}`

Then we create a shader file for it. Make a new file called "scripts/rankmods.shader". Open the file and copy these lines in it:

`mods/rankmods/rank01
{
{
map mods/none/rank01.tga
alphaFunc GE128
rgbGen lightingDiffuse
}
}`

Make changes. Once you are done or want to test it, load it into hq mod by creating a .pk3 file of all your content. Put that .pk3 file into your hq mod folder.

Example Head Accessoir

In this example we create a Headaccessoir for no specific team or class.

First we define a new moditem in mods/mods.cfg

`HeadAcc
{
team 2
playerclass 5
adminlevel 0
rank 1
price 1
needspw 0
name "Cigar"
shadername mods/none/cigar.skin
modelpath mods/none/cigar.md3
}`

Then we create a .skin file for it. This skin file will look somewhat like this (dependend on how you build your .md3 model).

`cigar, mods/none/cigar`

Make changes. Once you are done or want to test it, load it into hq mod by creating a .pk3 file of all your content. Put that .pk3 file into your hq mod folder.