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,072
Reaction score
2,353
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 Profile Posts

KDS
Hey guys! Iam currently updating my free digital art shop , let me know if you need anything done :) https://forums.rpgmakerweb.com/index.php?threads/kds-free-open-digital-art-shop.17097/
Hello! I’d like to ask where is a good place to start logging about my game dev progress as production of my game goes forth
In one of our campus classrooms was a bag full of stuff people forgot there... my bag. That I forgot there xD
You know your room is too tiny for how much stuff you have when it gives you literal insomnia. I just cleared a bunch of stuff out and man it feels good!
1670381555475.png
Meet the Kernel. You encounter him in cyberspace. He's important!

Forum statistics

Threads
127,098
Messages
1,183,965
Members
167,028
Latest member
Edujandro
Top