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,299
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,299
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 Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:

Forum statistics

Threads
105,855
Messages
1,017,007
Members
137,563
Latest member
MinyakaAeon
Top