Event triggered by region.

Having a very difficult time finding a clear guide on this.

Basically, I have a region along a treeline. When the player steps on that region, a basic choice event comes up, "Would you like to traverse the forest?". Yes for teleporting to a new map and so on and so forth, the event details don't matter.

Is there a way to set a region to activate an event like that?

Thanks.
Hrmm.. I'm not sure.. but I'd guess you would have some process checking continually to find the player's coordinates (maybe with $game_player.x and $game_player.y) and then testing that x,y coordinate to see what the region number is.. something like that anyway.. 🙂

Just thinking out loud

Or just forgo checking x and y and look at the regionID 🙂

if $game_player.region_id == n 
there are several ways to do this, but no script that does exactly this - you'll have to work a bit on it.

One way would be to connect events to the Tile-IDs instead of the Region-IDs. That isn't exactly the same, but should be able to work if you always use the same tile as a border between the treeline and the other map parts. If you go with this, here is a script that helps: http://yanflychannel.wordpress.com/rmvxa/field-scripts/common-event-tiles/

If you want to use region IDs for better flexibility, you can use Yanfly's Move restrict region as a guideline - you have to change that script from preventing movement if the region ID is restricted to calling an event when the player moves onto the region ID: http://yanflychannel.wordpress.com/rmvxa/field-scripts/move-restrict-region/

This approach needs more scripting knowledge than the first one, but has a different and better flexibility.

To do the same with eventing, you'll have to setup a common event as a parallel process checking the player coordinates. This works, but it would be difficult unless the treeline really is a line with the same coordinates. For an irregular forest line it would probably still be easier and faster to setup single transfer events.

On a side note, there is also a script that automtically connects two or more maps, allowing for maps greater than 500x500 - but that probably isn't the reason for your question, and it would not create transfers but simply increase the map limits: http://himeworks.wordpress.com/2013/03/17/connected-maps/
Thanks for both of your replies. I have no problem copying and pasting the same event all over the place, except, I heard that having a lot of events on a single map can cause lag and I've avoided trying it. So, let's say I go with a 500x500 map and I have all the dense forest treelines just surrounded by that transfer event. Would that be laggy? Lol.

I'll just mess around with copying and pasting the event all over.

Thanks.
Thanks for both of your replies. I have no problem copying and pasting the same event all over the place, except, I heard that having a lot of events on a single map can cause lag and I've avoided trying it.

Thanks.
That is too much of a generalisation. You could have a single event creating a lot of lag, or hundreds without any lag - it depends on how the event is written and what it does.

Player activated events (like transfer events or talking NPCs) have almost no effect on lag, as they don't react unless the player activates them.

Moving events can have some effect on lag, but you'll need either a lot of them or very complex and interacting moveroutes.

Events on parallel process however can create a lot of lag, especially if they're written poorly. It is a very good idea to avoid parallel processes whenever possible (for example, don't ever make events move by parallel process, use the autonomous movement option instead - If I heard correctly that was introduced especially to prevent the need of parallel processes for moving events in order to reduce lag)
That is too much of a generalisation. You could have a single event creating a lot of lag, or hundreds without any lag - it depends on how the event is written and what it does.

Player activated events (like transfer events or talking NPCs) have almost no effect on lag, as they don't react unless the player activates them.

Moving events can have some effect on lag, but you'll need either a lot of them or very complex and interacting moveroutes.

Events on parallel process however can create a lot of lag, especially if they're written poorly. It is a very good idea to avoid parallel processes whenever possible (for example, don't ever make events move by parallel process, use the autonomous movement option instead - If I heard correctly that was introduced especially to prevent the need of parallel processes for moving events in order to reduce lag)
Thank you for that. Makes everything much clearer. The only parallel processes i'm using are for weather and day/night cycle. Everything else is either event touch or action button.
Hi again.

Check out my blog post here: http://forums.rpgmakerweb.com/index.php?/blog/93/entry-464-player-on-region-demo/

This is a little demo I whipped-up that gives an example of how to trigger events when the Player steps onto regions.

Hope this helps. 🙂
This script allows you to setup events that will trigger when a player enters/leaves a region

http://forums.rpgmakerweb.com/index.php?/topic/11327-custom-event-triggers/

event_customtriggers31.jpg

Original thread: https://forums.rpgmakerweb.com/threads/event-triggered-by-region.11446/