MonkeySave almost ready

Monkey Forums/Monkey Programming/MonkeySave almost ready

slenkar(Posted 2011) [#1]
My Monkey serialization program (MonkeySave)
Is ready for release

It is sold for 5$
to purchase send 5$ to my username's gmail
(dont forget to mention your email address that you want it sent to)

Here is the info:

-Its an executable made in Blitzmax that sits in your games source folder.

How its used:
Step 1
Setup your game for loading and saving.

1-Create a class called 'save_object' and put your game objects in its fields.(you decide what fields it has.)
The save_object class has to go in your main file (that you run with F5).
Create a class called saveable which has 2 fields unique_id:String and save_number:Int
2-All objects to be saved have to extend the saveable class
3-All classes must end with 'End Class'
4-no declaring multiple fields on one line with commas
Step 2
1-You run the MonkeySave .EXE and it writes all necessary code to save and load the game
2-all you have to do is write 'import save_functions' in your main file and you can save and load your game
example:

Import save_functions

Class saveable
field unique_id:String
field save_number:Int
end class

Class save_object extends saveable
Field world_:world_map
Field unique_id:String
End Class

If KeyHit(KEY_SPACE)
Local s:save_object=New save_object
s.world_=world_map.inst
Print "Saving"
SaveState(save_objectto_node(s))
Print "saved"
Endif

If KeyHit(KEY_ENTER)
Print "Loading"
Local s:String=LoadState()
Local thenode:ConfigNode=LoadConfig(s)
For Local thisnode:ConfigNode=Eachin thenode.GetChildren()
Local sa:save_object=save_objectfrom_node(thisnode)
world_map.inst=sa.world_
Next
Print "loaded"
Endif



-it takes care of cyclic references
e.g. a character with itself as one of its fields

-the generated save_functions.monkey can be quite large if your game has lots of different types of object,with lots of fields.
For my RPG game it was 112KBytes of code added to the game.

The actual savedstate was 823KB which is not bad

-there are limitations, like no containers within containers or multidimensional arrays.


heres what can be saved:
Lists,Arrays,Classes,Primitive types (Int String etc.),StringMaps
to do:
Other Maps,Sets,Stacks


slenkar(Posted 2011) [#2]
ok StringMaps are in,