Here's what I want to do: have monsters visible on the map that create fights when you walk into them. When you beat them they disappear. Certain factors will make all the monsters on a given map disappear or reappear, for instance if the player uses an item or spell that kills all the monsters at once, or flips a switch that revives all the monsters on that map.
It's important that this be map-specific. If the player chooses to wipe out all the monsters on floor 9 of a dungeon, I don't want floors 10-20 to be empty too. By the same token if the player revives everything on floor 9 because they want to farm up an item, I don't want every monster in the world to come back to life.
Here is how I would like to tackle the problem:
Every monster event has the same prefix on their name, like MONSTER or MNST. Every event has a page activated by a self switch (say, D) in which they are defeated and invisible. This switch could normally be flipped by walking up and killing them.
A script, when called, should grab the player's current Map ID and compile a list of events on that map which have MONSTER as their prefix. It should then iterate through the list and change their self switches individually. The script call would have to provide true or false to determine whether the script activates or deactivates all the switches.
I have a fair bit of programming experience but not a lot in Ruby or RPG Maker, so I don't know how to do a couple of things. How do I get the map ID of the map the player is currently on? How do I get a list of all the entities on that map, and then get their names?
Finally, I have considered using "erase event" instead of self switches, but as far as I know that would make it much more difficult to revive monsters without leaving the map.
Thanks for your time!
It's important that this be map-specific. If the player chooses to wipe out all the monsters on floor 9 of a dungeon, I don't want floors 10-20 to be empty too. By the same token if the player revives everything on floor 9 because they want to farm up an item, I don't want every monster in the world to come back to life.
Here is how I would like to tackle the problem:
Every monster event has the same prefix on their name, like MONSTER or MNST. Every event has a page activated by a self switch (say, D) in which they are defeated and invisible. This switch could normally be flipped by walking up and killing them.
A script, when called, should grab the player's current Map ID and compile a list of events on that map which have MONSTER as their prefix. It should then iterate through the list and change their self switches individually. The script call would have to provide true or false to determine whether the script activates or deactivates all the switches.
I have a fair bit of programming experience but not a lot in Ruby or RPG Maker, so I don't know how to do a couple of things. How do I get the map ID of the map the player is currently on? How do I get a list of all the entities on that map, and then get their names?
Finally, I have considered using "erase event" instead of self switches, but as far as I know that would make it much more difficult to revive monsters without leaving the map.
Thanks for your time!