I would suggest including the one folder CSLLibrary as a whole, if it's in your override folder it's out of the way, won't cause confusion, and it won't cause any conflicts unless you specifically use it via an include. The only reason to cherry pick things is if you are editing my code, or only need one single thing and will never ever find reason to use anything else, in which case you should copy that function into your own include and rename the prefix from whatever it is, to something you use yourself.
Most of the people i talk to who get confused, are so concerned with removing files because they want to reduce confusion, are not skilled enough to properly troubleshoot the issues caused by completely removing those files. I basically tell them you need these files, they go ok but have X issue, then i trouble shoot it and find they chose they did not like how i named a given file ( it was not named "this file is needed for your issue"). I have done a LOT of work to reduce the number of files, which makes bigger files, but my priority is on making those wishing to use this to have a robust coding library which many can use - and if 2 different coders use the same library it's a complete win for the end user if they want to use both projects at the same time since the merging will already have been done.
( my bigger concern is when you see a string function, which include is it defined in, if you use my library you should after a few weeks know about where it's defined without having to look anything up )
If you don't want all of those, the CSL library base includes all the files with the "_CSLCore_" prefix. This is 31 files, and they do NOT include anything besides other "_CSLCore_" files ( and a few official files such as the switches include and nwscript.nss ). None of those should have any conflicts, or if there are any it should be pretty minimal. These are the heart of what i did, and you probably want to use these in general instead of using the vanilla game files. Again if not included they are NOT used, no risk.
These are the lowest level, and i'd recommend including all of these. Then trying compiling the files again and see if anything else is needed. I arranged things in levels, since you cannot have a recursive include of a grand child to a parent, which can get complicated especially with official code.
"_HkSpell.nss" is for the spells code, it's the second level and can include "_CSLCore_" files, but cannot be included by those files.
Special projects all have a "_SCInclude_" file, this can be custom, or it can be nothing more than taking the official code, and renaming the functions and many of the constants, and removing dependencies to other official files ( instead aiming all of these to use CSL library code ). These also include special projects. Basically instead of including hundreds of files it aims things at those 31. These might include other similar "_SCInclude_" files, but it's avoided. These can include anything in this folder.
"_SCInclude_AI.nss" for example is the actual game AI which i refactored. This means i tweaked things, combined things, but was very careful to ensure it works the same to the point it should still exhibit many of the same bugs unless i focused on them. However it does have sanity caps, merging of functionally duplicate code, removal of code which is not even being used, and some work making it so things are easier to find - and dramatically improves performance. The idea was it should work across the board as is for all users in OC and MP and SP, but fix issues with broken official code. There are issues with the official code caused by it being so massive that it does not even display normal errors, resulting in creatures just stopping without showing a TMI. It is still right near the "too much information" for the stock compiler, so be careful not to add more than a few hundred objects, this is fixed in skywings version of the compiler - i kept pruning extra objects so you might have a chance ( generally avoid including this unless it's an AI function and trigger the AI events via one of the combat functions).
Also on
http://70.179.46.242.../csl/index.html at the top of each include there is a line something like the following --> Include dependency graph for "_SCInclude_AI.nss:" which should include that, says missing file. You can use doxygen to recreate those, or look back in a bit after i get a chance to figure out why it's broken.
********
iclass is an undeclared identifier, but I'm not sure how to identify it, and _SCInclude_CacheStats has several as well. Is there another file I need to add to my campaign folder? I just don't know how to proceede.
review _CSLCore_class_c.nss, it has all the class constants in it. Basically it's classes.2da row numbers. If it's in nwscript.nss it's commented out. Related constants kaedrin or I set up are beneath each one. These are what i have negotiated or asserted as gospel in the community while i was much more active.
Here is what I'm trying. When a spell is cast at an object, record the casters spell level as a local int. and start a conversation. Seems simple enough.
Setup a spell hook. ( file is defined in your module start event like I did below )
SetLocalString(GetModule(), "X2_S_UD_SPELLSCRIPT", "_SCDexSpellHooks");
Then look at
"CSLEvents/_SCDexSpellHooks.nss"
For example i have this fail safe
if ( !GetIsObjectValid(GetAreaFromLocation(GetLocation(oCaster))) )
{
SCfizzleSpell("Invalid Area.", oCaster );
SetLocalString( oCaster, "CSL_ERRORSTRING", "Invalid Area" );
return;
}
duplicate this and adjust it so it only happens if area name is "Somearename", note there is a lot else here you can test.
if ( GetName(GetAreaFromLocation(GetLocation(oCaster)))=="Somearename" )
{
SCfizzleSpell("Start convo.", oCaster );
// trigger conversation here
return;
}
chat_dm_showspellstats.nss has code to show how to get the casters info, can be run anytime in single player to see what is going on. This uses SCCacheStatsToString which is found in _SCInclude_CacheStats.nss - these are the variables for reference.
int iHD = GetLocalInt(oChar, "SC_HitDice" );
int iNumclasses = GetLocalInt(oChar, "SC_Numclasses" );
int iNumCastingclasses = GetLocalInt(oChar, "SC_NumCastingBaseclasses" );
int iclass1 = GetLocalInt(oChar, "SC_iclass1" );
int iclass2 = GetLocalInt(oChar, "SC_iclass2" );
int iclass3 = GetLocalInt(oChar, "SC_iclass3" );
int iclass4 = GetLocalInt(oChar, "SC_iclass4" );
int iclassLevel1 = GetLocalInt(oChar, "SC_iclassLevel1" );
int iclassLevel2 = GetLocalInt(oChar, "SC_iclassLevel2" );
int iclassLevel3 = GetLocalInt(oChar, "SC_iclassLevel3" );
int iclassLevel4 = GetLocalInt(oChar, "SC_iclassLevel4" );
int iSpellPower1 = GetLocalInt(oChar, "SC_iSpellPower1" );
int iSpellPower2 = GetLocalInt(oChar, "SC_iSpellPower2" );
int iSpellPower3 = GetLocalInt(oChar, "SC_iSpellPower3" );
int iSpellPower4 = GetLocalInt(oChar, "SC_iSpellPower4" );
// summary info here, showing highest level in given class
//int iCastingclass = GetLocalInt(oChar, "SC_iCastingclasses" ); need to get rid of this
int iCasterLevels = GetLocalInt(oChar, "SC_iCasterLevels" );
int iArcaneLevels = GetLocalInt(oChar, "SC_iArcaneLevels" );
int iDivineLevels = GetLocalInt(oChar, "SC_iDivineLevels" );
int iEldritchLevels = GetLocalInt(oChar, "SC_iEldritchLevels" );
int iPsionicLevels = GetLocalInt(oChar, "SC_iPsionicLevels" );
// the highest class in each category
int iBestCasterclass = GetLocalInt(oChar, "SC_iBestCasterclass" );
int iBestArcaneclass = GetLocalInt(oChar, "SC_iBestArcaneclass" );
int iBestDivineclass = GetLocalInt(oChar, "SC_iBestDivineclass" );
int iBestEldritchclass = GetLocalInt(oChar, "SC_iBestEldritchclass" );
int iBestPsionicclass = GetLocalInt(oChar, "SC_iBestPsionicclass" );
// not sure if i need to do this, but it should help
string sclassName1 = GetLocalString(oChar, "SC_sclassName1" );
string sclassName2 = GetLocalString(oChar, "SC_sclassName2" );
string sclassName3 = GetLocalString(oChar, "SC_sclassName3" );
string sclassName4 = GetLocalString(oChar, "SC_sclassName4" );
int iCasterLevel1 = GetLocalInt(oChar, "SC_iCasterLevel1" );
int iCasterLevel2 = GetLocalInt(oChar, "SC_iCasterLevel2" );
int iCasterLevel3 = GetLocalInt(oChar, "SC_iCasterLevel3" );
int iCasterLevel4 = GetLocalInt(oChar, "SC_iCasterLevel4" );
int iCurMaxSpellLevel1 = GetLocalInt(oChar, "SC_iCurMaxSpellLevel1" );
int iCurMaxSpellLevel2 = GetLocalInt(oChar, "SC_iCurMaxSpellLevel2" );
int iCurMaxSpellLevel3 = GetLocalInt(oChar, "SC_iCurMaxSpellLevel3" );
int iCurMaxSpellLevel4 = GetLocalInt(oChar, "SC_iCurMaxSpellLevel4" );
int iPrimCasterType1 = GetLocalInt(oChar, "SC_iPrimCasterType1" );
int iPrimCasterType2 = GetLocalInt(oChar, "SC_iPrimCasterType2" );
int iPrimCasterType3 = GetLocalInt(oChar, "SC_iPrimCasterType3" );
int iPrimCasterType4 = GetLocalInt(oChar, "SC_iPrimCasterType4" );
int iPracticedCasterFeat1 = GetLocalInt(oChar, "SC_sPracticeFeatclass"+IntToString(iclass1) );
int iPracticedCasterFeat2 = GetLocalInt(oChar, "SC_sPracticeFeatclass"+IntToString(iclass2) );
int iPracticedCasterFeat3 = GetLocalInt(oChar, "SC_sPracticeFeatclass"+IntToString(iclass3) );
int iPracticedCasterFeat4 = GetLocalInt(oChar, "SC_sPracticeFeatclass"+IntToString(iclass4) );
string sSpellProgressclass1 = GetLocalString(oChar, "SC_sSpellProgressclass1" );
string sSpellProgressclass2 = GetLocalString(oChar, "SC_sSpellProgressclass2" );
string sSpellProgressclass3 = GetLocalString(oChar, "SC_sSpellProgressclass3" );
string sSpellProgressclass4 = GetLocalString(oChar, "SC_sSpellProgressclass4" );
int iBestCasterMaxSpellLevel = GetLocalInt(oChar, "SC_iBestCasterMaxSpellLevel" );
int iBestArcaneMaxSpellLevel = GetLocalInt(oChar, "SC_iBestArcaneMaxSpellLevel" );
int iBestDivineMaxSpellLevel = GetLocalInt(oChar, "SC_iBestDivineMaxSpellLevel" );
int iBestEldritchMaxSpellLevel = GetLocalInt(oChar, "SC_iBestEldritchMaxSpellLevel" );
int iBestPsionicMaxSpellLevel = GetLocalInt(oChar, "SC_iBestPsionicMaxSpellLevel" );
int iSpellSchool = GetLocalInt(oChar, "SC_iSpellSchool" );
( note that if you use my version of the AI, it uses the same variable names. The official AI was already doing the same work hundreds of times per second, and i merged the two systems and did things so it can't recalculate the following too often, you just have to call SCCacheStats( oChar ) on the creature which will ensure it's valid variables. )
Alternatively you can use the function "HkGetBestCasterLevel" which handles all of the above and example is in "SP_epicgate.nss". ( there are other ones that just look at divine or arcane levels if you look thru "_HKspell.nss".
float fDuration = RoundsToSeconds( HkGetBestCasterLevel( OBJECT_SELF ) + 40 ); // Fixed 40 round duration
or in the summons include
int iMaxAllowedSummons = ( HkGetBestCasterLevel( oCaster )*4 )-( iSummonLevel*2 );
Of course you need to learn some level of coding / nwscript / simple C syntax to make use of this. You also should use
http://70.179.46.242:8000/csl/ as a reference as you work, to see what to include.