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 Profile Posts

working on an A/V sync system for my game! was NOT expecting the first roadblock to be accessing a variable from a public class!! Computers are so finicky sometimes :kaosigh:
For the first real time since my game's inception I found myself actually having fun playing around with my party's skills while testing out some battles! So much so, that I actually forgot what I was doing for a minute and had to force myself to move on to the next thing! :guffaw:

That's got to be a good sign considering it only has place holder animations, enemy skills, troop comps, etc. right now. Feels good!
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!

Forum statistics

Threads
126,925
Messages
1,182,401
Members
166,755
Latest member
Hahah520
Top