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,248
Reaction score
1,252
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
947
Reaction score
2,217
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,960
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,842
Reaction score
5,228
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 Posts

Latest Profile Posts

"You can thank my later", "But you haven't done anything", "Well, that's why ..."
Are we allowed to post about non-RPG Maker games?
I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

Forum statistics

Threads
105,884
Messages
1,017,240
Members
137,609
Latest member
shododdydoddy
Top