Help with Activation Regions:

Talk about making games.

Help with Activation Regions:

Postby d-soldier » Mon May 14, 2007 4:35 pm

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...
Attachments
apache_help3.jpg
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby Fuzzy » Mon May 14, 2007 7:05 pm

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.
Last edited by Fuzzy on Mon May 14, 2007 7:10 pm, edited 1 time in total.
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Postby makslane » Mon May 14, 2007 7:09 pm

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.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron