Player Resource Consortium

 

Author Topic: PRC Compiler exiting with errors?  (Read 13185 times)

0 Members and 2 Guests are viewing this topic.

November 11, 2009, 10:29:25 AM

Hey, I've been building up a world very very slowly of late, and I decided to use PRC 3.3g to add some flair to the place. I am having some issues with getting it online to test out.

For starters, when I try to compile the scripts, I get an error and the compiler exits without completing the process. It seems to be hanging on the script prc_levelup, saying that it cannot open the include file that it refers to.

Code: [Select]


C:\NeverwinterNights\NWN\utils>CD C:\NeverwinterNights\NWN\modules\temp0

C:\NeverwinterNights\NWN\modules\temp0>C:\NeverwinterNights\NWN\utils\nwnnsscomp
.exe -cego *.nss
NeverWinter Nights Script Compiler/Decompiler
Copyright 2002-2003, Edward T. Smith
Copyright 2003, The Open Knights Consortium

Compiling: aps_include.nss
File is an include file, ignored
Compiling: area_trans.nss
Compiling: clexit_merge.nss
Compiling: fky_chat.nss
Compiling: fky_chat_clenter.nss
Compiling: fky_chat_clexit.nss
Compiling: fky_chat_cn_act.nss
Compiling: fky_chat_cn_cond.nss
Compiling: fky_chat_command.nss
Compiling: fky_chat_config.nss
File is an include file, ignored
Compiling: fky_chat_const.nss
File is an include file, ignored
Compiling: fky_chat_dmfi.nss
File is an include file, ignored
Compiling: fky_chat_dm_comm.nss
Compiling: fky_chat_event.nss
Compiling: fky_chat_fr_lang.nss
File is an include file, ignored
Compiling: fky_chat_inc.nss
File is an include file, ignored
Compiling: fky_chat_instant.nss
File is an include file, ignored
Compiling: fky_chat_levelup.nss
Compiling: fky_chat_misc.nss
File is an include file, ignored
Compiling: fky_chat_modload.nss
Compiling: fky_chat_newlang.nss
File is an include file, ignored
Compiling: fky_chat_srv.nss
Compiling: fky_chat_target.nss
Compiling: fky_chat_ventril.nss
Compiling: fky_chat_vfx.nss
File is an include file, ignored
Compiling: hif_onacquireite.nss
Compiling: hif_onactivateit.nss
Compiling: hif_onclientente.nss
Compiling: hif_onmoduleload.nss
Compiling: hif_onplayerdeat.nss
Compiling: hif_onplayerdyin.nss
Compiling: hif_onplayerequi.nss
Compiling: hif_onplayerresp.nss
Compiling: hif_onplayerrest.nss
Compiling: hif_onplayeruneq.nss
Compiling: hif_onunaquireit.nss
Compiling: levelup_merge.nss
Compiling: onactivateitem.nss
Compiling: port_m50chapel.nss
Compiling: port_start.nss
Compiling: prc_levelup.nss
prc_levelup.nss(15): Error: Unable to open the include file "prc_inc_function"
Compilation aborted with errors
Errors occurred in compiling "*.nss"

C:\NeverwinterNights\NWN\modules\temp0>CD ..

C:\NeverwinterNights\NWN\modules>PAUSE
Press any key to continue . . .



Secondly...I am using NWNX, and for some reason I am getting segfaults almost immediately on module startup. I get a few seconds of server uptime, then it crashes. The logfile indicates this:

