MZ Making one event move to another event by name specifically

Hi! I was wondering if there was any kind of plugin based on the title above. If it works with VisuStella's furniture system plugin, I would be happiest!

Basically, I'm working on a project in which an NPC would be spawned from one map to another. This map would be one where custom furniture can be placed anywhere, and each furniture piece is an event using VisuStella's plugin. Once spawned, the NPC would walk over to this furniture event and interact with it.
I've found other movement plugins, but I've yet to see one which does it by the event's name. This makes it difficult, as I don't know how I'd be able to make the NPCs move to events that have an unpredictable ID.

Thank you so much for looking into this! If this is the wrong category, please let me know as I am unfamiliar with this site.

I will also use a plugin for MV, but prefer MZ as it is the one I am making my project on.
Yeah so JS plugin request if you want a plugin made for you, JS support is help in regards to a plugin you are using and need help with said plugin.

Have you tried doing it by Event ID rather then by name?
Yeah so JS plugin request if you want a plugin made for you, JS support is help in regards to a plugin you are using and need help with said plugin.

Have you tried doing it by Event ID rather then by name?
Yes, I have tried by Event ID. While it does work, it unfortunately only does for events on that map, and not for furniture placed by the VisuStella plugin. I was hoping to find a plugin that could work with both!

Would it be better to move this to plugin support, and if so, how can I move it?
This is doable by script, the problem is more than one event can have the same name.

If you have three "chair"s in the map, which one would you go to?
This is doable by script, the problem is more than one event can have the same name.

If you have three "chair"s in the map, which one would you go to?
Do you know what script you'd have to do? If so, I would love to know and thank you as well!
I also had this concern, though I figured this could potentially be something that's checked through eventing.
Something like
Code:
for (var i = 0; i < $gameMap.events().length; i++){ if ($gameMap.events()[i].event().name == "Chair"){ $gameVariables.setValue(20, $gameMap.events()[i]._id); break;} }

Loop through every event on the map, if the event is named "Chair", set Game Variable 20 to its id, stop at the first result.

Then you would just use your movement script to move to event ID ($gameVariables.value(20))
Something like
Code:
for (var i = 0; i < $gameMap.events().length; i++){ if ($gameMap.events()[i].event().name == "Chair"){ $gameVariables.setValue(20, $gameMap.events()[i]._id); break;} }

Loop through every event on the map, if the event is named "Chair", set Game Variable 20 to its id, stop at the first result.

Then you would just use your movement script to move to event ID ($gameVariables.value(20))
Thank you! I'll have to test this, I'll let you know how it works asap.
To find the first event ID on a map with a given name, you can set a variable to
Code:
$gameMap.events().find(event => event.event().name == "chair").eventId()
To find the first event ID on a map with a given name, you can set a variable to
Code:
$gameMap.events().find(event => event.event().name == "chair").eventId()
Thank you! I'm a beginner at this, would you put this before the moving command?
Thank you! I'm a beginner at this, would you put this before the moving command?
You do that in the script field for Control Variables to put the event ID in it.

You would have to have some way to be able to use that ID in a move route - some movement plugin or something. That's not built into RPG Maker.

I suppose you could use Control Variables math to calculate the X and Y differences between your current position and the chair event, then use Loop event commands with moving a single space at a time to get there, but that wouldn't account for any other furniture in the way.
The furniture system has a Javascript on place notetag where you could store the event x and y coordinates to variables and then use the event and movement core plugin command move the event to those x y coordinates
Just wanted to report to everybody that I've got it all working. Thank you to everybody's suggestions, you were a lot of help!

Original thread: https://forums.rpgmakerweb.com/threads/making-one-event-move-to-another-event-by-name-specifically.171093/