Starsiege Scripting Tutorial: Setting Up a Server
by Orogogus


Nondedicated? Dedicated?

There are two ways to set up a Starsiege server, non-dedicated and dedicated. A non-dedicated server is started from within Starsiege. After choosing your settings, you join the server to get it running, and it closes down when you quit, even if there are still other players in the server.

A dedicated server is more like a stand-alone program. It still uses the Starsiege.exe executable, but you don't start it from inside the game. Instead, you use a Windows shortcut (usually) to start the server. Unlike a non-dedicated server, you don't need the Starsiege CD to run a dedicated server. A dedicated server has advantages of processing power (it runs more smoothly since the player doesn't have to be in the game as a client), added customizability from the server script, and more.

In fact, there are only a handful of reasons to use a nondedicated server over a dedicated one. It's easier, for one thing, although I hope to obviate that advantage in this tutorial. It's also quicker to set up, which is handy if you just want to test out one feature on a map, or make changes to the script and retest it repeatedly. That's about it, really.


How Do I Start a Nondedicated Server?

Start up Starsiege as normal, and from the Main Menu, choose Multiplayer, and then Create Game.

From the Host Menu, you can enter your server name (as seen on on the server list), the maximum number of players, a password (optional), and the mission (i.e., the map). The Game Type field allows you to toggle between Death Match and Team Games on maps where both are available.

The tabs in the center of the screen are fairly self-explanatory. Vehicles, Weapons and Components allow you to set the limitations on permitted equipment on your server. From the Basic tab, you can choose whether to allow connections on IPX, TCP/IP, or both -- IPX only is useful for testing maps without being interrupted. The only ambiguous field is the Spawn Limit. Instead of forcing players to the wait room once they hit the spawn limit, the map ends. Sort of like the Frag Limit, except for the victims.

And that's pretty much the long and short of nondedicated servers.


How Do I Start a Dedicated Server?

This is trickier. A few dedicated server files come packaged with the game. To start one of these, go to your Starsiege folder in your Start Menu, and select one of the shortcuts under Start Dedicated Server. As mentioned before, you don't need the Starsiege CD to do this. A small application, InfiniteSpawn, should start running, and soon after that, a DOS window will appear with some rapidly scrolling text. Eventually, this will end with something like

SUCCESS on PORT 29001
deleteObject: Object "MissionGroup" doesn't exist
deleteObject: Object "MissionCleanup" doesn't exist
Executing missionStdLib.cs
Executing squadactions.cs
Executing defaultVehicles.cs
Executing DM_Avalanche.cs
Executing multiplayerStdLib.cs
Executing DMstdLib.cs
Version V 001.004r
Sending 0 players
%
At this point, the server is running and ready to accept players who join. You can type into the window to execute commands from the console. Examples:

playerlist();
Produces a list of players in the server, with a brief list of their stats, starting with their playerIDs.

say("everyone", 0, "Hello!");
Sends a message to everyone in the server. You can also send a message to just one person by replacing "everyone" with their playerID (see playerlist(); above).

quit();
Closes the server window. Infinitespawn will start a new one in a few seconds, though. If you want to stop running a server for good, click on the Quit button in the InfiniteSpawn window.

missionEndConditionMet();
Ends the current map and goes to the next on in the rotation (whereas quit(); starts over from the beginning).

It's not really a good idea to type into this window when there are people in the server, however. Due to the design of Windows, typing in the DOS box will cause massive server slowdown with every keypress (players will see cable breaks and lag). If you're not planning on running quit(); a lot, a better method is usually to set up your server for telnet and telnet into your own server from the same machine (more later).


Customizing a Dedicated Server

Examine the properties of one of the dedicated server shortcuts. If you're using Windows 98, bring up the Start Dedicated Server menu as if you were going to to run one of the shortcuts, and right click on it and then choose Properties. If you're using Windows 95, you'll have to right click on the Start Menu button instead, and browse your way into the menu before bringing up the Properties menu. Under the Shortcut tab, in the Target field, you'll see something like

C:\games\Starsiege\launch.exe infiniteSpawn starsiege -s server_DM_ALL.cs

Now, in Windows Explorer, open your Starsiege folder. If you browse through it, you should see a lot of files with names of Server_*.cs, for example Server_DM_ALL.cs. This is the file that is used by the shortcut above to initialize the server, and it contains settings like the server name, the map rotation, and more. Open Server_DM_ALL.cs in a text editor (Wordpad, if you have nothing better, I recommend EditPad) to see.

// FILENAME: Server_DM_ALL.cs
//
//Regular Deathmatch Server with no limitations


exec(serverLocation);
//-------------------------------------------------
//  RC file to start a server automatically
//-------------------------------------------------

//-------------------------------------------------
// Edit the parameters of this file to configure
// your server options. Use notepad, not a word
// processor. File must be saved as text only.
//-------------------------------------------------

//-------------------------------------------------
// Type the name for your server inside the quotes
// Must be less then 22 characters
//-------------------------------------------------
$server::Hostname =                                strcat($Location, ": DM All");

//-------------------------------------------------
// Password Protection. Leave blank for none.
// Quotes optional.
//-------------------------------------------------
$server::Password =                                 "";

//-------------------------------------------------
// Maximum player limit. 16 is highest recommended.
//-------------------------------------------------
$server::MaxPlayers =                              16;

//-------------------------------------------------
// Number of kills before server cycles.
// If zero, kills are never reset.
//-------------------------------------------------
$server::FragLimit =                               0;

//-------------------------------------------------
// Time limit in minutes before server cycles.
// Must be a positive integer.
//-------------------------------------------------
$server::TimeLimit =                               20;

//-------------------------------------------------
// Mass limit per player
// Must be a positive integer or zero for no limit.
//-------------------------------------------------
$server::MassLimit =                                0;

//-------------------------------------------------
// Combat Value limit per player
// Must be a positive integer or zero for no limit.
//-------------------------------------------------
$server::CombatValueLimit =                         0;

//-------------------------------------------------
// Team play options. TeamPlay false =  deathmatch.
// TeamPlay true = teams
//-------------------------------------------------
$server::TeamPlay =                                FALSE;

//-------------------------------------------------
// Team Mass limit - valid only when teamPlay is true
// Must be a positive integer or zero for no limit.
//-------------------------------------------------
$server::TeamMassLimit =                            0;

//-------------------------------------------------
// Team Combat Value Limit - valid only when teamPlay is true
// Must be a positive integer or zero for no limit.
//-------------------------------------------------
$server::TeamCombatValueLimit =                     0;

//-------------------------------------------------
// Tech Level Limit
// Must be a positive integer less then or
// equal to 128 or zero for no limit.
//-------------------------------------------------
$server::TechLevelLimit =                          0;

//-------------------------------------------------
// Drop In Progress
// Does server allow drop in progress??
//-------------------------------------------------
$server::DropInProgress =                            TRUE  ;

$server::AllowMixedTech =                            TRUE  ;
$server::FactoryVehOnly =                           FALSE  ;

//-------------------------------------------------
// Mission rotation list. This is the order the
// worlds will cycle in a game with either the frag
// or time limits set.
//-------------------------------------------------
$MissionCycling::Stage0 =                          "DM_Avalanche";
$MissionCycling::Stage1 =                          "DM_Terran_conquest";
$MissionCycling::Stage2 =                          "DM_Bloody_Brunch";
$MissionCycling::Stage3 =                          "DM_City_on_the_Edge";
$MissionCycling::Stage4 =                          "DM_Cold_Titan_Night";
$MissionCycling::Stage5 =                          "DM_Fear_in_Isolation";
$MissionCycling::Stage6 =                          "DM_Heavens_Peak";
$MissionCycling::Stage7 =                          "DM_Impact";
$MissionCycling::Stage8 =                          "DM_Lunacy";
$MissionCycling::Stage9 =                          "DM_Mercury_Rising";
$MissionCycling::Stage10 =                         "DM_Moonstrike";
$MissionCycling::Stage11 =                         "DM_Requiem_for_Gen_Lanz";
$MissionCycling::Stage12 =                         "DM_Sacrifice_to_Bast";
$MissionCycling::Stage13 =                         "DM_State_of_Confusion";
$MissionCycling::Stage14 =                         "DM_The_Guardian";
$MissionCycling::Stage15 =                         "DM_Twin_Siege";

//-------------------------------------------------
// Start mission. Defines which mission from the
// rotation list the server starts on.
//-------------------------------------------------
$server::Mission =                                  $MissionCycling::Stage0;

// These items will be allowed by default -- your mission script can change these
// by calling allowVehicle, allowComponent, or allowWeapon
function setAllowedItems()
{
	//Vehicles
	exec("defaultVehicles.cs");
	allowComponent(                                    all,      TRUE  );
	allowWeapon(                                       all,      TRUE  );
}
Most everything above the mission rotation list is self-explanatory. To change a setting, just type in a new value, save the file and restart the dedicated server. The mission cycling refers to map files (the pairs of .cs and .mis files) in your /Starsiege/multiplayer folder. Once the last mission in a rotation is played, it goes back to the beginning.

Advanced scripters should note that settings in this server_*.cs file will override anything in the setDefaultMissionOptions() functions of any map scripts -- don't use this function unless you specifically want a setting that is set by the dedicated server script, which will apply to any other maps in the rotation as well.

For a reference on setAllowedItems(), I recommend downloading and looking through Pincushion's Vanilla.cs file.


Special settings

There are a few semi-documented settings you can insert into the server_*.cs file.

$TelnetPort = 29001;
$TelnetPassword = "password";


These two lines will enable telnet access into your server (obviously, you want something more clever than "password"). If these lines are present when the server starts, then you can run telnet (from Run in the Start Menu, type in telnet and hit return), choose Remote Server from the Connect menu, and then enter your machine's IP address for the Host Name (run WINIPCFG from Run if you don't know it), 29001 (or whatever) for the port, and then hit Connect. Enter your password, and you'll have a server console from which you can run all the console commands listed previously (and more).

$server::TeamDamage = true;
By default in version 1.004, team damage is turned off in multiplayer games. Insert this line to turn it back on.


Creating a new dedicated server file

The easiest way to start is to copy and rename an existing server_*.cs file in the Starsiege folder, and then change it to include your choice of maps or server settings. When this is done, make a copy of a dedicated server shortcut in the Start Dedicated Server menu in the Start Menu. Win98 users right click on a shortcut and choose Make Shortcut, right click on the new one and rename it, and then right click on it again and choose Properties. Under the Target field in the Shortcut tab, change the file to point to your own server_*.cs file. For example, change

C:\Games\Starsiege\launch.exe infiniteSpawn starsiege -s Server_DM_ALL.cs

to

C:\Games\Starsiege\launch.exe infiniteSpawn starsiege -s Server_MyFile.cs

Again, Win95 users follow the same instructions, but they will have to browse into the Starsiege Start Menu folder by opening Windows Explorer into the Windows/Start Menu folder.














1