Darkskull

Veteran
Veteran
Joined
Sep 14, 2016
Messages
95
Reaction score
15
First Language
English
Primarily Uses
Hi there!

I'm wondering how to set up a conditional branch that triggers -only- when a player switches maps (from one map to any other map, not any specific maps). This conditional branch is going to be on a common event that is always active and, thusly, would trigger something every time a map switch occurs.

Is there any way to do this?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,646
Reaction score
15,730
First Language
English
Primarily Uses
RMMV
Code:
Wait 60 Frames
Control Variables: Current Map = Game Data > Other > Map ID
If Variable: Current Map <> Variable: Last Map
  Control Variables: Last Map = Variable: Current Map
  ... do stuff you want to be done on map change
End

You need to have the common event set to parallel process, and you need to have a wait in there, as you don't need to check it 60 times a second (and doing so would cause lag).

If you don't want it to happen on the very first map, then in your intro event on the first map, where you're turning on the switch that triggers this common event to run, add this before turning on the switch:
Code:
Control Variables: Last Map = Game Data > Other > Map ID
 

Darkskull

Veteran
Veteran
Joined
Sep 14, 2016
Messages
95
Reaction score
15
First Language
English
Primarily Uses
Hey, thanks! That was super helpful, and a very speedy reply. This is exactly what I needed, thank you.
 

Kuro DCupu

Trust me, I'm a veteran RMer
Veteran
Joined
Jul 6, 2014
Messages
525
Reaction score
1,532
First Language
Indonesia
Primarily Uses
RMMV
... or you could have an autorun event on every map which trigger the condition. Like a switch that would be turned off later on your common event. Or it's preferable to use regular common event call on that autorun if your parallel common event sole purpose is just doing that.

But I guess that would be a hassle. Whatever suit your need.
 

Latest Threads

Latest Profile Posts

Is RPG Maker VX (rgss2) still relevant? xD
ZyCHqk2.png

Something about top-downs.
I have never felt so attacked by a tree before :LZSlol: it took 10++ hours to make but at least it looks pretty LOL

Untitled-1.png
now seems like the worst time for me to need a better computer with how much stuff is costing. that and I don't thing there's much else I can do to make MV run any better with what I have.
Sigh... to have some variety in this weather. More than just sun and rain and wind and thunder.
In the meantime, I've discovered that I'm slowly becoming fatigued from the many sleepless nights my neighbors cause. Or at least their dogs. Always barking at something.
I might need a day to just sleep and recharge.

Forum statistics

Threads
118,454
Messages
1,116,101
Members
155,437
Latest member
PipingHotRamen
Top