How to randomly spawn Events in a certain region ID?

● ARCHIVED · READ-ONLY
Started by TheObermotz1 7 posts View original ↗
  1. I wanted to know, if there is a way to make Events spawn randomly in a certain region ID. By that I mean, they can spawn on any tile, as long as the tile is within a certain region ID.

    In my game, I want the monsters to spawn in the overworld where the player can see them and fight/avoid them. They're Events, wandering around randomly, waiting for the player to touch them and start a fight. Since they're events, the normal 'random encounters' tab doesn't work on them and I haven't found a way to make an event spawn inside a region ID.

    But certain Monsters are only supposed to spawn in certain terrain, like crabs on the beach and snakes on the mountains. Same goes for certain villagers only spawning in certain areas of their village.
    Regionspawn.png
    Crabs spawn in the region-ID 60 and snakes spawn in 3 & 5


    I've found a few scripts but none of them solve my problem. Some help from you guys would be much obliged.
  2. spawning events requires a full refresh of the map, so it's better to do it when transitioning.
    but yes, it's totally doable.

    a quick way of doing it, is just copying and reprogramming existing events.
    set up one temporary event with a call to a common event, and that common event holding the logic for processing the battle encounter.
    upon loading the map, you call the copy and reposition action.
  3. https://yanflychannel.wordpress.com/rmvxa/utility-scripts/spawn-event/

    Use this script to spawn events in required regions.
    spawn_event_region(region_id, event_id)
    spawn_event_region(region_id, event_id, map_id)
    Use these script calls to make a new event from a premade event with the id 'event_id' in a map with the id 'map_id'. Be sure to fill up the region_id with the I'd of the region you want the events to spawn in.
  4. Hyouryuu-Na said:
    https://yanflychannel.wordpress.com/rmvxa/utility-scripts/spawn-event/

    Use this script to spawn events in required regions.
    spawn_event_region(region_id, event_id)
    spawn_event_region(region_id, event_id, map_id)
    Use these script calls to make a new event from a premade event with the id 'event_id' in a map with the id 'map_id'. Be sure to fill up the region_id with the I'd of the region you want the events to spawn in.

    Very confused about this concept, but it's one I need to use. I've got a large overworld map, and have far more mobs than lines in the Encounter list. And I'm using some Yanfly scripts already =)
    I know my World Map's ID#. There are Region ID's on the Map, so far just a few.
    I want events(enemy encounters) to spawn randomly within each Region. Just like the OP.

    I have no idea how to get this script to work.

    How does it get Troop info?
    Where do I put the "spawn_event_region(region_id, event_id, map_id)" information?
    Where is it getting Event ID's from?
    What should be in the Event itself?

    Looked for a guide on how to use this script, can't find one. Any help is appreciated!
  5. Bump
  6. Is this a duplicate? I definitely gave an answer on a post identical to this one an hour or two ago.
  7. bluebomber25, please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.