November 9, 2020 at 11:41 pm #29665
Hey all, so I’m trying to figure out a way to have my monsters respawn… and I can’t conceive of any elegant way to do it, other than basically like dumping a bunch of tokens into the hero at the start, and forcing the character through a series of “pressure plate” event triggers at the beginning/ending of each area.
Is there a more elegant way to do this that I’m missing?November 10, 2020 at 8:34 am #29683
Can you give some more details on what exactly you want to happen?November 10, 2020 at 4:32 pm #29696
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.November 11, 2020 at 7:15 am #29764
Yes, it seems like that would work.November 11, 2020 at 5:27 pm #29786
Can you, or anyone, think of a more elegant way to do it? 😛
Is there any functionality that I’m missing? The whole ‘funneling them through events’ is a bit of a headache cuz it requires not only the “coding” but also map-engineering.November 11, 2020 at 5:57 pm #29790
You could also try our Discord. Plenty of people there to ask: https://discord.gg/tyHjdt3April 11, 2021 at 8:59 am #38059IrishNickParticipant
I’ve got a similair thing in my game.
The hero goes into the cemetary and the bats attack him.
When they are dead the hero leaves and the come back to life when he returns.
I put a floor switch ajust after the entry door which activates the bats
first bat. when he dies the other 3 are activated.
This gives a cool way to have enelies coming in groups and every time that ypu enter the level. (no variables or token to count either) 😉
- The forum ‘Get help’ is closed to new topics and replies.