hexef Posted July 8, 2015 Share Posted July 8, 2015 (edited) Say I have a scripted NPC type object with over 1000 references in the world.How would I make it so I can store in the savegame file the variables info for each reference of the object in the world.For example,if I have a "int DoOnce"(and a block of code that repeats only once) in the script,can I make it so every reference in the game has its unique DoOnce variable value stored in the save file,is it possible? Edited July 8, 2015 by xqdcss Link to comment Share on other sites More sharing options...
Fallout2AM Posted July 8, 2015 Share Posted July 8, 2015 it already happens. if you create more instances of the same npc which has a script attached, every script will run on a different instance. So the DoOnce of a npc will be for him only, another npc will have its own DoOnce. I hope I understood what you mean. Link to comment Share on other sites More sharing options...
hexef Posted July 8, 2015 Author Share Posted July 8, 2015 But is it possible to store every different variable instance when I save the game? Link to comment Share on other sites More sharing options...
Fallout2AM Posted July 8, 2015 Share Posted July 8, 2015 Their value should be stored into the savegame, yes. Link to comment Share on other sites More sharing options...
hexef Posted July 9, 2015 Author Share Posted July 9, 2015 Wow I never knew about that...I thought that only quest scripts variables get stored into the savegame,thanks a lot for clearing this up for me. Link to comment Share on other sites More sharing options...
Fallout2AM Posted July 9, 2015 Share Posted July 9, 2015 If it wasn't so, everytime you load the game your companions wouldn't follow you and you should ask them again "do you want to come with me?". Their variables are usually stored in object scripts attached to them :) Link to comment Share on other sites More sharing options...
Recommended Posts