joket

Veteran
Veteran
Joined
Apr 24, 2021
Messages
231
Reaction score
58
First Language
English
Primarily Uses
RMMV
Hello found this for VxAce. Any ideas on how to realize the same on MV?
Thank you

 

Nolonar

Veteran
Veteran
Joined
Feb 18, 2018
Messages
390
Reaction score
544
First Language
French, German
Primarily Uses
RMMZ
I haven't tested it, but I think you can just use the following script:
JavaScript:
$gamePlayer.followers().follower(f).setDirection(d);

where f is a number representing the follower's position (0 being the first follower, 1 being the second, etc.) and d is a number representing the direction:
  • 2: Down
  • 4: Left
  • 6: Right
  • 8: Up
If you want all followers to face the same direction, you can also do this instead:
JavaScript:
$gamePlayer.followers().forEach(follower => follower.setDirection(d));
 

joket

Veteran
Veteran
Joined
Apr 24, 2021
Messages
231
Reaction score
58
First Language
English
Primarily Uses
RMMV
Nice! It works. What about make a follower to move 1 step aside?
 

Nolonar

Veteran
Veteran
Joined
Feb 18, 2018
Messages
390
Reaction score
544
First Language
French, German
Primarily Uses
RMMZ
Nice! It works. What about make a follower to move 1 step aside?

In this case you would probably use moveStraight(d) instead of setDirection(d)

And if you want them to maintain their current direction (making them move sideways or backwards), you'd need to call setDirectionFix(true) first (then setDirectionFix(false) to allow them to turn again, otherwise they'll keep facing the same direction forever even when the event is over).

For example:
JavaScript:
$gamePlayer.followers().follower(0).setDirectionFix(true);
$gamePlayer.followers().follower(0).moveStraight(2);
$gamePlayer.followers().follower(0).setDirectionFix(false);
will make the first follower (0) move down (2) while retaining their current direction.
Alternative code (does the same thing, but requires less typing):
JavaScript:
const follower = $gamePlayer.followers().follower(0);
follower.setDirectionFix(true);
follower.moveStraight(2);
follower.setDirectionFix(false);

Here's the equivalent for all followers:
JavaScript:
$gamePlayer.followers().forEach(follower => {
    follower.setDirectionFix(true);
    follower.moveStraight(2);
    follower.setDirectionFix(false);
});

Again, this is untested code.
 

bishiba

Adept
Veteran
Joined
Apr 6, 2016
Messages
278
Reaction score
161
First Language
Swedish
Primarily Uses
N/A
So... Here's what you can do, or hack... Hehe...
1642537998664.png
If you do this, you'd create a global variable called gameEvent, would probably be good to use another variable name for that to avoid any conflict. I've tried it and I did not run into any issues, granted I tried it for five minutes :p

And after you're done, the follower will return to you as soon as you move :p
 

Latest Threads

Latest Profile Posts

Working on Project Zelda!

The title screen lacked enough sparkles... this oversight has been rectified. :kaopride:
67 frames for a dragon transformation? Eh, seems about right. XD
It's not about your writing, it's about your mapping.
Newbie, please be gentle

Forum statistics

Threads
122,084
Messages
1,146,389
Members
160,373
Latest member
gauzera
Top