set actor to x,y

freebooter

Veteran
Veteran
Joined
Oct 20, 2017
Messages
104
Reaction score
5
First Language
German
Primarily Uses
RMMV
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!
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,297
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
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).
 

Gamefall Team

Nebula Games Leader
Veteran
Joined
Jan 10, 2017
Messages
348
Reaction score
473
First Language
Italian
Primarily Uses
RMMZ
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.
 

freebooter

Veteran
Veteran
Joined
Oct 20, 2017
Messages
104
Reaction score
5
First Language
German
Primarily Uses
RMMV
@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?
 

Gamefall Team

Nebula Games Leader
Veteran
Joined
Jan 10, 2017
Messages
348
Reaction score
473
First Language
Italian
Primarily Uses
RMMZ
If you're meaning to show and hide them, you can use these script calls:
Code:
$gamePlayer.showFollowers() //Show followers;
$gamePlayer.hideFollowers() //Hide followers
 

freebooter

Veteran
Veteran
Joined
Oct 20, 2017
Messages
104
Reaction score
5
First Language
German
Primarily Uses
RMMV
Yes, that's exactly what I meant. Thanks.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,297
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
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.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Do you have an audio you want me to animate? If so send me the youtube link and I’ll animate it.
Okay, so I'm working on Draft 2 of my game's script.
Will try to keep you guys posted, if you're interested!

This is vid of my new game, Crystalgazers. A demo is available on my Gamejolt

I just thought of the best achievement for my game: "'I Didn't Know You Were a Developer!' Find and enter one or more dev room(s)."
I made this animation to apply to a job, what do you think?

Forum statistics

Threads
105,591
Messages
1,014,844
Members
137,255
Latest member
KosnicGames
Top