Reset/Activate Event

Hello everyone! I'm try to make a board game where I can move pawns, I actually use "Set Event Location" with variables x/y to move pawns and it's work pretty well.
But I don't find a way to reset all my "pawns event" to their original location and I don't want to be forced to quit the game each time I want to reset them.
Technically I can move them individually but it's pretty annoying, so if someone have a solution it's welcome.

Another problem, in my game you construct a way from a empty space. So you can change the tiles/case of the board, for now I use selfswitchs to do it but I have to do manually to each tiles I want to change.
And I'm wonder if there no to automitize it, because when you construct/change tiles on the field you change many at once with a specic form. So I'm wonder if there is a way to activate selfswitchs thanks to their location x/y?
Hmmmm, can't you just leave and come back to reset them, but if not I think it's (replace 1 and 10 with the correct range):

for (let i = 1; i < 10; i++) {
$gameMap.event(i).locate($dataMap.events[i].x, $dataMap.events[i].y);
}

For the second part can't you just put the first tile to activate the others with switches too? Don't know if I understood correctly though.
You might consider Shaz's Tile Changer plugin, it actually changes the tiles on the map rather than having to place tons of events.

And it has plugin commands that let you change tiles in an area rather than one at a time.
Hmmmm, can't you just leave and come back to reset them, but if not I think it's (replace 1 and 10 with the correct range):

for (let i = 1; i < 10; i++) {
$gameMap.event(i).locate($dataMap.events[i].x, $dataMap.events[i].y);
}

For the second part can't you just put the first tile to activate the others with switches too? Don't know if I understood correctly though.
I cannot leave and come back because there is only 1 map.

I know you can reset selfswitchs with the command
Code:
$gameSelfSwitches.clear();
, so I think it must be have an equivalent for event.

The problem in the second part is you can choose any empty tiles and then change them at once (6 cases in 3x4 area) so I cannot just put the first tile to do it when every tiles can be use as well.
I cannot leave and come back because there is only 1 map.
You absolutely could force the game to reload the map. But the code given to you above would work fine.

I know you can reset selfswitchs with the command
Code:
$gameSelfSwitches.clear();
, so I think it must be have an equivalent for event.
I'm not sure why you think it must, those are two different things. One of them (self switches) is supposed to be saved when you leave a map; the event location is not.

The problem in the second part is you can choose any empty tiles and then change them at once (6 cases in 3x4 area) so I cannot just put the first tile to do it when every tiles can be use as well.
I don't know what that means for why you can't do it. Did you look at the plugin I suggested?
Yeah, did you try the code I gave you earlier for resetting the event locations?
(Or check the plugin you were suggested.)

So I'm wonder if there is a way to activate selfswitchs thanks to their location x/y?

As for the second part, I think you can control a self switch of an event at a certain location with:
$gameSelfSwitches.setValue([mapId, $gameMap.eventIdXy(x,y), switchId], value);
You might consider Shaz's Tile Changer plugin, it actually changes the tiles on the map rather than having to place tons of events.

And it has plugin commands that let you change tiles in an area rather than one at a time.
I'm not sure with this plugin you can reset tiles except if you reload the map.

And even if it's case it's only work for precize coordinate.

Try to imaginate it like that:
tiles_change.png


You determine the localization for each tiles in an apart coordinate system, then you applicate it in the map coordinate:
x+X
y+Y
I'm not sure with this plugin you can reset tiles except if you reload the map.
That is not anything like what I said.

The plugin would not be for you resetting self switches. I was responding to the second question you asked:
Another problem, in my game you construct a way from a empty space. So you can change the tiles/case of the board, for now I use selfswitchs to do it but I have to do manually to each tiles I want to change.
And I'm wonder if there no to automitize it, because when you construct/change tiles on the field you change many at once with a specic form.


And even if it's case it's only work for precize coordinate.
If you need to use variables, you can always use a script call version of any plugin command.

But if that's too advanced, then the answer is no, there's no easier way to automate it.
That is not anything like what I said.

The plugin would not be for you resetting self switches. I was responding to the second question you asked:




If you need to use variables, you can always use a script call version of any plugin command.

But if that's too advanced, then the answer is no, there's no easier way to automate it.
ok I manage to active 1 specific self-switch in distance in using coordinate x/y through variables, so I just need do activate many self-switches in one time so no it's not too advanced

Code:
var key = [mapId, $gameMap.eventIdXy(($gameVariables.value(x) + $gameVariables.value(X)),($gameVariables.value(y) + $gameVariables.value(Y))), 'key'];
$gameSelfSwitches.setValue(key, true);

Original thread: https://forums.rpgmakerweb.com/threads/reset-activate-event.174209/