RMMV [YEP_EventSpawner]Check if coordinate is valid for spawning.

KaitlynKitty

Regular
Regular
Joined
Apr 6, 2021
Messages
196
Reaction score
65
First Language
English
Primarily Uses
RMMV
In my current game, I've been working on a system of spawning and placing furniture. The issue is that I don't know how to check if the event failed to spawn. I'd like to check if the given coordinates are valid beforehand, and if not, avoid consuming the resources and inform the player what went wrong.


Edit: Found a solution.
1700580122980.png

Edit 2: If you use variables for the coordinates, you need to add .length or it won't work.
$gameMap.eventsXy($gameVariables.value(3), $gameVariables.value(4)).length > 0
 
Last edited:

Aerosys

Regular
Regular
Joined
Apr 23, 2019
Messages
1,040
Reaction score
1,097
First Language
German
Primarily Uses
RMMZ
For example like this:

Code:
If: Script: ...
    Message: There's already an event there.
    Switch: Success OFF
Else
    Script: Yanfly...
    Switch: Success ON
End
 

Latest Threads

Latest Posts

Latest Profile Posts

I've been watching videos about the videogame streamer Open Hand charity scandal, and the rabbit hole keeps getting deeper. At first it was just a lot of donated money being grossly neglected for years, and now there's a lot of money unaccounted for, which could turn this into a legitimate IRS crackdown.
Let's have some fun with my advent calendar. What would you like to see for Day 3: land, sea, or air? :rheh:
I've been thinking about doing a jokey submission for the Christmas jam in which, like a cartoon special where all the characters "play" a counterpart in A Christmas Carol, my MagiCats would each play a role from the C.A. Smith story The Coming of the White Worm, with Cyprian as Evagh, Rousalie as Dooni and so forth. But in the end, I figure all my development efforts should go toward the game proper.
In twitter, square phoenix had successfully prompted chatgpt to make the mini game watermelon pangpang.

drew some stuff to see how frontview might look. not entirely sold on or off of it yet. "could" work, but something feels missing.

Forum statistics

Threads
136,697
Messages
1,268,894
Members
180,412
Latest member
LoftTheSkyWarrior
Top