OK, so I think I've found the source of the issue, though I cannot understand whats gone wrong:
Terminal output. Segfault at line 26.
william@ubuntu-desktop:~/nwn$ ./nwnstartup.sh
NWNX2lib: Init
NWNX2lib: org SetString() at 0x81f41b4, new SetString() at 0xb80bffbb
NWNX2lib: org GetObj() at 0x81f40bc, new GetObj() at 0xb80bf9ed
* Parsing configuration...
NWN Extender v2.7-beta4
(c) 2004 by the APS/NWNX Linux Conversion Group
(c) 2007-2008 by virusman
Based on the Win32 version (c) 2003 by Ingmar Stieger (Papillon)
and Jeroen Broekhuizen
visit us at http://www.avlis.org
* Loading modules...
TMI plugin Registered.
FIXES plugin Registered.
LETO plugin Registered.
CHAT plugin Registered.
PROFILER plugin Registered.
RESETPLUGIN plugin Registered.
FUNCTIONS plugin Registered.
EVENTS plugin Registered.
RESMAN plugin Registered.
MNX plugin Registered.
STRUCTS plugin Registered.
HASHSET plugin Registered.
ODBC plugin Registered.
* NWNX2 activated.
Neverwinter Nights Server
Build:8109
Copyright BioWare Corp 1998-2004
Server: Loading...
Server: Running...
Server: Loading module "The Shard Beta"........................
Server: Module loaded
INIT(S): valid ret=0x082041ec
./nwnstartup.sh: line 26: 24126 Segmentation fault ./nwserver -publicserver 1 -servername "The Shard Beta" -port 5121 -dmpassword "password" -oneparty 0 -pvp 0 -difficulty 3 -elc 0 -ilr 0 -reloadwhenempty 0 -module "The Shard Beta" -maxclients 32 -servervault 1 -maxlevel 40 -gametype 1 -autosaveinterval 0 "$@"
NWNX2lib: Init
./nwnstartup.sh: line 26: 24133 Segmentation fault sleep 5
So, looking at the code for the modload:
// prc_onmodload,x2_mod_def_load
/////////////////////////////////////////////////////////////////////
//
// This script has been auto-generated by HakInstaller to call
// multiple handlers for the onmoduleload event.
//
/////////////////////////////////////////////////////////////////////
void main()
{
ExecuteScript("prc_onmodload", OBJECT_SELF);
ExecuteScript("x2_mod_def_load", OBJECT_SELF);
ExecuteScript("fky_chat_modload", OBJECT_SELF);
}
Then I looked into the 3 scripts being called:
//::///////////////////////////////////////////////
//:: PRC On Module Load event handler
//:: prc_onmodload
//::///////////////////////////////////////////////
/** @file prc_onmodload
Things we need to happen upon a module being
loaded. For example, setting up caches and
switches.
*/
//:://////////////////////////////////////////////
//:://////////////////////////////////////////////
#include "prc_alterations"
#include "prc_inc_leadersh"
#include "inc_switch_setup"
#include "inc_cache_setup"
#include "inc_sql"
//////////////////////////////////////////////////
/* Function prototypes */
//////////////////////////////////////////////////
void OnLoad_Always(object oModule);
void OnLoad_Save(object oModule);
void OnLoad_Fresh(object oModule);
//////////////////////////////////////////////////
/* Function definitions */
//////////////////////////////////////////////////
void CheckDB()
{
string sDBName = GetBiowareDBName();
//check PRC version
if(GetCampaignString(sDBName, "version") != PRC_VERSION)
{
DoDebug("Removing old PRC version databases");
DestroyCampaignDatabase(sDBName);
DestroyCampaignDatabase(COHORT_DATABASE);
}
SetCampaignString(sDBName, "version", PRC_VERSION);
// 2da cache fingerprint handling
// This is for detecting a cache updated by someone else upon loading a saved game
// and avoiding clobbering it.
string sFingerprint;
// Generate the fingerprint from module name, current millisecond value and
// 31-bit random number.
sFingerprint = GetModuleName() + "_" + IntToString(GetTimeMillisecond()) + "_" + IntToString(Random(0x7fffffff));
DoDebug("Module 2da cache fingerprint: " + sFingerprint);
// Store the fingerprint on the module - it will be written to the DB upon cache storage
SetLocalString(GetModule(), "PRC_2DA_Cache_Fingerprint", sFingerprint);
// Also store the fingerprint of the DB we will be loading shortly
SetLocalString(GetModule(), "PRC_2DA_Cache_Fingerprint_LastAccessed", GetCampaignString(sDBName, "PRC_2DA_Cache_Fingerprint"));
location lLoc = GetLocation(GetObjectByTag("HEARTOFCHAOS"));
//only get it if one doesnt already exist (saved games)
// This never gets run on saved games due to the "prc_mod_load_done" check.
// However, it is still usefull cleanup in case some unforseen condition does
// leave a cache object present in a freshly loaded module - Ornedan 20061229
if(GetIsObjectValid(GetObjectByTag("Bioware2DACache")))
DestroyObject(GetObjectByTag("Bioware2DACache"));
DoDebug("Starting to load 2da cache object from " + sDBName);
object oChest = RetrieveCampaignObject(sDBName, "CacheChest", lLoc);
if(!GetIsObjectValid(oChest))
DoDebug("WARNING: Unable to load 2da cache object (CacheChest) from " + sDBName);
else
DoDebug("Finished loading 2da cache object from " + sDBName);
}
/**
* Called when a saved game load is detected. Determines if the
* 2da cache DB has changed in the meanwhile. If it has, reload the
* cache creature from the DB.
*/
void CheckDBUpdate()
{
// Get last loaded (or saved) and DB fingerprints
string sDBName = GetBiowareDBName();
string sModuleFingerprint = GetLocalString(GetModule(), "PRC_2DA_Cache_Fingerprint_LastAccessed");
string sDBFingerprint = GetCampaignString(sDBName, "PRC_2DA_Cache_Fingerprint");
DoDebug("CheckDBUpdate():\n"
+ " Module last access fingerprint: " + sModuleFingerprint + "\n"
+ " Database fingerprint: " + sDBFingerprint
);
// If they differ, the DB has changed in meanwhile and we need to reload the cache chest
if(sModuleFingerprint != sDBFingerprint)
{
DoDebug("Fingerprint mismatch, reloading 2da cache from " + sDBName);
location lLoc = GetLocation(GetObjectByTag("HEARTOFCHAOS"));
DestroyObject(GetObjectByTag("Bioware2DACache"));
DoDebug("Starting to load 2da cache object from " + sDBName);
object oChest = RetrieveCampaignObject(sDBName, "CacheChest", lLoc);
if(!GetIsObjectValid(oChest))
DoDebug("ERROR: Unable to load 2da cache object (CacheChest) from " + sDBName);
else
DoDebug("Finished loading 2da cache object from " + sDBName);
// Updated last access fingerprint
SetLocalString(GetModule(), "PRC_2DA_Cache_Fingerprint_LastAccessed", sDBFingerprint);
}
}
void main()
{
object oModule = GetModule();
OnLoad_Always(oModule);
// Determine if we are loading a saved game or entering a fresh module
// Some things should only be run in one situation or the other.
if(GetLocalInt(oModule, "prc_mod_load_done"))
{
OnLoad_Save(oModule);
}
else
{
SetLocalInt(oModule, "prc_mod_load_done", TRUE);
OnLoad_Fresh(oModule);
}
}
/**
* Things that should always be run on loading a module,
* irrespective of whether it's a fresh load or a save.
*/
void OnLoad_Always(object oModule)
{
//this triggers NWNX on Linux
SetLocalInt(oModule, "NWNX!INIT", 1);
SetLocalString(oModule, "NWNX!INIT", "1");
}
/**
* Things that should be run only when a saved game is loaded.
*/
void OnLoad_Save(object oModule)
{
CheckDBUpdate();
}
/**
* Things that should only be run when a module is first loaded.
*/
void OnLoad_Fresh(object oModule)
{
// Set PRC presence & version marker. If plugins ever happen, this would be useful.
SetLocalString(oModule, "PRC_VERSION", PRC_VERSION);
SetModuleSwitch(MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS, TRUE); /// @todo This is somewhat intrusive, make it unnecessary and remove
// Run a script to determine if the PRC Companion is present
ExecuteScript("hakmarker", OBJECT_SELF);
//load any default switch 2da
object oModule = GetModule();
int i = 0;
string sSwitchName, sSwitchType, sSwitchValue;
// Use Get2DAString() instead of Get2DACache() to avoid caching.
// People might want to set different switch values when playing in different modules.
// Or just change the switch values midplay.
while((sSwitchName = Get2DAString("personal_switch", "SwitchName", i)) != "")
{
// Read rest of the line
sSwitchType = Get2DAString("personal_switch", "SwitchType", i);
sSwitchValue = Get2DAString("personal_switch", "SwitchValue", i);
// Determine switch type and set the var
if (sSwitchType == "float")
SetLocalFloat(oModule, sSwitchName, StringToFloat(sSwitchValue));
else if(sSwitchType == "int")
SetPRCSwitch(sSwitchName, StringToInt(sSwitchValue));
else if(sSwitchType == "string")
SetLocalString(oModule, sSwitchName, sSwitchValue);
// Increment loop counter
i += 1;
}
//delay this to avoid TMIs
DelayCommand(0.01, CreateSwitchNameArray());
DelayCommand(0.01, DoEpicSpellDefaults());
DelayCommand(0.01, DoSamuraiBanDefaults());
SetDefaultFileEnds();
if(GetPRCSwitch(PRC_CONVOCC_ENABLE))
{
SetPRCSwitch(PRC_USE_DATABASE, TRUE);
//SetPRCSwitch(PRC_DB_PRECACHE, TRUE);
SetPRCSwitch(PRC_USE_LETOSCRIPT, TRUE);
// set up the convoCC combination switches
if(GetPRCSwitch(PRC_CONVOCC_ENFORCE_FEATS))
{
SetPRCSwitch(PRC_CONVOCC_ENFORCE_BLOOD_OF_THE_WARLORD, TRUE);
SetPRCSwitch(PRC_CONVOCC_ENFORCE_FEAT_NIMBUSLIGHT, TRUE);
SetPRCSwitch(PRC_CONVOCC_ENFORCE_FEAT_HOLYRADIANCE, TRUE);
SetPRCSwitch(PRC_CONVOCC_ENFORCE_FEAT_SERVHEAVEN, TRUE);
SetPRCSwitch(PRC_CONVOCC_ENFORCE_FEAT_SAC_VOW, TRUE);
SetPRCSwitch(PRC_CONVOCC_ENFORCE_FEAT_VOW_OBED, TRUE);
SetPRCSwitch(PRC_CONVOCC_ENFORCE_FEAT_THRALL_TO_DEMON, TRUE);
SetPRCSwitch(PRC_CONVOCC_ENFORCE_FEAT_DISCIPLE_OF_DARKNESS, TRUE);
SetPRCSwitch(PRC_CONVOCC_ENFORCE_FEAT_LICHLOVED, TRUE);
SetPRCSwitch(PRC_CONVOCC_ENFORCE_FEAT_EVIL_BRANDS, TRUE);
SetPRCSwitch(PRC_CONVOCC_ENFORCE_FEAT_VILE_WILL_DEFORM, TRUE);
SetPRCSwitch(PRC_CONVOCC_ENFORCE_FEAT_VILE_DEFORM_OBESE, TRUE);
SetPRCSwitch(PRC_CONVOCC_ENFORCE_FEAT_VILE_DEFORM_GAUNT, TRUE);
SetPRCSwitch(PRC_CONVOCC_ENFORCE_FEAT_LOLTHS_MEAT, TRUE);
}
if(GetPRCSwitch(PRC_CONVOCC_ENFORCE_PNP_RACIAL))
{
SetPRCSwitch(PRC_CONVOCC_RAKSHASA_FEMALE_APPEARANCE, TRUE);
SetPRCSwitch(PRC_CONVOCC_GENASI_ENFORCE_DOMAINS, TRUE);
SetPRCSwitch(PRC_CONVOCC_DROW_ENFORCE_GENDER, TRUE);
SetPRCSwitch(PRC_CONVOCC_TIEFLING_TAIL, TRUE);
SetPRCSwitch(PRC_CONVOCC_FEYRI_TAIL, TRUE);
SetPRCSwitch(PRC_CONVOCC_FEYRI_WINGS, TRUE);
SetPRCSwitch(PRC_CONVOCC_AVARIEL_WINGS, TRUE);
}
}
if(GetPRCSwitch(PRC_USE_BIOWARE_DATABASE) == 0)
SetPRCSwitch(PRC_USE_BIOWARE_DATABASE, 300);//100 HBs = 1800sec = 30min
if(GetPRCSwitch(PRC_USE_BIOWARE_DATABASE))
DelayCommand(1.0, CheckDB());
if(GetPRCSwitch(PRC_USE_DATABASE))
{
PRC_SQLInit();
if(GetPRCSwitch(PRC_DB_SQLITE))
StartSQLiteCommitHB();
}
if(GetPRCSwitch(PRC_DB_PRECACHE))
Cache_2da_data();
//pre-made cohorts
//DelayCommand(6.0, AddPremadeCohortsToDB());
//done differently now
//check for letoscript dir
/* if(GetLocalString(oModule, PRC_LETOSCRIPT_NWN_DIR) == "")
{
string sDir = Get2DACache("directory", "Dir", 0);
if(sDir != "")
SetLocalString(oModule, PRC_LETOSCRIPT_NWN_DIR, sDir);
} */
//delay the 2da lookup stuff
DelayCommand(12.0, MakeLookupLoopMaster());
//mark server as loading
float fDelay = IntToFloat(GetPRCSwitch(PRC_PW_LOGON_DELAY))*60.0;
if(fDelay>0.0)
{
SetLocalInt(GetModule(), PRC_PW_LOGON_DELAY+"_TIMER", TRUE);
DelayCommand(fDelay, DeleteLocalInt(GetModule(), PRC_PW_LOGON_DELAY+"_TIMER"));
}
}
//::////////////////////////////////////////////////////////////////////////:://
//:: SIMTools V3.0 Speech Integration & Management Tools Version 3.0 :://
//:: Created By: FunkySwerve :://
//:: Created On: April 4 2006 :://
//:: Last Updated: March 27 2007 :://
//:: With Thanks To: :://
//:: Dumbo - for his amazing plugin :://
//:: Virusman - for Linux versions, and for the reset plugin, and for :://
//:: his excellent events plugin, without which this update would not :://
//:: be possible :://
//:: Dazzle - for his script samples :://
//:: Butch - for the emote wand scripts :://
//:: The DMFI project - for the languages conversions and many of the emotes:://
//:: Lanessar and the players of the Myth Drannor PW - for the new languages:://
//:: The players and DMs of Higher Ground for their input and playtesting :://
//::////////////////////////////////////////////////////////////////////////:://
#include "fky_chat_inc"
#include "x2_inc_switches"
void main()
{
// Init placeholders for ODBC gateway
SQLInit();
// Init placeholders for chat gateway
InitSpeech();
SetModuleSwitch(MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS ,TRUE);
}
//::///////////////////////////////////////////////
//:: Example XP2 OnLoad Script
//:: x2_mod_def_load
//:: (c) 2003 Bioware Corp.
//:://////////////////////////////////////////////
/*
Put into: OnModuleLoad Event
This example script demonstrates how to tweak the
behavior of several subsystems in your module.
For more information, please check x2_inc_switches
which holds definitions for several variables that
can be set on modules, creatures, doors or waypoints
to change the default behavior of Bioware scripts.
Warning:
Using some of these switches may change your games
balancing and may introduce bugs or instabilities. We
recommend that you only use these switches if you
know what you are doing. Consider these features
unsupported!
Please do NOT report any bugs you experience while
these switches have been changed from their default
positions.
Make sure you visit the forums at nwn.bioware.com
to find out more about these scripts.
*/
//:://////////////////////////////////////////////
//:: Created By: Georg Zoeller
//:: Created On: 2003-07-16
//:://////////////////////////////////////////////
#include "x2_inc_switches"
#include "x2_inc_restsys"
void main()
{
if (GetGameDifficulty() == GAME_DIFFICULTY_CORE_RULES || GetGameDifficulty() == GAME_DIFFICULTY_DIFFICULT)
{
// * Setting the switch below will enable a seperate Use Magic Device Skillcheck for
// * rogues when playing on Hardcore+ difficulty. This only applies to scrolls
SetModuleSwitch (MODULE_SWITCH_ENABLE_UMD_SCROLLS, TRUE);
// * Activating the switch below will make AOE spells hurt neutral NPCS by default
// SetModuleSwitch (MODULE_SWITCH_AOE_HURT_NEUTRAL_NPCS, TRUE);
}
// * AI: Activating the switch below will make the creaures using the WalkWaypoint function
// * able to walk across areas
// SetModuleSwitch (MODULE_SWITCH_ENABLE_CROSSAREA_WALKWAYPOINTS, TRUE);
// * Spells: Activating the switch below will make the Glyph of Warding spell behave differently:
// * The visual glyph will disappear after 6 seconds, making them impossible to spot
// SetModuleSwitch (MODULE_SWITCH_ENABLE_INVISIBLE_GLYPH_OF_WARDING, TRUE);
// * Craft Feats: Want 50 charges on a newly created wand? We found this unbalancing,
// * but since it is described this way in the book, here is the switch to get it back...
// SetModuleSwitch (MODULE_SWITCH_ENABLE_CRAFT_WAND_50_CHARGES, TRUE);
// * Craft Feats: Use this to disable Item Creation Feats if you do not want
// * them in your module
// SetModuleSwitch (MODULE_SWITCH_DISABLE_ITEM_CREATION_FEATS, TRUE);
// * Palemaster: Deathless master touch in PnP only affects creatures up to a certain size.
// * We do not support this check for balancing reasons, but you can still activate it...
// SetModuleSwitch (MODULE_SWITCH_SPELL_CORERULES_DMASTERTOUCH, TRUE);
// * Epic Spellcasting: Some Epic spells feed on the liveforce of the caster. However this
// * did not fit into NWNs spell system and was confusing, so we took it out...
// SetModuleSwitch (MODULE_SWITCH_EPIC_SPELLS_HURT_CASTER, TRUE);
// * Epic Spellcasting: Some Epic spells feed on the liveforce of the caster. However this
// * did not fit into NWNs spell system and was confusing, so we took it out...
// SetModuleSwitch (MODULE_SWITCH_RESTRICT_USE_POISON_TO_FEAT, TRUE);
// * Spellcasting: Some people don't like caster's abusing expertise to raise their AC
// * Uncommenting this line will drop expertise mode whenever a spell is cast by a player
// SetModuleSwitch (MODULE_VAR_AI_STOP_EXPERTISE_ABUSE, TRUE);
// * Item Event Scripts: The game's default event scripts allow routing of all item related events
// * into a single file, based on the tag of that item. If an item's tag is "test", it will fire a
// * script called "test" when an item based event (equip, unequip, acquire, unacquire, activate,...)
// * is triggered. Check "x2_it_example.nss" for an example.
// * This feature is disabled by default.
SetModuleSwitch (MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS, TRUE);
if (GetModuleSwitchValue (MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS) == TRUE)
{
// * If Tagbased scripts are enabled, and you are running a Local Vault Server
// * you should use the line below to add a layer of security to your server, preventing
// * people to execute script you don't want them to. If you use the feature below,
// * all called item scrips will be the prefix + the Tag of the item you want to execute, up to a
// * maximum of 16 chars, instead of the pure tag of the object.
// * i.e. without the line below a user activating an item with the tag "test",
// * will result in the execution of a script called "test". If you uncomment the line below
// * the script called will be "1_test.nss"
// SetUserDefinedItemEventPrefix("1_");
}
// * This initializes Bioware's wandering monster system as used in Hordes of the Underdark
// * You can deactivate it, making your module load faster if you do not use it.
// * If you want to use it, make sure you set "x2_mod_def_rest" as your module's OnRest Script
// SetModuleSwitch (MODULE_SWITCH_USE_XP2_RESTSYSTEM, TRUE);
if (GetModuleSwitchValue(MODULE_SWITCH_USE_XP2_RESTSYSTEM) == TRUE)
{
// * This allows you to specify a different 2da for the wandering monster system.
// SetWanderingMonster2DAFile("des_restsystem");
//* Do not change this line.
WMBuild2DACache();
}
}
So, line 26 is about:
DoDebug("Starting to load 2da cache object from " + sDBName);
object oChest = RetrieveCampaignObject(sDBName, "CacheChest", lLoc);
if(!GetIsObjectValid(oChest))
DoDebug("WARNING: Unable to load 2da cache object (CacheChest) from " + sDBName);
else
DoDebug("Finished loading 2da cache object from " + sDBName);
Which is where the CacheChest is loaded from the database into Limbo...which is apparently not happening.
Last few lines from my logfile after crash on load:
[Wed Nov 11 09:57:57] Loading Module: The Shard Beta
[Wed Nov 11 09:58:31] Module 2da cache fingerprint: The Shard_352_1061460218
[Wed Nov 11 09:58:31] Starting to load 2da cache object from prc_datac2
Help?