Code: [Select]
[Tue Nov 10 13:41:57] Loading Module: The Shard Beta
[Tue Nov 10 13:42:28] Module 2da cache fingerprint: The Shard_233_1117775683
[Tue Nov 10 13:42:28] Starting to load 2da cache object from prc_datac2
[Tue Nov 10 13:43:07] Loading Module: The Shard Beta
[Tue Nov 10 13:43:50] Module 2da cache fingerprint: The Shard_973_829982243
[Tue Nov 10 13:43:50] Starting to load 2da cache object from prc_datac2
[Tue Nov 10 14:36:05] Loading Module: The Shard Beta
[Tue Nov 10 14:36:40] Module 2da cache fingerprint: The Shard_432_1339499194
[Tue Nov 10 14:36:40] Starting to load 2da cache object from prc_datac2
[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


Anyone in the know understand what could be causing this? Is there bad data that I need to fix there?
« Last Edit: November 11, 2009, 10:45:48 AM by william_hunter »


November 11, 2009, 12:08:13 PM
Reply #1
  • Hero Member
  • *****
  • Posts: 1439
  • Karma: +27/-0
  • Gender: Male
    • View Profile

Unpack prc_include.hak somewhere and use -i option to compile your scripts ie

C:\NeverwinterNights\NWN\utils\nwnnsscomp.exe -cego -i "c:\prc_include" *.nss

Should fix the problem of missing includes.
« Last Edit: November 11, 2009, 12:08:57 PM by xwarren »


November 11, 2009, 12:10:30 PM
Reply #2

http://www.nwnprc.com/downloads.php?cat_id=2

I think you need the compiler from that list of downloads, as well... not the standard compiler that comes with nwn.  I could be wrong.

I think there is an area that gets imported into your module when PRC is installed into it, that includes the caching golem.  If you removed that area and/or the golem, it might indicate why you are seeing the nwnx issues.  Again, I could be wrong.


November 11, 2009, 12:45:21 PM
Reply #3

Quote from: TigerDragon

http://www.nwnprc.com/downloads.php?cat_id=2

I think you need the compiler from that list of downloads, as well... not the standard compiler that comes with nwn.  I could be wrong.

I think there is an area that gets imported into your module when PRC is installed into it, that includes the caching golem.  If you removed that area and/or the golem, it might indicate why you are seeing the nwnx issues.  Again, I could be wrong.


I believe I am using the PRC compiler. Its been a while since I started this build process, so I will have a look, but I recall, I think, downloading and making the command file.

I will look at the mod and see if the caching golem is about. I didn't delete anything on purpose, but...


November 11, 2009, 12:53:53 PM
Reply #4

Quote from: TigerDragon

http://www.nwnprc.com/downloads.php?cat_id=2

I think you need the compiler from that list of downloads, as well... not the standard compiler that comes with nwn.  I could be wrong.

I think there is an area that gets imported into your module when PRC is installed into it, that includes the caching golem.  If you removed that area and/or the golem, it might indicate why you are seeing the nwnx issues.  Again, I could be wrong.


Also, is this golem a placeable or ana ctual creature? I don't find it in my mod at all, interestingly.


November 11, 2009, 01:16:33 PM
Reply #5

The cache creature is stored in the database and loaded from there at mod load. It will spawn itself in the limbo area. If you haven't added the limbo area to your module, the PRC won't work. It's a creature not a placeable because you can only store creatures in the database.

NWNx doesn't normally cause any issues with the prc, so I'm not sure what is going on there. Which NWNx plugins do you have?


November 11, 2009, 01:32:09 PM
Reply #6

Here is my log output showing hte plugins.

Code: [Select]

NWN Extender v2.7-beta4
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.


The export of the prc_include did indeed fix my compile problem, thanks for that folks.


November 11, 2009, 01:33:04 PM
Reply #7

Quote from: fluffyamoeba

The cache creature is stored in the database and loaded from there at mod load. It will spawn itself in the limbo area. If you haven't added the limbo area to your module, the PRC won't work. It's a creature not a placeable because you can only store creatures in the database.

NWNx doesn't normally cause any issues with the prc, so I'm not sure what is going on there. Which NWNx plugins do you have?


I do have a limbo area in my mod, put there by the erf from PRC 3.3g


November 11, 2009, 02:49:21 PM
Reply #8

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.
Code: [Select]


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:

Code: [Select]


// 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:

Code: [Select]


//::///////////////////////////////////////////////
//:: 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"));
    }
}


Code: [Select]


//::////////////////////////////////////////////////////////////////////////:://
//:: 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);
}


Code: [Select]


//::///////////////////////////////////////////////
//:: 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:

Code: [Select]

  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:
Code: [Select]

[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?
« Last Edit: November 12, 2009, 08:45:50 AM by fluffyamoeba »


November 12, 2009, 08:37:33 AM
Reply #9

Try renaming the database files so that they are lowercase. NWN generates the database files on Windows in uppercase, but IIRC, NWN on linux likes them to be lowercase. It's been years since I ran NWN on linux, but I think that will be your problem.

Also, which switches do you have set? If you have the prc switch for using nwnx set, you do not need to call the NWNx init function in your mod load as the PRC does it. If you don't have it set, then you do need to call it somewhere.


November 12, 2009, 05:22:08 PM
Reply #10

Quote from: fluffyamoeba

Try renaming the database files so that they are lowercase. NWN generates the database files on Windows in uppercase, but IIRC, NWN on linux likes them to be lowercase. It's been years since I ran NWN on linux, but I think that will be your problem.

Also, which switches do you have set? If you have the prc switch for using nwnx set, you do not need to call the NWNx init function in your mod load as the PRC does it. If you don't have it set, then you do need to call it somewhere.


Good question. I will check those, but I am almost 100% certain that they are uppercase...that would be an interestingly simple and also annoyingly obvious fix, no? So...since it will annoy me greatly, I suspect it will be correct..lol.

I'll check the switches. I think I enabled NWNx in the switches. This is good to know.


November 12, 2009, 06:31:48 PM
Reply #11

OK..looks like that fixed the immediate segfault/crash issue, Fluffy. Thanks for that.

One more question while I am at it:

What does this mean?

Code: [Select]

Thu Nov 12 17:53:46] Loading Module: The Shard Beta
[Thu Nov 12 17:54:18] Module 2da cache fingerprint: The Shard_489_1600110043
[Thu Nov 12 17:54:18] Starting to load 2da cache object from prc_datac2
[Thu Nov 12 17:54:42] Loading Module: The Shard Beta
[Thu Nov 12 18:26:33] Loading Module: The Shard Beta
[Thu Nov 12 18:27:02] Removing old PRC version databases
[Thu Nov 12 18:27:02] Module 2da cache fingerprint: The Shard_583_1831850292
[Thu Nov 12 18:27:02] Starting to load 2da cache object from prc_datac2
[b][Thu Nov 12 18:27:02] WARNING: Unable to load 2da cache object (CacheChest) from prc_datac2[/b]



November 13, 2009, 08:58:42 AM
Reply #12

I can't remember how the fingerprint is generated off the top of my head but if you change certain things about the module, it changes. This causes it to remake the database just in case you changed a 2da. I think that's all that is happening there.


November 13, 2009, 09:46:55 AM
Reply #13

I had a doubled set of database files int he database folder..I deleted the older ones and the error went away. It seems the PRC is working now, though I have not really testing much yet. Server has run overnight with no load, no crashes. That is a promising start.

Now to test the features. Wish me luck!


November 13, 2009, 10:22:36 AM
Reply #14

OK, so ..

I am seeing some issues in my beta mod: namely, my area transitions are not working. I have used the script compiler a few times. It needs to be run before the mod is saved, yes?