Welcome Forums Get help Respawning Monsters Reply To: Respawning Monsters

#29696
Msquared
Participant

Sure, so the game I made is just a very simple series of areas arranged in a loop. It’s just a little fantasy world that I made so my young son could go around and have some fun slaying monsters.

You cannot access an area except by going through the area preceeding it. So the loop is arranged like this:

“first”/village > “forest” > “ruins” > “caverns” > “first”/village

The game is public, so you can go check it out if you want to see what I’m talking about. It’s in “debug” mode atm (invincible hero), but it might help you understand what I want to achieve…

What I want is either that:

1. any time the hero exits an area, when they return to it, all monsters have returned.

2. any time the hero takes the one-way exit from the caverns back to the village, the monsters will in effect return to all the areas the next time they enter them.

So that he can just go on this endless loop of monster slaying.

So, it makes my brain hurt trying to figure it out, but the only way I can think of coming close to achieve something like this is to drop a token for each area into the hero at the start of the game (by dropping them at the start onto a walk-over event). Say the tokens are: “Village token”, “Forest token”, “Ruins token”, and “Caverns token”.

So, when the hero leaves the first/village area and enters the forest area, there will be an event that checks for the “Village token” and will first use that to make all monsters in the area Inactive. They will never lose the “Village token”. Every area uses the Village token” to make monsters Inactive.

Then there will be an event which they are corralled into walking over that checks for the “Forest token”. Since/if they’ve never been in the forest before, they have the “Forest token”. That token will Activate all the monsters. And after it Activates all the monsters the event will remove the token (so that they can’t, for example, re-Activate the monsters on accident after they’ve killed some, just by walking around within the area).

Then, I need to have an event that they have to use to leave the area that triggers off of NOT having the “Forest token”, and it will give the “Forest token” back to them only when they affirm that they want to leave…

Thereby, when they return to the area, they have both the Village and Forest tokens again, and all the monsters go away and comeback again, upon leaving the area.

Repeat that token-event scheme for every area, or at the end of the loop when they go from Cavern back to first/Village.

Does that work? I’m trying to envision it, and it makes my head hurt.