Gather followers behind player?

mephet

Veteran
Veteran
Joined
Dec 3, 2020
Messages
34
Reaction score
67
First Language
English
Primarily Uses
RMMV
Is there a way to use the "gather followers" command so that the followers stop just behind the player, instead of moving under the player's sprite? When walking around the followers stay behind the player just fine.

I'm using the 'gather followers' to transition between an event on the map and a player follower upon exiting a room, like so:

GIF 16-01-2021 12-02-26.gif
 

Hyouryuu-Na

Very very lazy
Veteran
Joined
Jun 15, 2017
Messages
1,075
Reaction score
2,622
First Language
Not English
Primarily Uses
RMMV
Maybe use a pathfinding script to make the event go behind the follower?
From the script call list:
//for this example "charEvent" is the event you want to move, but you can use $gameMap._events
var charEvent = $gameMap._events[id];

// THIS IS THE IMPORTANT LINE, of course you have to put real coordinates instead of x & y
charEvent.moveStraight( charEvent.findDirectionTo(x, y) );
So it'll be:
JavaScript:
var charEvent = $gameMap._events[id];
if ($gamePlayer.direction() == 2) {
    var x = $gamePlayer.x;
    var y = $gamePlayer.y - 1;
}
if ($gamePlayer.direction() == 8) {
    var x = $gamePlayer.x;
    var y = $gamePlayer.y + 1;
}
if ($gamePlayer.direction() == 4) {
    var x = $gamePlayer.x + 1;
    var y = $gamePlayer.y;
}
if ($gamePlayer.direction() == 6) {
    var x = $gamePlayer.x - 1;
    var y = $gamePlayer.y;
}
charEvent.moveStraight(charEvent.findDirectionTo(x, y));
I haven't tested it of course but this is how I imagine it to be like :/
Edit: Now that I think about it, this might not work for all cases since the spot might be blocked...

Better solution- use a pathfinding plugin!
 
Last edited:

mephet

Veteran
Veteran
Joined
Dec 3, 2020
Messages
34
Reaction score
67
First Language
English
Primarily Uses
RMMV
Thanks! Maybe it's indeed better to path the event to the player and then switch on followers, instead of using the gather followers option. In this case the path is quite straightforward, but for other situations I could try that pathfinding plugin! :)
 

Latest Threads

Latest Posts

Latest Profile Posts

It seems that I have to change the order with which I make the fantasy games on my bucket list, because the intended title is used as a story element in the first two games in the line, and somebody else might take the title for their own game because the term uses real words. I can't risk going over the apparent three year limit for registering trademark ahead of time.
I am interested in collaborations so if you like my art, hit up my messages! :wub
unknown.png

Making good progress with the second chapter. :)

Still work in progress.

(Real life, it is chronically the fourth chapter that I am making.)
constructionworkconcept.pngezgif-2-0acb620ecf8d.gifezgif-2-afeaf16ebb8d.gif "The Great Wall is great. But, most people can only be the slaves who built it, leaving their bones underneath that wall. They spent their whole life to build that wall and the empire, an empire that enslaves them." :kaoswt2: I'm just going to turn it into a modern-day sad tale.

Forum statistics

Threads
110,676
Messages
1,055,102
Members
143,796
Latest member
ShadyBrain_Entertainment
Top