How to randomly spawn Events in a certain region ID?

Status
Not open for further replies.

TheObermotz1

Veteran
Veteran
Joined
Mar 5, 2014
Messages
34
Reaction score
17
First Language
German
Primarily Uses
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.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,242
Reaction score
1,235
First Language
Spanish
Primarily Uses
RMVXA
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.
 

Hyouryuu-Na

Sapphire Sodium
Veteran
Joined
Jun 15, 2017
Messages
931
Reaction score
2,182
First Language
Not English
Primarily Uses
RMMV
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.
 

bluebomber25

Veteran
Veteran
Joined
May 24, 2020
Messages
39
Reaction score
4
First Language
English
Primarily Uses
RMVXA
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!
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,956
First Language
English
Primarily Uses
RMMV
Is this a duplicate? I definitely gave an answer on a post identical to this one an hour or two ago.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,793
Reaction score
5,212
First Language
Dutch
Primarily Uses
RMXP

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.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Do you have an audio you want me to animate? If so send me the youtube link and I’ll animate it.
Okay, so I'm working on Draft 2 of my game's script.
Will try to keep you guys posted, if you're interested!

This is vid of my new game, Crystalgazers. A demo is available on my Gamejolt

I just thought of the best achievement for my game: "'I Didn't Know You Were a Developer!' Find and enter one or more dev room(s)."
I made this animation to apply to a job, what do you think?

Forum statistics

Threads
105,590
Messages
1,014,840
Members
137,254
Latest member
WilliamSlither
Top