Need help with Yanfly's Move Route Core

Plugins Used:


For the love of Pete, I just can't figure how to make an event move to a designated event ID stored in a self variable.

I'm inserting the script in the SetMovement Route:

◆Set Movement Route:This Event
: :◇Script:let npcdest = this.getSelfVariableValue(10, this.eventId(), 37); this.moveToEvent(npcdest);

But no matter how I do this, it's just not working. I even double-checked if Self Variable 37 has the event ID stored already and it is.

I tried manually putting the number in and it works but for some reason whenever I try to get the value in a self variable it's not working
◆Set Movement Route:This Event
: :◇Script:let npcdest = 2; this.moveToEvent(npcdest);

I also tried using the same two method in the other Script Call outside the Set Movement Route and it seems like its also not working.



Anybody can point out what I'm doing wrong?
Not really sure - I used to have this plugin but lost my hard drive, so I can't take a look and see what goes on behind the scenes.

I suspect getSelfVariableValue is a function of Game_Interpreter, but in the Set Movement Route command, this is a Game_Character, and the getSelfVariableValue function doesn't exist.

Do you have any errors in the console when the event is supposed to move? I'd expect it to say something like getSelfVariableValue is an undefined function or something like that. Not sure why it's not showing the message on your screen though.

Maybe try this (getting rid of the intermediate variable in the process, as there's no need for it):

Set Movement Route: This Event
> Script: this.moveToEvent(this._interpreter.getSelfVariableValue(10, this._eventId, 37));

I have deliberately put this._eventId instead of this.eventId() because, again, we're IN the event object when we're running this, while this.eventId() relies on this being the interpreter, and it's not.
Ugh! I HAD downloaded Yanfly's self switches & self variables plugin, but then my foster kitten knocked my hard drive off the desk and it doesn't work anymore.

I think the self variable id is not '37', but is something like 'SELF VAR 37'.

Unfortunately, because I no longer have it, and it's no longer free, I can't actually go take a look and see.

I tried your suggestion but still no luck 🙁

I mean, I've been using the same method for a while now with Yanfly's self switches and variables and it works on other things. It just makes me wonder why its not working with this one 🙁
Please recheck my post. I edited it while you were posting.
Please recheck my post. I edited it while you were posting.


It worked! OMG, Kamisama. I didn't even know about this interpreter thingies till now. Thank you so much :yhappy: You deserve a place in my credit page :yhappy:
lol - no, don't credit me for that. If you do that for every person who helps you, it'll take longer to read the credits than it would to play your game! 😀

Original thread: https://forums.rpgmakerweb.com/threads/need-help-with-yanflys-move-route-core.118036/