In my single player module I've been storing variables on an item with the tag Storage.
Everything works in the module, setting variables to the item, and calling them from the item all work, but these variables get lost after starting a new game with a previous character version.
For instance, I make a generic floor trigger that does
void main()
{
object oPC = GetEnteringObject();
object oStorage = GetItemPossessedBy(oPC, "Storage");
if(GetLocalInt(oStorage, "Is1") != 1){
SetLocalInt(oStorage, "Is1", 1);
}
}
And a separate trigger that
void main()
{
object oPC = GetEnteringObject();
object oStorage = GetItemPossessedBy(oPC, "Storage");
if(GetLocalInt(oStorage, "Is1") == 1){
FloatingTextStringOnCreature("dfgdsgdsgdgdgdsgdgdg", oPC);
}
}
And they both work, but if I go save character, and then new game and reload the module with the saved character the variables are all reset.
Whats going on here?
Local Variables Resetting?
Débuté par
EzRemake
, oct. 09 2012 12:50
#1
Posté 09 octobre 2012 - 12:50
#2
Posté 09 octobre 2012 - 12:59
Local variables aren't saved to the character in a local vault environment. Try running the mod as a multiplayer game using a server vault character and see if it saves then.
#3
Posté 09 octobre 2012 - 01:00
I've tried running the module on a LAN server using server vault, and it seems to work in that environment, but definitely not in the single player environment. My guess is it has something to do with a copy of a character being made without the variables being copied over?
#4
Posté 09 octobre 2012 - 01:03
So is there any reason to store variables to an item if the mod is going to be strictly single player?
I'm guessing the only reason the OC stored variables on an item would be for the load module function for chapter switches - which I assume keeps the variables?
I'm guessing the only reason the OC stored variables on an item would be for the load module function for chapter switches - which I assume keeps the variables?
#5
Posté 09 octobre 2012 - 01:04
Sorry for the double posting, seem to be getting some delays
Modifié par EzRemake, 09 octobre 2012 - 01:04 .
#6
Posté 09 octobre 2012 - 01:45
For variables on a item to be exported with an exported character the item has to be inside a bag.
hope that helps.
#7
Posté 09 octobre 2012 - 02:23
Thanks ShadowM, I'll keep that in mind when it comes time for play testing. It's annoying to have to start from scratch every time you want to test something new





Retour en haut







