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,647
Reaction score
15,742
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

A woman gave me her number without me even asking for it. Then she left because she had other patients to see.
oh, hey, I forgot about all this!

my old project got abandoned after I started working too much on stuff I'd already worked on - plus, starting to hate the story I wrote for it. Then, well, a lot of serious life **** went down. I ended up moving across the country, cutting off some people, etc. - **** was rough.

So, uh, I guess I'm back for now? Funny how things work.
I'm glad I'm sticking to my guns on having fighting game mechanics in my game, from what I've read, it's not for everyone. but for the most part, I've made it so you don't have to use them motion inputs for attacks if you don't want to.
And my project's just entered the Lunar New Year Sale 2022... Let's see if it reaches it's goal of $ 7,77.
Ohmygoodness I played Dicey Dungeons for the first time last night. Gave me SO MANY IDEAS for how to fix Heidi.

Forum statistics

Threads
118,725
Messages
1,118,241
Members
155,873
Latest member
orchid_mantis
Top