Save and load frame not working at all
Save frame isn't working. I'm trying to keep the state of the main game while I switch to another frame (a spell selection screen), so the plan was to save the frame, switch to the spell selector, switch back, and load the previous state of the main window. So I tried saving the frame and then switching. But no file was ever saved. I tried splitting it into two events. I tried forming the path a dozen different ways. No file was ever saved. It didn't save until I removed everything except the save command (including the command to move to the new frame) and even then it refused to load it, saying it was saved with an incompatible version.
What gives?
Re: Save and load frame not working at all
Can you send me your application? (tell me what to do to save the frame please)
Re: Save and load frame not working at all
Any word on this? Is it a bug or am I doing something wrong?
Re: Save and load frame not working at all
you want to make something like this?
http://www.sendspace.com/file/lo8g89
Re: Save and load frame not working at all
What I'm trying to do isn't even that complicated.
The custom data that I want to save to external files is already working (via the Named Variable object). All I need from the save and load frame actions is just that--they only need to store the current state of the frame's active objects. However, they aren't storing anything. In fact, under most circumstances they aren't even creating a file. The rest of the time they won't read the file.
All I'm trying to do is switch from one frame to the other without resetting either frame.
So basically the event sequence is:
Frame 1:
Frame 1 Starts: Load previous frame 1 file if frame 1 loading flag is set
Command to load Frame 2: Save Frame 1 > Set frame 1 Loading Flag > Goto Frame 2
Frame 2:
Frame 2 Starts: Load previous frame 2 file, if frame 2 loading flag is set
Command to load Frame 1: Save Frame 2 > Set frame 2 Loading Flag > Goto Frame 1
Out of the above, everything is confirmed as working exactly as it should be except the file loading and saving.
The saving will not work under any circumstance except one--I have to take every other command out of the event and I have to specify an *exact* path to the file. (I can't have a simple filename, generic pathname, a relative pathname, or an evaluated pathname, and I can't have the save action be in the same event as any other action. i.e. "Myfile.mfa" won't work, apppath$ + "Myfile.mfa" won't work, and ".\Myfile.mfa" won't work. Only "F:\MMF2\My Project\Myfile.mfa" works.)
The loading will not work under any circumstance. Under most circumstances it just won't do anything and won't give any indication as to why nothing happened. (Can I add some sort of bug reporting to MMF2's wishlist here?)
If I sledgehammer it into loading the same way I do with the saving, it says something a little bit different each time, but each time it's some variety of "Umm, no." It says anything from the file was written with the wrong version of the program to it isn't a valid file type at all.
I'm just trying to use the absolute most basic functionality of the save frame action and it isn't working.
Re: Save and load frame not working at all
Can you send Francois the file?
I have not have any problems with the frame saving and loading.
I think thats the only realy way for someone to help you out by looking at your exact situation.
I save and load using apppath$ and its working great here :(
Also before that make sure your using build 247 as I think there was an error in old builds.
Re: Save and load frame not working at all
I sent the file to Francois a while ago (a few days after he asked, as I recall). I confirmed I am using the latest build.
Re: Save and load frame not working at all
I'm sorry, I did not have time to look at it. I wont be able to do it before the end of next week (I'll be away).
Sorry for that.
Re: Save and load frame not working at all
Maggott -- I can take a look if you want but may not be able to do anything but confirm its broken.
Re: Save and load frame not working at all
Righto. I've uploaded it for all the world to see. It's a little over 8 megs zipped.
http://www.ghazporkindustrial.com/Legacy_SaveTest.zip
Re: Save and load frame not working at all
Uh, you want to load "curgame.msv", but the file's name is GameData.csv... I think that's the problem?
There are some errors I cant get rid of, missing files... please try on your own.
Re: Save and load frame not working at all
Wow -- Well my first question would be are you sure the event where you ask the frame to save is being triggered?
Also what if you delay the jump to frame 2 to give the computer a bit to produce the file. Perhaps with a large amount of data its saving it needs to hang on for a second.
I have not done any testing but I also save using Apppath$+"filename.mfs" -- Honestly not sure if that makes a difference or not .. I should test someday to find out.
I can't run this to play around as its missing PNG files and it throws up errors.
Re: Save and load frame not working at all
I was playing around with this and had some advice from Yves on it.
You have to be pretty careful with saving the save file and it seems you can't jump to a new frame right away.
You would want to save your file and then set a flag or variable.
Test that flag/variable on an event that is above the saving event.
The file is saved at the end of the event stack so you want to be sure to jump to the next frame on the next event loop.
Re: Save and load frame not working at all
Aah, okay. Yes, waiting for a full event cycle before moving to the next frame seemed to fix it.
Thank you.
Re: Save and load frame not working at all
Well, the saving and loading seems to be working insofar as restoring the positions of objects and stuff, but now it seems to be making the rest of the program go crazy. The objects lose their speed and maximum speed, objects blink in and out, and all kinds of graphical glitches show up.
I've updated the version linked above to demonstrate. It should be pretty obvious what's going wrong; just switch between the screens (hit "`" once to go to the ability screen, then hit it again to go back) and stuff will start going nuts.
Re: Save and load frame not working at all
Quote:
Uh, you want to load "curgame.msv", but the file's name is GameData.csv... I think that's the problem?
GameData.csv is universal game data used by the Named Variable object. It stores things like spell data, monster statistics, and so forth. It only loads once at the very beginning of the game. That's what all that data on the left hand side of the screen is. It is not related to the frame transitions.
It's included because otherwise other parts of the game won't work right and it would be hard to test the frame saving (all the monsters would die instantly, for one thing...)
Quote:
There are some errors I cant get rid of, missing files... please try on your own.
I try just about everything I can think of before I come here. If I post a problem, I've usually already been smashing against it for hours if not days.
Not everybody who uses MMF comes running to the forums if something doesn't work perfectly the first time. I don't want to waste anybody's time on trivial questions any more than I would want them wasting mine. But some things just can't be attributed to "not trying" because they aren't things you can realistically figure out on your own (such as not knowing the difference between realtime and evaluated event triggers, how the engine picks object instances and how event choice and ordering affects that, or--in this case--that certain commands don't execute in the order they're given and won't execute properly at all if given in combination with certain others in the same event loop.)