MZ Event Move Route: How to filter and search events

Let's say I have an event that should regularly look for the next event with a certain property (e.g. a selfswitch) and then go there. In the visustella engine there is "Move to Event: x", which only works with ID, which means that I would have to write the algorithm for finding the event myself. In itself this is not a problem, but my concern is that I might reach the limits of my computing capacity, which is why I wanted to ask whether something like this can be implemented in a meaningful way without overtaxing the rpg maker. It's generally not absolutely necessary for my game, it's more of a little gimmick that I'm trying out.
Moved to: Plugin Requests
If you want it to move toward the next event that has, say, self switch A on, wouldn't you just do:
Code:
this.moveTowardCharacter($gameMap.events().find(event => $gameSelfSwitches.value([$gameMap.mapId(), event.eventId(), "A"])));

Or am I misunderstanding something?
@ATT_Turan I think he needs a property part like a notetag/comment so if it has an event of "something",
it goes there, instead of the event ID.

as I dont know the VS plugin he mentioned, I think if you are able, to make someting like this in addition?
but for the selfswitches can be true, but if he needs a tag to find instead of "selfswitches", he has some
options to use (if I understand his question 🙂
I think he needs a property part like a notetag/comment so if it has an event of "something",
it goes there, instead of the event ID.
I'm not certain what that means - the OP gave the specific example of a self-switch, so the above code will find the first event with that self-switch. If you want to search for a notetag, then you just replace the criteria inside the find() function with looking for a meta tag. I assume Hellinfernal knows or can look up how to do that.

as I dont know the VS plugin he mentioned, I think if you are able, to make someting like this in addition?
I can't modify any VisuStella plugin command because their plugins are obfuscated. But doing this is code from the default engine, it doesn't require any plugin.

Original thread: https://forums.rpgmakerweb.com/threads/event-move-route-how-to-filter-and-search-events.154563/