RMMV Conditional check to see if event(ID) exists on current map

HankB

Sanitized for your Protection
Veteran
Joined
Mar 5, 2021
Messages
212
Reaction score
109
First Language
English
Primarily Uses
RMMV
It doesn't matter if the event is "erased" or not, I just want to see if it's on the map at all. The reason is I have a huge template map with almost 500 events, so when I make a new playable map, I end up deleting a lot of unnecessary events, and it gets tedious doing it manually.

Thanks!
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
3,069
Reaction score
2,351
First Language
Portuguese - Br
Primarily Uses
RMMZ
Hi there!

You can just do:
$gameMap.event(EVENT ID)

If the event does not exist, it will return a falsy value.
 

HankB

Sanitized for your Protection
Veteran
Joined
Mar 5, 2021
Messages
212
Reaction score
109
First Language
English
Primarily Uses
RMMV
@Eliaquim

Thank you, that was very helpful. I had events that were spawning in other events, so I used it as a counter, and it turned out I had 610 events on a single map, so that was good to know.
 

Latest Threads

Latest Posts

Latest Profile Posts

Bex
Finally upgraded to RMMZ.
ScreenShot_11_28_2022_7_52_34.png
FINALLY, I figured out how to get the "tail" to appear IN the window and not directly below it lol. now it looks like it's part of the window and not hanging from the bottom of it.
Twitch! Stream is about to go live with some Dark Souls 2! Feel free to drop by!
Has anyone ever wanted to choose how they play? I've been working on Black Moon, a project where you can fight against ancient beasts by commanding an army of former gods and goddesses. But what makes it different is that there are different ways to give your choice heroes either Red, Green, or Blue weapons/armor, and each grants different abilities. More coming soon!
Can Elon crash Twitter faster? I want something as big to replace it so I can promote my game there. I also need to actually do promotion this time, heh.

Forum statistics

Threads
126,918
Messages
1,182,351
Members
166,748
Latest member
pixelhans
Top