CRE8OR - game maker for anim8or

 


VARIABLES, SAVING, LOADING


You'll need Cre8or Version 0.10a in order to run this correctly. Typically you'll want users to be able to save games, or you will want to pass data from scene to scene. In this tutorial I will explain to you the new ways you can handle saving and loading of data.

Let's start with Variables. There are three kinds of variables treated in Cre8or: Entity Variables, Scene Variables and Global Varaibles. Entity Variables exist only with entities. Each entity will have it's set of variable. Scene Variables exist everywhere, but only last for each scene. Global Variables exists everywhere (all scene) and also stay the same even when the game is restarted, they are permenant.

How do you save a game? You can use the "Game Save" action and "Game Load" action. They will save Current Scene, Scene Variables, Entities, Entity Position/Orientation, Entities varaibles. Game Saves do not save global variables. Global variables are permanent and stored in "gg.dat". Delete that file and they're saves are cleared.

There is also another way to Save Variables. Using the actions "Save Scn Vars" and "Load Scn Vars" you can only save the scenes variables to a specific data file. Like Load Scene Vars on start, and Save scene vars on finish.

You can alos use the "If File Exists" Action to see if a previous Scene Save exists.

Then you can use the Entity "Save Vars" to save the entities vars to a file. And Load them with "Load Vars."


Tutorials Page




Copyrights (C) 2007 Keith Tabert
Thanks to R. Steven Glanville for Anim8or, Robin