| |
Makin Save files in MMF
Xgoff |
|

<):|
![Super Happy Heart Badge [*]](https://archive.mfgg.net/html/badges/shappyheart.gif) ![Sprite Comp Winner Badge (1) [*]](https://archive.mfgg.net/html/badges/scg1.gif) ![Drawing Comp Winner Badge (1) [*]](https://archive.mfgg.net/html/badges/dcg1.gif) ![Drawing Comp Runner Up Badge (1) [*]](https://archive.mfgg.net/html/badges/dcr1.gif) ![MFGG Awards 2006 Winner [*]](https://archive.mfgg.net/html/badges/award06.gif)
![MFGG Awards 2007 Winner [*]](https://archive.mfgg.net/html/badges/award07.gif) ![Forum Event Badge [*]](https://archive.mfgg.net/html/badges/event.gif)

Group: Members
Posts: 52341
Member No.: 24
Joined: 13-October 03
Status: (0d)
![[--]](style_images/mfgg2_skin/warn_nosuspend.gif)

|
yes
it depends on how complex your levels are
if they're simple, you can use INI files. More complex levels should be saved via arrays
--------------------
 DISCLAIMER: by sending me (xgoff) a private message, you agree to the directives and their terms specified henceforth: DIRECTIVE 1 (APPLE): i may or may not reply promptly or at all; and there are no guarantees to the usefulness of the reply. i may not acknowledge whether i have even received your private message DIRECTIVE 2 (CHILE CON CARNE): as per my view, "private" applies only to the initial transaction, and the material of your message may or may not be made public at my discretion; as this will more than likely be a post in the CCC or IRC, you may not be able to view it DIRECTIVE 3 (FEATHER DUSTER): you must address me (xgoff) as "Sir Master Xgofficus his Highest and Most Awesome the Third"; failure to comply with this term may invoke one or both of the above directives, and i will leave a burning bag of **** on your doorstep DIRECTIVE 4 (BOOTSTRAP): if you have read this disclaimer, please private message me promptly, in compliance with the above terms, so i can ensure you are capable of following directions you idiot this concludes the test of the emergency disclaimer system, your scheduled programming will now continue. satisfaction guaranteed, and 100% cash back available under certain circumstances; restrictions may or may not apply within your place of residence NOTICE: these directives and their terms may change at any time, without notice; as a private message transaction to myself assumes an understanding and full compliance of the above, you should ensure you are fully aware of the above terms at any point before sending a private message; any message received is assumed to have been sent in compliance with the above| QUOTE | (5:25:58 PM) Mikau: xgoff (5:26:00 PM) Mikau: guess what (5:26:04 PM) Xgoff: chicken butt (5:26:09 PM) Mikau: **** you |
|
|
|
Xgoff |
|

<):|
![Super Happy Heart Badge [*]](https://archive.mfgg.net/html/badges/shappyheart.gif) ![Sprite Comp Winner Badge (1) [*]](https://archive.mfgg.net/html/badges/scg1.gif) ![Drawing Comp Winner Badge (1) [*]](https://archive.mfgg.net/html/badges/dcg1.gif) ![Drawing Comp Runner Up Badge (1) [*]](https://archive.mfgg.net/html/badges/dcr1.gif) ![MFGG Awards 2006 Winner [*]](https://archive.mfgg.net/html/badges/award06.gif)
![MFGG Awards 2007 Winner [*]](https://archive.mfgg.net/html/badges/award07.gif) ![Forum Event Badge [*]](https://archive.mfgg.net/html/badges/event.gif)

Group: Members
Posts: 52341
Member No.: 24
Joined: 13-October 03
Status: (0d)
![[--]](style_images/mfgg2_skin/warn_nosuspend.gif)

|
eh I'll put up just the array method for now
a *cough*simple*cough* method of doing it (if you're using active objects as level objects)
pretty much EVERYTHING (including background objects) has to be an active object (obviously background
objects are pasted into the background when they are loaded)
this is also assuming you use a 16 x 16 grid (you'll have to change some values if you're not). For the
arrays, you have to set their X and Y dimensions to the width and height of the level divided by whatever
your tile size is (16). Obviously your levels should be a multiple of the tile size
---
This is needed for both methods (and is one of the most painfully tedious things you will ever do in your life):
| CODE | --- SAVING ---
Start of frame --> Level Object type A - Set Alterable Value A to: 1 --> Level Object type B - Set Alterable Value A to: 2 --> Level Object type C - Set Alterable Value A to: 3 --> Level Object type D - Set Alterable Value A to: 4
... etc
--- LOADING ---
On loop "LoadY" Global Value A = 1 --> Create (Level Object type A) at: -64, -64
On loop "LoadY" Global Value A = 2 --> Create (Level Object type B) at: -64, -64
On loop "LoadY" Global Value A = 3 --> Create (Level Object type C) at: -64, -64
On loop "LoadY" Global Value A = 4 --> Create (Level Object type D) at: -64, -64
... etc. |
keep doing that until you get through all your objects ---
Array Method (make sure the array is numerical, set to 0-based index, and that all the level objects have the same qualifier [i'll use qualifier "1"]):
| QUOTE (Saving) | Start of Frame --> Array - Set file to: Appdrive$ + Appdir$ + "test.lev" (you'll want to use a better way of referencing the files)
(save event) + Only one action when event loops --> Start loop "SaveX" for: Frame Width / 16
On loop "SaveX" --> Start loop "SaveY" for: Frame Height / 16
On loop "SaveY" + Group.1 - X position is equal to: Loopindex("SaveX") * 16 + Group.1 - Y position is equal to: Loopindex("SaveY") * 16 --> Array - Write value to XY: Alterable Value A("Group.1") ; Loopindex("SaveX") ; Loopindex("SaveY") |
| QUOTE (Loading) | Start of Frame --> Array - Set file to: Appdrive$ + Appdir$ + "test.lev" (same as your saved file, obviously)
(Load event) + Only one action when event loops --> Start loop "LoadX" for: DimX("Array")
On loop "LoadX" --> Start loop "LoadY" for: DimY("Array")
On loop "LoadY" --> Set Global Value A to: ValueatXY("Array",Loopindex("LoadX"),Loopindex("LoadY")) --> Group.1 - Set X position to: Loopindex("SaveX") * 16 --> Group.1 - Set Y position to: Loopindex("SaveY") * 16 |
you'll still have to add the background objects to the backdrop afterwards
i did this in my head (with some reference from MPUZ's level editor), so it might not work... but it should
Level editors are complex as hell so I hope you weren't expecting something simple
This post has been edited by Xgoff on Feb 5 2007, 08:42 PM
--------------------
 DISCLAIMER: by sending me (xgoff) a private message, you agree to the directives and their terms specified henceforth: DIRECTIVE 1 (APPLE): i may or may not reply promptly or at all; and there are no guarantees to the usefulness of the reply. i may not acknowledge whether i have even received your private message DIRECTIVE 2 (CHILE CON CARNE): as per my view, "private" applies only to the initial transaction, and the material of your message may or may not be made public at my discretion; as this will more than likely be a post in the CCC or IRC, you may not be able to view it DIRECTIVE 3 (FEATHER DUSTER): you must address me (xgoff) as "Sir Master Xgofficus his Highest and Most Awesome the Third"; failure to comply with this term may invoke one or both of the above directives, and i will leave a burning bag of **** on your doorstep DIRECTIVE 4 (BOOTSTRAP): if you have read this disclaimer, please private message me promptly, in compliance with the above terms, so i can ensure you are capable of following directions you idiot this concludes the test of the emergency disclaimer system, your scheduled programming will now continue. satisfaction guaranteed, and 100% cash back available under certain circumstances; restrictions may or may not apply within your place of residence NOTICE: these directives and their terms may change at any time, without notice; as a private message transaction to myself assumes an understanding and full compliance of the above, you should ensure you are fully aware of the above terms at any point before sending a private message; any message received is assumed to have been sent in compliance with the above| QUOTE | (5:25:58 PM) Mikau: xgoff (5:26:00 PM) Mikau: guess what (5:26:04 PM) Xgoff: chicken butt (5:26:09 PM) Mikau: **** you |
|
|
|
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
[ Script Execution time: 0.0536 ] [ 14 queries used ] [ GZIP Enabled ] [ Server Load: 0.50 ]
| |