[RMVX ACE] BROKEN SAVE SYSTEM

Posts

Pages: 1
And thus, as I delved deep into scripting, I somehow broke my save system.

Didn't realize it was so easy to do either, but apparently something I did caused it to go borky-borky. The game itself handles the error, but when I through an error-returning script in there I get:


Script 'Game_Interpreter' line 68: NoMethodError occurred.
undefined method `+' for nil:NilClass


Which given that line 68 of the game interpreter is:
def marshal_dump
    [@depth, @map_id, @event_id, @list, @index + 1, @branch]
  end


Suggests to me that I borked something up somewhere else, and its just not able to tell me where. I do have a script to get an alternate save function (YEA's set), but disabling that still causes the same error. Any suggestions on how to ferret out where the error is?

Thanks in advance!
@index is nil (it's trying to apply the +1 to it which is causing the exception since you can't add to a nil value). You'll have to look at the script and your changes to find out why it is nil / undefined / never set.
That's the problem, I've looked around, and can't figure out where that specific thing is called during the save scene. It looks like its a more basic call deep in the way the game runs itself.
pianotm
The TM is for Totally Magical.
32367
Open a new project, and look at your save scripts there. A side-by-side comparison could give you the info you need.
Well, thankfully I didn't have to remove my scripts one by one, or start a new one and add them. Woke up this morning and thought up immediately what it was.

I have added an array to the save that does need to be save, but I guess I'm doing something wrong with it. It is supposed to hold all the information for the missions, along with whether they have been completed or not (hence why it needs to be saved).

Here is how I have it declared at the moment:
$mission = Array.new
     $mission[1] = Mission.new(1, 20, 30, 37, 8, 0, "Allie by Night", 
     "We are receiving a distress call from an alley in Paris. Our scans indicate
a Wyrd signature, along with several readings of undead in the area. Recover the 
individual and report back to base.")
     $mission[2] = Mission.new(5, 20, 0, 9, 6, 0, "Hijacking",
     "A transport plane carrying a sealed individual on route to the New York 
Bureau has been attacked by unknown Magitek forces. Board the plane and ensure the 
sealed individual is not released.")
     $mission[3] = Mission.new(2, 20, 9, 29, 8, 0, "Catacomb Cleaning",
     "The Paris Bureau is reporting an unusual amount of corruption coming from 
the catacombs under the city. Given the current state of their agents, they are 
requesting aid from the home office to clear the area.")
     $mission[4] = Mission.new(4, 20, 3, 19, 8, 0, "Blood on the Sand",
     "The Cairo Bureau requests assistance in dealing with a particularly 
troublesome vampire. He has amassed a small group of thralls, and has been raiding 
from the desert constantly. The agent they sent has gone missing, and they request 
our help in eliminating the threat.")
and I have it listed in both the create save and withdraw from save lines. The script works perfectly well if I comment out it being added to the save, so clearly when its being added its hitting a null on the index. I -thought- it would be fixed by adjusting the index numbers up from starting from starting from 0 to starting from 1, but that didn't work and I'm fresh out of ideas again >.>

Edit: Snrk, so the code as it is does the same thing it does on my sheet...stretch off the damn screen. Line breaks added for readability, but not in original script.

Edit2: Did a workaround where instead of using the mission to store whether its completed, I'm using variables. If anyone knows how to add a new array to the save file without it borking though, please let me know ^^
Pages: 1