Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

Advanced Saving/Loading for MMFX


LarkSS

Recommended Posts

http://www.freewebs.com/sonic_softdatabase1/Advanced_Saving&Loading_for_MMFX.zip

Alternate:

http://www.sfghqmb.com/attachment.php?attachmentid=14&stc=1&d=1149672840

Just right-click it and choose save target as or copy and paste it in the address bar.

This shows how to make saving and loading objects work for MMFX ONLY. It does it instantly by combining the global array object and the fastloop object. All extensions and dlls required are included with the zip. This may be helpful to someone who's interested in making a level editting feature or external level packs for a game.

To place an object, double-leftclick. To move an object, leftclick once, hold it down, and move the mouse. To delete an object, rightclick. If you want to load or save a 'level', type in the name and choose save or open in the menu options. You can test your 'level' by clicking test level in the options and stop testing by clicking stop test. That's it really.

If you want to use it, you'll have to understand the basics before editting it. There's barely any events. Many of them are for level testing and menu selection.

Remember to give credit to LarkSS if used. Enjoy... I guess. =p

BTW, there are no comments for the events. Maybe someone might put in the time to do so, but I doubt it.

MMF version is now complete!

...And fully commented!

+ 3 extra levels!

http://www.freewebs.com/sonic_softdatabase1/Save&LoadMMF.zip

Alternate:

http://www.sfghqmb.com/attachment.php?attachmentid=15&stc=1&d=1149672840

Controls

*Editor*

Double-LeftClick = Place Object

Single-LeftClick+Hold = Move Object/Arrow

Single-RightClick = Delete Object

*LeftClick+Hold*+Left = Change Object Left

*LeftClick+Hold*+Right = Change Object Right

*Test Play*

RightArrow = Move Right

LeftArrow = Move Left

Shift = Jump

Link to comment
Share on other sites

I would gladly comment all this for you since I'm pretty experienced with Level Editors now (Still working on my own engine for it though) but it seems that no matter what I do with the Global Array object, MMF continues telling me it can't find it. =< Yes, I've put it in the Extensions and Data\Runtime folders and done several checks but MMF refuses to recognize it.

MMF 1.5, Build 119 if you want to know.

Link to comment
Share on other sites

Yes, the extension doesn't exist for MMF. I actually don't know how I got it. =p It came with MMFX. I may make a MMF and TGF version later with string support so you can save more objects. I believe though that MMF has an extension to save and load stuff like the thing I made.

Link to comment
Share on other sites

Not regularly anyway. I probably should have used an extension that MMF has also, but it's the only global array object for MMFX that can save and load its values and strings. BTW, just so you know, MMFX stands for Multimedia Fusion Express. It's supposed to be an upgrade for Click n' Create like USC said, but all it does for me is prevent me from changing animation speeds. =/

  • Like 1
Link to comment
Share on other sites

Oh, Express, right. ^_^;; I know what you're talking about now. From what I know though, there's a lot of extensions for the original MMF that have global, savable arrays. MagicDeque is one of the best, however you need to download it through a bonus pack which sorta complicates things if you're using a copy of MMF without it's reg code. :P

Link to comment
Share on other sites

Heh, I tried to create the same events for one of MMF's global array objects, but it didn't work. =( It was the same exact commands and everything. So instead, I'm doing it using SaveGame.cox. I'll put it up if I'm successful.

Link to comment
Share on other sites

Which global array object did you use? Cause some of them really suck at saving. :\ I know from experience. From what I've seen however, the Dynamic Array 1 object for MMF was previously called GlobalArray.cox (Which is why I tried using that when my first attempt to open your source code failed) so if nothing else works, you could trying using that. I have a suspicion that could be an updated version of the GlobalArray object you're using for MMFX.

Also a note: Save Game is really picky when it comes to loading files. I tried using it for a Level Making engine once and all it did at load up was freeze the app. x_x If you're successful though, I would definately like to see the results.

Link to comment
Share on other sites

I tried to use the save game extension and it didn't work. It looks like it should. I was hoping you could look it over to see what the problem is.

http://www.freewebs.com/sonic_softdatabase1/Save&Load_for_MMF.zip

And the extension I tried to use the first time was Global Store X. I have the Dynamic Array for MMFX also, but it has more features than the GlobalArray does. I probably have an older version that was made for the older programs.

Link to comment
Share on other sites

Okay, I looked at the code a bit more indepth.

The Save Game object seems to be only saving one object period. I went ahead and took a look at it while it does a "slowloop" (Eg. making it do the loop without using fastloops, making it run much slower) and the only values being saved are the ones from the last placed block. You need to specify which block it must save each loop or otherwise, it's just going to assume there's one object there; the one that was placed last.

EDIT: Lot of edits. :P Anyways, I find that the best way to save levels in MMF is to use up data as the level is being created. A good example of this:

> User has double clicked mouse button

+ Global Value 1 = 0 (For testing)

: Create Active Object 1 at MouseX, MouseY

: Add 1 to Global Value B

: SetVal("SaveGame", "X" + Str$(Global Value B), X(Active Object 1)

: SetVal(Rest of stuff you save)

Then once the user presses save, save all those values to the file. They stay in memory as long as the app is open so it's rather safe to do that.

  • Like 1
Link to comment
Share on other sites

Dang, I thought that may have been the problem. That method you mentioned I actually used for the MMFX version. I guess I forgot to do it the same way. I have to do something about what it should do if you delete an object though.

Thanks for checking it over. =)

Link to comment
Share on other sites

No problem. Though, I tried the method I mentioned and Save Game ends up creating a "garbage" block at 0,0. :P Might be something wrong with the order of things or where the values in Save Game are actually stored but whatever. You should also take into account what happens when the user moves an object. Though I can see why deleting would be more complicated. (Not easy trying to shift all those values down by one) Anyways, good luck trying to port this over too MMF 1.5. I eagerly await what you can come up with. =D

Btw: Me = Tails Battle Fan :P

Link to comment
Share on other sites

I hate those garbage blocks. HATE THEM!!!! It's either something with the values where it creates an object but the value doesn't exist or one object isn't saving right. I know how to make moving the object and deleting it work however. I'm going to work on this and get it running. I might make an example of different object types as well.

Btw: Me = Tails Battle Fan :P

No foolin'? =O Do you happen to know why there's that problem with the saving that makes you make the name of the level, save it, go to the title screen, and reload the level for saving to work? I really hate that and I'd love to fix it. If you need more info than that, it does the step by step saving and puts the data in a temporary file. When you click save, it uses the file extension to copy the temp file's data to the name of your level. I have a feeling it must have something to do with the file object.

Link to comment
Share on other sites

Well it's kinda hard to say what the problem is since the Tails Battle source code gives me the same error the first source code you put up here did. (Good ol' GlobalArray.cox...) But from what I saw in the files themselves, all the data is being saved to the temp file quite fine, when it makes the transfer to the actual file name I'm seeing that NONE of the data from the temp file goes into it. At all. Instead, other stuff is inserted into it. When I first created a level and placed two objects, before saving I looked at the temp file through notepad and saw that the two objects made it in there a-ok. However, when I saved the first time, I got this:

