HiddenTradition_PRC8/_module/nss/no_mod_def_load.nss
2024-06-20 15:47:42 -04:00

85 lines
2.7 KiB
Plaintext

//::///////////////////////////////////////////////////////////////////////////
// no_mod_def_load
// ScrewTape's 2DA xptable read
//::///////////////////////////////////////////////
//:: Example XP2 OnLoad Script
//////////////////////
/////////////////////////////////////////////////////////
// *****INSTRUCTIONS*****
// Add ExecuteScript(2da_read); somewhere, (beginning or end, doesn't really
// matter) of OnModuleLoad script
// Example of how to use this script in x2_mod_def_load
/*
//:://////////////////////////////////////////////
//:: Created By: Georg Zoeller
//:: Created On: 2003-07-16
//:://////////////////////////////////////////////
#include "x2_inc_switches"
#include "x2_inc_restsys"
void main()
{
// bioware or custom OnModuleLoad code
// ============================================================================
// Start of modified behavior
ExecuteScript("no_mod_def_load", OBJECT_INVALID);
// End of modified behavior
// ============================================================================
} */
// ============================================================================
// Start of no_mod_def_load
///////////////////////////////////////////////////////////////////////////////
// no_mod_def_load, inputs: none, outputs: none (returned)
void main()
{
// Module limits - will run as is for all combinations
// tested with no problems on my machine reading the entire table.
// Check your log file \NeverwinterNights\NWN\logs\nwclientLog1.txt for
// "Read Error in 2DA_XP_#v#". If you get one or more of these, try changing
// these limits to what you expect for your module, accounting for levels
// the characters might gain. Remove the // before the two lines after
// "// log our results" (not this line - this is a comment :) to get the
// table printed to the log file.
int MIN_CR = 0;
int MAX_CR = 40;
int MIN_LEVEL = 1;
int MAX_LEVEL = 40;
// don't edit these :)
string sXpPerLvl = "";
int nCR = 0;
int nLevel = 0;
int nXP = 0;
for (nLevel = MIN_LEVEL; nLevel <= MAX_LEVEL; nLevel++)
{
for (nCR = MIN_CR; nCR <= MAX_CR; nCR++)
{
// Thanks to *** arQon *** for this idea
sXpPerLvl = "2DA_XP_" + IntToString(nLevel) + "v" + IntToString(nCR);
nXP = StringToInt(
Get2DAString("xptable", "C" + IntToString(nCR), (nLevel - 1)));
if (nXP <= 0 || nXP > 600)
PrintString("Read Error in " + sXpPerLvl);
SetLocalInt(GetModule(), sXpPerLvl, nXP);
// log our results
//string sMessage = sXpPerLvl + " = " + IntToString(nXP);
//PrintString(sMessage);
}
}
}
// End of no_mod_def_load
// ============================================================================