Page 1 of 1
Help with Activation Regions:
Posted:
Mon May 14, 2007 4:35 pm
by d-soldier
I have my game start menu in one area, the game in another, and the
endgame section in another... Once the player wins, or loses, the view goes back to the menu. I figured that if you cliked to play again (and it moves back to the game region) everything would start over, being that it wasn't drawn while in different regions, but it starts wherever you previously left off... So I'm thinking i don't understand activation regions like I thought I did...
Posted:
Mon May 14, 2007 7:05 pm
by Fuzzy
The way they work is that if an actor is left there when the region is left, that actor gets saved. On the other hand, if you implicitly destroy an actor with DestroyActor(), it will be gone.
What you may need to do is take attendance when the level is created, make a list from that, and when a game over state is reached, destroy each actor by hand, retain the list, and then create each actor again, implicitly when a new game is started.
Undoubtably someone will have an easier solution. I'm a control freak though.
A possibly easier way would be to have invisible actors that set up the enemies when a level is entered. Remember the monster factories in that old game Gauntlet? Like that.
Then the factory contains a variable that indicates if it created anything or not, and you have a gobal var that records if the game has been restarted. The factory examines this, as well as its own var and decides if it needs to replace its spawned children.
Posted:
Mon May 14, 2007 7:09 pm
by makslane
Look this scenario:
You have an actor A with 'create at startup' set to Yes in the region 1.
Now, you destroy the actor A and go to the region 2.
You come back to the region 1 now.
The actor A doesn't will be recreated again, due was destroyed before.
The best way to reset the game is use the LoadGame function.