[Others]
M=
O=2
YB=1920
XB=2560
T=0
W=0[/CODE]

Which didn't match what the temp file had at all. I'm suspecting O means how many objects were placed, but the data for the said objects aren't there at all. I haven't done any more research than that but I'll look into it more if I can. Sorry if this information is something you already knew. :P I guess all this proves is that the temp file's data isn't really being put to any good use the first time you make a level.

Link to comment
Share on other sites

Ya, that's the same thing I noticed. Like you said, O means how many objects there are. YB and XB are your boundaries. T is the length of the music selected. W is whether you said it's okay to jump over walls or not. M stands for the name of the music.

I really think it's the fault of the file object. I once tried to copy a .cca file and it copied a blank file. Is there another extension that can copy files?

YES!!! I got the save/load engine to work perfectly, no junk objects or anything. =) Before uploading it, I'm making different object types so you can see how to make that work.

IT'S HERE!!! ( 6:49 PM June 3 2006 )

After a few hours of playing around with extensions, I finally finished the MMF version. It's tons better than the one for MMFX, but that doesn't mean the MMFX version is bad or anything. Here are the features:

-Instant Saving/Loading

-Multiple Object Types

-Grid System

-Up to 10000 objects ( MMF limit )

-Saves X, Y, Animation, Direction, and value A ( Other values can be saved if desired very easily )

-Static Engine

-2 Levels that show what the engine can do

Here's the download link:

http://www.freewebs.com/sonic_softdatabase1/Save&LoadMMF.zip

Remember that to download it you need to right click it and choose save target as or copy and paste the URL in your address bar.

All that's left is for it to be commented.

Link to comment
Share on other sites

That's really great! Looks flawless in the runtime app. Just one question: Why use the platform object when you're using a static engine? Neither needs the other. :P

I think I might start commenting and documenting it then. I can already recognize half this code so I'm sure it won't be too hard.

Another question: I see three CCA files. Do they all have they're own differences?

Link to comment
Share on other sites

I used the platform object since it saved me from making the moving events myself. I just thought it would be easier and I was experimenting with it to see how it worked.

Dang, I forgot to take them out. 2 of those .cca files are just backups. I think I'll fix that.

And thanks for commenting it for me. =) You've been a lot of help.

Edit: I got rid of the 2 backups and reuploaded it. It's still the same link. The only .cca file you need is Save&LoadMMF.cca.

Just reread your comment about the platform object and I now understand what you're asking. I used the platform object, but it was meant for backdrops. I was using active objects, so it was a little more difficult. I got the object to move across the ground, but I had no way to tell it whether it was touching a left or right wall or the cieling, so I was required to use detectors and combine the platform movement with the static engine. The bottom detector makes the ball stick to the ground when going down a slope.

Link to comment
Share on other sites

Well honestly, the platform object itself doesn't need the static events. It handles that all by itself. The detectors and stuff are pretty useless with the platform object there. :P Regardless though, I'm almost half way done commenting it now. The leveling editing stuff I'm not new to but your strange cross between static engine and platform object is quite fun to read. XD

Link to comment
Share on other sites

Well..

1=

>Start of Frame

-Set Active as Platform Object

2=

>Player 1 is pressing right

-Platform Object: User is holding right input key

3-5=

-Set left, jump and holding jump actions

6=

>Test for Object overlap (Absolutely important this be at the top of the event)

+Active overlaps Backdrop

-Platform Object: Object overlaps obstacle

I do believe that's ALL you need to work it, it was designed to be an extremely simple object once you've grasped it's functions. Try it yourself, you should come out with a fully working platform engine.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...