User:Arek75/Installing the Linux Dedicated Server/Automatically starting NWServer when your system boots

Preparation
First, you'll want screen installed on your server. A quick check shows that it's not installed by default on Ubuntu server, so install it:

Next, you'll want to know a few of NWServer's command-line options: All of the command line options are documented on http://nwn.bioware.com/forums/viewtopic.html?topic=90645&forum=56
 * -module "name": Sets the module to load at startup ("name" needs to be the name of a module on your server, without the .mod/.nwm.  For example "Chapter1").
 * -publicserver [0/1]: [1=list2,=don't list] the server on GameSpy.
 * -reloadwhenempty [0=no/1=yes]: Reload the server when empty (resets quest states, etc)?
 * -quiet: Runs the server in quiet mode (does not use the console).  Not recommended until you get NWNX installed (use screen instead).

Finally, you'll want to make the following changes to nwnplayer.ini (settings are in bold):


 * [Game Settings]
 * Difficulty Level=3 - This will set difficulty to DnD HCR (hardcore), which is probably what you want. 2 is "normal" difficulty (if you want that instead).  1 is "easy", and 4 is "Very Difficult", which are probably not appropriate for a PW (though you might want one of those for a game with friends).


 * [Server Settings]
 * One Party Only=0 - Allows multiple parties on your server. Setting this to 1 is (probably) not desirable on a PW.
 * Max Players=32 - Sets the maximum number of players your server will allow to be on at a time. 32 seems to be a pretty good number.  If you need to go much higher than that, you should probably look into splitting your server.
 * Server Name=Your Server's Name here. - This sets the name of the server on GameSpy.
 * GameSpy Enabled=1 - And this sets whether or not the server be listed on GameSpy. Personally, I think it's better to set this to 1 and disable GameSpy on an as-needed basis from the command line.
 * Game Type=9 - This sets the game type for your server. Useful game types for PWs follow:
 * 9 = PW Action
 * 10 = PW Story
 * 3 = Role Play (Not as good for PWs as 9/10, but possibly appropriate for some RP Servers).
 * Disable AutoSave=1 - This disables the server's automatic save feature. Note that AutoSave saves the state of the module.  It does not just save characters.  Most PWs don't use module-level saves, although they could be useful.
 * CD Banned Behavior=0 - This sets whether the "banned cd keys" list is a banned list (0) or an allowed list (1). This should only be set to 1 on a test server, since it's fairly difficult to get someone's public CD Key without seeing them (as a DM) on another server first.
 * Suppress Base Servervault=1 - This hides any characters that are stored in the root of your servervault. Setting it to 0 shows those characters.
 * Disallow Shouting=0 - Setting this to 1 disables shouting. I recommend leaving it at 0 unless you are going for a full RP server and have some other reliable way for players to contact DMs.
 * ShowDMJoinedMessage=0 - This sets whether or not to inform players when a DM logs on to the server. I recommend setting this to 0, and using some other means for letting players know when a DM is available (set it to 1 on a busy day to find out why)
 * Saving Throw Automatic Failure On 1=1 - This sets whether or not 1 is an automatic failure on a save, even if a player's (or NPC's) save bonus is high enough that a roll of 1 would still succeed.
 * BackupSavedChars=0 - This sets whether to make a backup of old saved characters when exporting a new character save. Setting this to 1 will quickly fill your servervault with a bunch of characters, which can slow the server down and/or fill up the HD it's saving characters to.  Set it to 0 to avoid this.
 * Validate Spells=1 - I don't know what this does exactly, but it looks as though it could be fairly important for a PW. Leave it at 1 unless you know what you're doing.
 * Examine CR On Creatures=1 - I think this allows PCs to see how hard it would be for them to defeat a certain monster/NPC.
 * Examine Effects On Creatures=1 - I think this allows PCs to see what effects are on an NPC, even if the PC didn't create the effect.
 * PvP Setting=1 - Recommended: 1.  Possible settings:
 * 0 = No PvP - PCs cannot perform hostile actions on other PCs, and AoE spells cast by PCs don't affect PCs.
 * 1 = Party PvP - PCs can perform hostile actions on other PCs, and AoE spells cast by PCs affect other PCs unless they're in the same party as the caster.
 * 2 = Full PvP - Same as Party PvP, but AoE spells will hurt party members.
 * Reload Module When Empty=0 - Setting this to 1 will reload the module when there are no players on the server. Doing this frees some resources, but it also resets quest progress for all players, since that info isn't exported with their character files.
 * ItemLevelRestrictions=0 - This sets whether you have to be a certain level to use some items.
 * Enforce Legal Characters=1 - This sets whether or not you want the server to enforce legal characters. Only disable this if you are going to be using a subrace system.  Be aware that disabling this feature does allow unscrupulous players to exploit certain bugs in NWN to gain an advantage in play.
 * Master Server Authentication Required For Player Login=0 - This sets whether players are required to authenticate with the master server before logging in. Set this to 1 if you are having trouble with a banned player simply coming back (repeatedly) using different CD Keys.  Warning:  If you enable this, players may not be able to log in when the master server is down.
 * Account validation required during Master Server down times=0 - This sets whether you'll allow/use local account validation when the master server is down. Recommended only for small servers, since if the list gets too big it'll slow your server down significantly.

Now that you've got those things covered, let's move on.

Automatically starting the server when the system boots
This one's pretty easy, just add the following line to /etc/rc.local: