Changing event position problem

So I made a common event that has a simple AI that moves a few events around in the world map, usually I call this event from a different room, the camp room, the idea is that the player goes to sleep then I do a fade out, transfer to the world map and call this common event, but I've found that if I do this many times the events don't always move.
So I made a little test and added some event in the world map that I can interact with to call this common event, and all the event movement happens perfectly. so it seems there's some kind of incompatibility with moving events around with commands from another room. anybody knows why this is?
Without seeing the event, it's hard to tell. But if you call something with move routes, it will always be applied to the events of the map you are currently on.

So, if your Common Event wants to move event 001, 002 and 003, it'll do that on your Camp map.
By default, character-target event commands (e.g. Set Event Location or Set Movement Route) do nothing if the event started on a different map:
Spoiler: Game_Interpreter#character (rpg_objects.js)
JavaScript:
Game_Interpreter.prototype.character = function(param) {
    if ($gameParty.inBattle()) {
        return null;
    } else if (param < 0) {
        return $gamePlayer;
    } else if (this.isOnCurrentMap()) {
        return $gameMap.event(param > 0 ? param : this._eventId);
    } else {
        return null;
    }
};
As always, plugins may change this.

I have worked around this before (for a randomised dungeon) by putting a Parallel event on the target map that moves other events, then erases itself. Erase Event lasts until you leave and revisit the map, and Parallel doesn't have to wait for the transfer fade before starting.
By default, character-target event commands (e.g. Set Event Location or Set Movement Route) do nothing if the event started on a different map:
Spoiler: Game_Interpreter#character (rpg_objects.js)
JavaScript:
Game_Interpreter.prototype.character = function(param) {
    if ($gameParty.inBattle()) {
        return null;
    } else if (param < 0) {
        return $gamePlayer;
    } else if (this.isOnCurrentMap()) {
        return $gameMap.event(param > 0 ? param : this._eventId);
    } else {
        return null;
    }
};
As always, plugins may change this.

I have worked around this before (for a randomised dungeon) by putting a Parallel event on the target map that moves other events, then erases itself. Erase Event lasts until you leave and revisit the map, and Parallel doesn't have to wait for the transfer fade before starting.
Without seeing the event, it's hard to tell. But if you call something with move routes, it will always be applied to the events of the map you are currently on.

So, if your Common Event wants to move event 001, 002 and 003, it'll do that on your Camp map.
thanks for the reply, after a lot of trial and error I figured out what happened, every time I change maps when I come back to the world map it resets the position of the event, that's why it wasn't working. and by the way, I did manage to move the event from the commands inside an event in another room, the trick was to add a 10 second wait right after the transfer.
Only the current map exists in memory, all other maps (and their events) do not exist.

so you can only simulate what might happen and apply that simulation only after entering the map with the events.
And when loading a map, it of course loads the original event position stored for the map, unless a plugin redirects the event positions into the save file (the original map file is read-only because it needs to be available for any new game or savefile in the same way.

One possible way to handle the time in the map is to give each event multiple pages conditioned on the time variable, allowing the event to follow different commands based on for example the hour of the day.

as for the second half, there are a few plugins giving various ways to store a changed event position, often called "Remember Event Position" or something like that.
You'd have to queue up the event position changes in some global data structure like a Control Variable, which you would have to make an array or object to store multiple values, then have a parallel or autorun event execute those changes when you get to that map.

Or you use a save event location plugin and edit that (probably json) data from the current map.
Only the current map exists in memory, all other maps (and there events) do not exist.

so you can only simulate what might happen and apply that simulation only after entering the map with the events.
And when loading a map, it of course loads the original event position stored for the map, unless a plugin redirects the event positions into the save file (the original map file is read-only because it needs to be available for any new game or savefile in the same way.

One possible way to handle the time in the map is to give each event multiple pages conditioned on the time variable, allowing the event to follow different commands based on for example the hour of the day.

as for the second half, there are a few plugins giving various ways to store a changed event position, often called "Remember Event Position" or something like that.
the way I got around this is that I saved a list of positions with id included in one of the variables, when the player leave the map I save them and when the player comes back I load them. that way they'll also be inside the save file.

Original thread: https://forums.rpgmakerweb.com/threads/changing-event-position-problem.174801/