Event triggered by region.

Hiiragidaniel

Composer
Member
Joined
Dec 24, 2012
Messages
25
Reaction score
0
First Language
English
Primarily Uses
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.
 

light487

Parrot Keeper
Veteran
Joined
Mar 26, 2013
Messages
852
Reaction score
26
First Language
English
Primarily Uses
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 
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
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/
 

Hiiragidaniel

Composer
Member
Joined
Dec 24, 2012
Messages
25
Reaction score
0
First Language
English
Primarily Uses
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.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
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)
 

Hiiragidaniel

Composer
Member
Joined
Dec 24, 2012
Messages
25
Reaction score
0
First Language
English
Primarily Uses
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.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
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/

 
Last edited by a moderator:

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,574
Latest member
nikisknight
Top