RPG Maker Forums

This is my first post on this forum, so my apologies in advance if I've placed this question in the wrong spot, I'm asking a newbie question or anything like that.

I wanted to see if it was possible to decorate a map with objects, similar to placing furniture in Animal Crossing, via Yanfly's Event Spawner plugin.

To spawn events via Yanfly's Event Spawner plugin, the following script call is used:
Yanfly.SpawnEventAt(mapId, eventId, x, y, preserved)

I've seen someone else say you can replace x and y with variables. If that's true, then the variables used could be equal to the player's x and y coordinates on the map.
The only problem with doing that is the event then spawns on top of the player. The player can walk away from the event and then the event will behave like normal but it's jarring to have the event on top of the player in the first place.

I'm very new to Javascript but I wrote what I believe to be the correct way to spawn events in front of the player:
if ($gamePlayer.direction(2)) {
Yanfly.SpawnEventAt(1, 5, $gameVariables.value(1), $gameVariables.setValue(2, $gameVariables.value(2)+1), true)
} else if ($gamePlayer.direction(4)) {
Yanfly.SpawnEventAt(1, 5, $gameVariables.setValue(1, $gameVariables.value(1)-1), $gameVariables.value(2), true)
}

( I only checked if the player is looking down or left at the moment )

I'm posting this here before purchasing the plugin to confirm if this is the code needed to spawn events in front of player. Please let me know if there's a mistake or if it's even possible to do this with Yanfly's Event Spawner plugin.

Thanks a bunch!

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,049
Messages
1,018,547
Members
137,835
Latest member
yetisteven
Top