SetLocalInt(object,string,int) works perfectly
GetLocalInt(object,string) works perfectly everything turns around those 2 function
The ga_ calls the SetLocalInt the gc calls the GetLocalInt.
It can be super powerfull when used beceause you can dissociate several object/actions while using the same script for them.
But you need to be sure that the object where you set or get the value are the “good one”.
ga_setlocal_value_int
void main(string sTag,string sVariable,int iValue){
object oObjectStoredIn = GetObjectByTag(sTag);
SetLocalInt(oObjectStoredIn,sVariable,iValue);
}
int gc_getlocal_value_int
int StartingConditional(string sTag,string sVariable){
object oObjectStoredIn = GetObjectByTag(sTag);
int iValue = GetLocalInt(oObjectStoredIn,sVariable);
return iValue;
}
Those are the same functions without the wrappers. If it doesn’t work the answer is always the same :
you don’t fetch the same object with
object oObjectStoredIn = GetObjectByTag(sTag);
or sVariable hasn’t the same value
The object where you store the value in and the variable you use to name your data have to be the same with the Get function and Set function.
You give me an “Int” but ask someone else the “int” you gave me. That other person won’t give you your “int” back. You need to ask me !
I didn’t use NWN2 default wrapers for storing value, i wrote mine which are usaully super “short and dumb”
SetLocalInt(OBJECT_SELF,sVar,iValue);
int myValue = GetLocalInt(OBJECT_SELF,sVar);
I store the value in OBJECT_SELF, the Area GetArea(oObject) or the module GetModule()
If you use GlobalInt to access it everywhere you need to be sure the different modules are set correctly in the same campaign.
SetCampaignInt are absolute value that be fetch from one campaign to an other on 2 different gamplay session save and on. They are permanent and tied to the computer where they are saved.
SetGlobalInt are tied to the campaign and the save . the are “normal global variable”
SetLocalInt are tied to the object where you save them.
if the object where you store them is deletted or “killed” then destroyed, you won’t be able to access that object and will only get a 0.
Completly unrelated :
I used the trick you found for launching a movie with an XML file so it doesn 't have to be at the begining or the end of a mod, it works perfectly.