Removing missionVariables
Posted: Tue Jan 20, 2015 4:53 am
I have an OXP that stores an array of items to missionVariables kind of like this:
This works fine. However, if at one point in time the length of
How do I remove the extraneous items from the missionVariables? Or should I combine all the items into a single text entry and split it out when loading the save file? Or am I doing this all wrong in the first place?
Code: Select all
missionVariables.MyOXP_TotalListEntries = this._myList.length;
for (var i = 0; i < this._myList.length; i++) {
missionVariables["MyOXP_ListItem" + (i + 1).toString()] = this._myList[i];
}
_myList
is truncated, say from 10 items to 5, when I look at the save file, all 10 items will still be in the file, even though my save routine only saves 5.How do I remove the extraneous items from the missionVariables? Or should I combine all the items into a single text entry and split it out when loading the save file? Or am I doing this all wrong in the first place?