Procedurally generated encounters

Hi RPG-Makers,
for my current game I'm trying to figure out a way to generate random encounters that you can *see*, and therefore avoid or actively seek out while they are moving. Some are enemies. Some are not. My solution so far is this...

NPgOV3a
NPgOV3a


I let the event autorun when entering a map, generating a random number that turns a self switch and generates one of four (ABCD) encounters, with a specific appearance, behavior and aftermath. If you kill them (well, no one dies in my game, but that's a different story) they disappear, and the next time you enter the map a new encounter will be set up.

This thing does exactly what I want, but: Only with 4 different outcomes. The main purpose however is to
save time by not having to build/customize every single encounter, while explicitely not using the random encounters.

The main problem is the appearance of the moving event. I can set up 4 different events that have a specific appearance in the example above by storing the "choice" in a self-switch. If I try to do the same with a common event I can't for the life of me figure out how to do the same for the hundreds of choices that will eventually be possible (and necessary).

I'm pretty sure I'm not the first person to try this, but I haven't been succesful finding a solution so far. Maybe you have an idea or done something similar?
What about my event spawner plugin, would it help?
https://forums.rpgmakerweb.com/index.php?threads/por_eventspawner.101039/
If you run a common event from a map event any self switch stuff you do in the common event will only effect the map event that called the common event. So that could.... maybe help some as well?
If you run a common event from a map event any self switch stuff you do in the common event will only effect the map event that called the common event. So that could.... maybe help some as well?

Good idea, but tried that already and there was a cruel moment of hope until I realized that I'm still limited to ABCD. It's crazy how each event has his own 4 flags, but I can't find a way to store one individual variable in it. The only way I see right now is to create a common event for every single instance of the generating event, handling it's own set of variables, and that is just insane.

I had a similar problem with collectibles where it was seemingly impossible to have the common event they called when used figure out which item called them, so each item needed it's own event. Thanks to copy+paste it's not that much work, but it bugs me because it blows up the number of variables and events. And I really don't want to get into scripting, so hopefully there is a plug-in...


What about my event spawner plugin, would it help?
(...)

Thanks, this looks interesting; give me a day or two to see what I can do with this.
Good idea, but tried that already and there was a cruel moment of hope until I realized that I'm still limited to ABCD. It's crazy how each event has his own 4 flags, but I can't find a way to store one individual variable in it. The only way I see right now is to create a common event for every single instance of the generating event, handling it's own set of variables, and that is just insane.

I had a similar problem with collectibles where it was seemingly impossible to have the common event they called when used figure out which item called them, so each item needed it's own event. Thanks to copy+paste it's not that much work, but it bugs me because it blows up the number of variables and events. And I really don't want to get into scripting, so hopefully there is a plug-in...




Thanks, this looks interesting; give me a day or two to see what I can do with this.
An event spawner plugin of some sort is probably your best bet then.
Have events that wander around, and when you touch them, make them select a random number.
Based on that number, you fight a specific troop.
Have events that wander around, and when you touch them, make them select a random number.
Based on that number, you fight a specific troop.

That would be the easy way out, and if you look at the image above, that *is* pretty much what I'm doing. The real problem is that I want them to look their part *before* you run into them.

And I realize now I made an oops.
I shouldn't have suggested just the event spawner...
But the extra event pages plugin.
It allows you to artificially increate an event's pages to above 20.
Nevertheless, your situation made me realize that the plugin needs an update before it can be used by your project.
Quick update: Poryg's plug-in...

... is a good workaround. It's still not *exactly* what I was looking for, but it will do the trick. So thank you, Poryg, and of course I'll mention it in the credits if I ever get there😉
When I update my extraEventPages plugin, it should be even easier. However, I need to find time for that... 😀
What you're doing works, right? Why not use a variable? That way you can make more than 4 outcomes.

[edit: you could set up the variable through the player move event command - so say you're in town and you leave. The event that takes you to the new map would also choose a random number for your variable. Every enemy event on the new map would have something different for that number variable.]

Original thread: https://forums.rpgmakerweb.com/threads/procedurally-generated-encounters.105068/