set actor to x,y

Hello guys,

I'm working on a camping-map, a map which pops up each time the player uses the camping-skill. On this map all the actors (1-4) should be placed around a campfire.

How can I place actor [ID] to a given coordinate? I only know this command

$gamePlayer.locate(8,8);

which places the party leader. Anybody an idea on how to solve this?

Thanks in advance!
If this map is the same one used each and every time, then you only need to place the player. The other characters would already be there as NPC sprites. Assuming that they all stay sat around the fire, you don't need to do anything more than that. If, however, you want the player to move around, then you would need to use the 'Change Player Followers' command on the transfer event taking them to the map (turn followers OFF) and again when they leave the map (turn followers ON).
Using $gamePlayer.locate(x, y), you will move all the party to the selected position. In your campfire map, you can try something like this:

Code:
$gamePlayer.locate(x,y) //First move the party in the x, y, that is the position where you want to place the party Leader;
$gamePlayer.setDirection(d) //If you need to change the direction of the party leader, too;
if($gamePlayer.followers()._data[0] !== undefined) { //Check if the first follower is in the party;
$gamePlayer.followers()._data[0].locate(x, y) //Change the x, y position
$gamePlayer.followers()._data[0].setDirection(d) // Change the direction if necessary;
}
if($gamePlayer.followers()._data[1] !== undefined) { //Check if the second follower is in the party;
$gamePlayer.followers()._data[1].locate(x, y) //Change the x, y position
$gamePlayer.followers()._data[1].setDirection(d) // Change the direction if necessary;
}
if($gamePlayer.followers()._data[2] !== undefined) { //Check if the third follower is in the party;
$gamePlayer.followers()._data[2].locate(x, y) //Change the x, y position
$gamePlayer.followers()._data[2].setDirection(d) // Change the direction if necessary;
}

The d value in the direction can be:
- 2 --> Bottom;
- 4 --> Left
- 6 --> Right
- 8 --> Up

WARNING!
Obviously, if you move by input your character in your campfire map, the follower will try to follow him not remaining in the position you have set for them.
@Kes and @Gamefall Team : Thanks for your quick replys.
Setting the characters as NPC on the map doesn't work, because I dont know which character sprites the gamer chose.

But the script code works like a charm. Thanks for that! Just one point: Moving on the map I dont show the followers. But I have to show them on the camping map to set the chars to their places around the fire. How can I toggle on/of the party-follow-mode with a script command?
If you're meaning to show and hide them, you can use these script calls:
Code:
$gamePlayer.showFollowers() //Show followers;
$gamePlayer.hideFollowers() //Hide followers
Yes, that's exactly what I meant. Thanks.
Those scriptcalls for showing/hiding followers replicate the commands on tab 2 that I referred to. You can chose to do it by script call or by ordinary event command.
Ah, I see. Thanks

Original thread: https://forums.rpgmakerweb.com/threads/set-actor-to-x-y.88560/