nav2

Friday, February 20, 2015

Multimedia fusion - code - Load and Save Array system

A month ago I developed an array based load and save system for a game I was working on in my free time - in multimedia fusion 2.5.
Since then I noticed that the ability to easily add this functionality for a game in this engine is an often requested thing at their forum. Thus I decided to get my Array based system out there and help people with their game projects by saving them the time and effort to implement their own. It is so far my most sold-out item at the clickteam store and no complains from anyone so far!
  Buy it here for about a dollar.
It takes 5 minutes to set up.


So how does it work?
It uses two three-dimensional array objects to store the values and strings of any active game object (with variables) that you have in your game.
X= ID of the active object(which object)
Y= ID of the variable of the active object (which variable)
Z= ID of the Frame where the active object lives (which game level)
The code scans Active Objects with the data qualifier on them and then writes their values to a Values array table object and their strings to a strings array table object.

 The array objects can then write these states to 2 array files in the game's directory. This is how save states can be created for your game. Note that array files are binary.

These states can be easily loaded with a fastloop. In fact the beauty of my load and save system is that it can very easily be integrated in any project. It's using fastloops to execute the logic that is set up - fast loops that you can easily tell the engine when to trigger.

How to integrate it in your game
So in order to use the load and save system, you must do a number of minimal tasks.

1. For each object that you want the values saved, leave "Alterable value A" empty. It is needed to give the object a unique ID. Also assign a "DATA" qualifier to it.

2. Copy the two array files supplied in the source file to all of the frames in your game where the game can be saved/loaded.

3. Copy the event sheet logic supplied in the source file to each frame of your game where the game can be loaded/saved. It's commented pretty well with instructions on which fastloops to trigger in order to load/save your game.

And voala. You have a very powerful Load and Save functionality in your game!
You can get this and use it in your game from the multimedia fusion store for about a dollar. :)



No comments:

Post a Comment