Ok... I'll ask again, how are you separating your levels/stages? Are they in different ged files? Are they in the same one separated by activation regions? Or the new enemies created through script? It sounds like you don't have a second level but you want to make it a separate ged file, so assuming this is what you want here is a short explanation on how to do it. Some of these steps you probably have done already, and depending on your setup and plans for this game may or may not be optimal.
In your first level, create a variable called score, set the save group name as score. Now for the destroy actor event of your enemy actor, put the following code.
- Code: Select all
if(ActorCount("enemy")==1)
{
saveVars("score", "score");
LoadGame("lv_2.ged");
}
Now save this and edit the level to be level two. On the view's create actor event, place the following code and a basic level transfer will be setup.
- Code: Select all
loadVars("score", "score");
Lastly you would save this game as lv_2.ged, that way the other game will load into this new game, and due to the save and load, the score will remain.