Auto Populate Maps, Version 0.5
#1
Auto Populate Maps
Version 0.5 (9-22-2009)

Introduction

Hi all. This is a small script that lets you populate a map with events/monsters, which you can use for "on-map" encounters for example. Events can be placed randomly on the passable tiles of the map or within a specified area. They can be distributed only on tiles with a specified terrain tag, and they can be forbidden from blocking passages for the player.
Please note that these events are generated on the fly. So, while you can use self-switches as long as you stay in that map, everything is reset when you exit from the map and re-enter.

Screenshots

Bats, big rocks (unpassable) and small ones (passable) have been generated with the script.
[Image: Immagine3.jpg]
And this is how the map looks like in RMXP
[Image: 13216076og1.jpg]

Demo

Here

Instructions

Create your enemy event, with a call to a battle in the first page, a desired movement, a second page to be used when you defeat the enemy and everything you need. Write down its event number, let's call it "event_id". Let's also assume that you want to create "max_events" enemies.
Now create a second event and use a script call with:
Code:
$game_system.map_interpreter.populate(event_id, max_events)
Repeat everything if you want different types of monsters on your map.

If you want the prototype events to be erased, use $game_system.apm_remove_original_event=true in a script call. It will be saved when you save the game.

additional methods

EDIT: the use of "$game_system.map_interpreter." isn't actually necessary, you can directly call "populate".

Author's notes

This is still in a preliminary state. Code is not clean, not thoroughly tested.
I guess there are many uses as populating with enemies, animals, vegetation ... use your imagination.

EDIT: this could have been done with class Game_Map as well... whatever...

Tutorial

tutorial
Reply }
#2
Version 3!
Corrected a really annoying bug I have been hunting for a loooong time.
Reply }
#3
Up(dated).
Reply }
#4
I've never noticed this before but it could really come in handy. I might look into this. Looks great!
Reply }
#5
I know this thread is really old, but man, let me say, this script is just really, really, really cool!
I will use it, and honestly, it's one of my favourite and one of the most usefull script! I'm using it to populate the maps with the monsters, and I have big maps, so with this scipt I don't have to become stupid to create lots of enemyes.

Only few questions: what is the meaning of "APM_RESET_SELF_SWITCHES=true" at the start of the script. What does it supposed to do? I use self-switches for some events (if you run away from the fight, s-s A = true) and it doesn't reset. For me it's good, I like it, but I would like to know if it's someway linked to this command or not.
However, will ever been update anymore?

Really nice job, man! Thanks to have created it ;)
Reply }
#6
With "APM_RESET_SELF_SWITCHES=true" the self-switches of the generated events will be reset upon their generation. However that happens only when the populate function is used, not when the other ones are (populate_area, populate_area_2, populate_area_3 and so on). If you are using only the other ones, you won't see any effect and the self-switches will keep their previous value.

Self-switches are a little tricky, because they are not stored within events, but instead there's a global array for them.
This can be good in a simple situation, as for example lets you do things with this script as controlling the number of monsters that are alive in a map, by keeping a self-switch set indicating that a monster is dead. That monster will be generated dead. This is under the assumption that the events will always take the same IDs, which correspond with the indexes in the self-switches array.
But, if for some reason the IDs/indexes of some events change, because the order in which they are generated changes or I don't know why, then their self-switches will get the values that before belonged to the events with the new indexes, causing a total mess.
Reply }
#7
Mmh... I have to pay attention than... well, I have tried it a lot, and for now no matters. I'll try it more, however.
My idea is to use this script for normal monsters only (or maybe for some treasure chest), so it should not be a big problem if a self switch is activated for a monster instead of another one.

Ok, thanks for the explanation! :D
Reply }
#8
Updated.
[Image: facebook_icon.png] [Image: youtube_128x128-120x120.png] [Image: deviant.png] [Image: save-point.png]
Reply }
#9
this is cool, it's very usefull for people using action battle systems and tactical battle systems. Good work ;)
Valdred
Tech Administrator of Save-Point
Reply }
#10
Having a look at this neat script. Will let you know how it goes!

Update: Maybe you can add more features like have the NPCs give random amounts of gold(set), item, equips...etc
Check out berka's Npc generator if you want to see what I mean. :)

Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   The Charlie Mini-Map / Dynamic Maps Patch DerVVulfman 2 4,895 03-29-2022, 11:55 PM
Last Post: DerVVulfman
   Dynamic Maps Expanded DerVVulfman 11 13,416 07-06-2021, 04:31 PM
Last Post: Mel
   BIG MAPS DerVVulfman 28 30,084 12-08-2020, 04:34 AM
Last Post: DerVVulfman
   KItemDesc XP Zilsel Version kyonides 4 7,717 12-01-2019, 06:11 AM
Last Post: kyonides
   CTB - A Final Fantasy X-like Battle System, Version 3.2 Charlie Fleed 572 754,927 05-19-2016, 05:38 PM
Last Post: Starmage
   Isometric Maps: MiniMap DVV Patch DerVVulfman 0 5,268 06-26-2014, 03:27 AM
Last Post: DerVVulfman
   The Lycan ABS Isometric Maps Patch DerVVulfman 1 6,708 06-25-2014, 03:54 AM
Last Post: DerVVulfman
   GubiD's Isometric Maps Package DerVVulfman 1 6,468 06-25-2014, 03:31 AM
Last Post: DerVVulfman
   Equipment Upgrade System by Charlie Fleed, Version 1.2 Charlie Fleed 145 210,829 04-11-2014, 01:19 AM
Last Post: Gardesion
   Individual Battle Commands by Charlie Fleed, Version 1.0 Charlie Fleed 3 11,325 01-25-2014, 12:15 PM
Last Post: Charlie Fleed



Users browsing this thread: 4 Guest(s)