Hard one... default position

Did you know any way for know the default position of an objet? It's must exist a way...


I mean, when I open into a map "object X" is at position (12,34), This objet can move on the map but when I activate a switch it's must return at is default position.


Of course, it's can be done with variable, but because the number of event that will take me hundred of my precious variables... It's must exist a way for know de default location of an event... Thanks for your help.
Can you do it this way using only events?


Make a new event page in the event you want to move (with the conditions in the left side of the screen being the switch).  In this page run a parallel or autorun process that sets the event location where you want it post-switch, and then flick a self switch.  Make another event page with the self switch as the condition, then put whatever you want to do in the moved event in there.


If there are weird transitions just play with the event transparency ON/OFF and map fadein commands.
I haven't tested this yet, but I believe when a Game_Event object is created, it has its own x and y position, which initially get set from $dataMap.events[id].  I think, when an event moves, its x and y will obviously change, but the x and y of the source object might stay the same.


So the following command might work, in a Set Move Route script call:

Code:
this.locate(this.event().x, this.event().y);
Curently I got with this code: 

Code:
this.locate(this.event().x, this.event().y);

Undefined is not a function.


work with:


this.character(0).locate(this.character.event().x, this.character(0).event().y);
the following command might work, in a Set Move Route script call:

Code:
this.locate(this.event().x, this.event().y);



I'm guessing you just did it as a script call, not a script call within a Set Move Route command as I said.  The call you posted would work if it was running in Game_Interpreter context.  My reason for saying to put it in a Set Move Route command is that it would run in the Game_Event context, and the command would work.

Original thread: https://forums.rpgmakerweb.com/threads/hard-one-default-position.64064/