Follower's Move Routes

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
15,354
Reaction score
8,533
First Language
English
Primarily Uses
RMMV
Okay, here is a pic of my database. Leo is the glasses, Teya the girl, Tor the redhead.

Database:



When my event looks like this:



I get this after those first two move routes, which is exactly what I want.



Leo and Tor move exactly where I want them to.

However, the next move routes don't pan out properly.

So when I have this:



I get this from the first two move routes, not what I want. The 3rd works exactly right, but the last doesn't.

I appreciate your help as I'm sure it's my error innot understanding scripts well. I might just need work it with events for now.
 
Last edited by a moderator:

♥SOURCE♥

Too sexy for your party.
Veteran
Joined
Mar 14, 2012
Messages
693
Reaction score
411
Primarily Uses
Sorry if I didn't make it clear in my last post, I was trying to say that database actor indexes aren't used in the script call. You use the follower index position.

Let's say, for example. Leo is your main character, Teya follows Leo and Tor follows Teya. Teya would be follower 0 and Tor would be follower 1.

So, if you want to execute the actions (move routes or whatever) in Teya, you should use.



Code:
$game_temp.lfmr_follower = 0
And if you want it to be Tor instead of Teya, you use



Code:
$game_temp.lfmr_follower = 1
Remember, 0 for the following member closest to the player, 1 for the following member that is following the closest to the player one, 2 for the following member that is following the one who's following the closest to the player.

Tell me if it works for you now!

Edit → I just updated the script to support using the name of the follower, check that out! It should be easy for you now, mlogan!
 
Last edited by a moderator:

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
15,354
Reaction score
8,533
First Language
English
Primarily Uses
RMMV
Sorry if I didn't make it clear in my last post, I was trying to say that database actor indexes aren't used in the script call. You use the follower index position.

Let's say, for example. Leo is your main character, Teya follows Leo and Tor follows Teya. Teya would be follower 0 and Tor would be follower 1.

So, if you want to execute the actions (move routes or whatever) in Teya, you should use.



Code:
$game_temp.lfmr_follower = 0
And if you want it to be Tor instead of Teya, you use



Code:
$game_temp.lfmr_follower = 1
Remember, 0 for the following member closest to the player, 1 for the following member that is following the closest to the player one, 2 for the following member that is following the one who's following the closest to the player.

Tell me if it works for you now!

Edit → I just updated the script to support using the name of the follower, check that out! It should be easy for you now, mlogan!
Thanks for all your help Lemony. I thought that's what you were saying, but when I tried that, I got them all staring at the building. Not sure why.

I just reworked it for now using events since this is for the contest deadline today. But I will definitely check it out with user names, and play around with it because iwith events it's not smoothest scene possible and this script will be a huge help in the future (when I can eventually get the hang of it.)
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
15,354
Reaction score
8,533
First Language
English
Primarily Uses
RMMV
Okay, so I've finally had time to sit down and play with this. When I open up a brand new sample project, I can easily get this script to work how it is supposed to. However, in the game I'm actually wanting it to work in, I get this error, whether or not I've called a script relating to it or not.

lemony.png
Any thoughts?
 

Mr. Bubble

Makes stuff.
Member
Joined
Mar 1, 2012
Messages
853
Reaction score
163
Okay, so I've finally had time to sit down and play with this. When I open up a brand new sample project, I can easily get this script to work how it is supposed to. However, in the game I'm actually wanting it to work in, I get this error, whether or not I've called a script relating to it or not.

Any thoughts?

1) Are you using any other custom scripts?

2) Are you loading from an old save file?
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
15,354
Reaction score
8,533
First Language
English
Primarily Uses
RMMV
1) Are you using any other custom scripts?

2) Are you loading from an old save file?
1. Yes, modern algebra Journal/Quest script and I have Yanfly's Skill Cost in there, though it's not actually in use at the moment.

2. Probably because the point I need it is at the end of the game, and I likely didn't want to start all the way through to test this. I will put a sample event in the beginning and try it out.

added: I went back, added the script in, called the script once, started a new game, and it almost immediately crashed and gave me the same message as earlier (no where near the script call I added in, that was a good 15 minutes later in the game). I'm assuming it's clashing with a script, which is unfortunate because I need the other two and can certainly manage without this one.

This one would be nice for future projects though.
 
Last edited by a moderator:

Mr. Bubble

Makes stuff.
Member
Joined
Mar 1, 2012
Messages
853
Reaction score
163
I looked at this script's instructions and the only reason I think that error would pop up is if you use an index that's not an integer. Other than that, I don't know. The code that uses that method is a bit hard to follow for me.

Also, you never want to load from an old save file after adding, removing, or making changes to scripts in your script editor or else you may receive errors that don't otherwise occur in new games.
 
Last edited by a moderator:

Mewens

Veteran
Veteran
Joined
Apr 24, 2012
Messages
65
Reaction score
5
Primarily Uses
This is great, Lemony. A question --

Can I use this to set a touch encounter to start a battle when it touches a follower?

For example, could I use this to track follower 0's and follower 1's X and Y coordinates, then compare them to the touch encounter's X and Y?

EDIT: I'm getting the same error as mlogan. I've used both integers and player names.

error1.jpg

The only place where I'm calling the script:

Events.jpg
 
Last edited by a moderator:

♥SOURCE♥

Too sexy for your party.
Veteran
Joined
Mar 14, 2012
Messages
693
Reaction score
411
Primarily Uses
Hi! Here's a fixed version.

Code:
#==============================================================================
# ** Follower's Commands (also known as Follower's Move Routes v.2.2)
#------------------------------------------------------------------------------
# * This little script allows to use in followers any editor command designed
# to work with events, this includes Show Animation, Show Balloon Icon,
# Set Event Location and Set Move Route.
#------------------------------------------------------------------------------
# * To use it, simple put a script call with the following before each of the
# previously mentioned commands.
# $game_temp.lfmr_follower = follower index OR folower name
# Use $game_temp.lfmr_wait = true/false to make the followers wait/follow again.
# Example
# $game_temp.lfmr_follower = 1 OR 'Name' : $game_temp.lfmr_wait = true
#==============================================================================
#==============================================================================
# ** Game_Temp, Alias to initialize.
#------------------------------------------------------------------------------
# Adds variable to contain follower's index and to turn on/off following.
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :lfmr_follower ; attr_accessor :lfmr_wait
#--------------------------------------------------------------------------
# * Initialize Alias
#--------------------------------------------------------------------------
alias lemony_moveroute_initialize initialize
#--------------------------------------------------------------------------
# * Initialize
#--------------------------------------------------------------------------
def initialize
lemony_moveroute_initialize
@lfmr_follower, @lfmr_wait = nil, false
end
end
#==============================================================================
# ** Game_Interpreter
#------------------------------------------------------------------------------
# Alias to get_character to return the desired follower if an index was set.
#==============================================================================
class Game_Interpreter
#--------------------------------------------------------------------------
# * Get Character Alias
#--------------------------------------------------------------------------
alias lemony_moveroute_get_character get_character
#--------------------------------------------------------------------------
# * Get Character
#--------------------------------------------------------------------------
def get_character(param)
i, $game_temp.lfmr_follower = $game_temp.lfmr_follower, nil
fc = $game_player.followers[i] if i.is_a?(Integer)
fc ||= $game_player.followers.each {|f| return f if f.actor.name == i} if !i.nil?
i.nil? ? lemony_moveroute_get_character(param) : fc
end
end
#==============================================================================
# ** Game_Follower
#------------------------------------------------------------------------------
# Alias to chase_preceding_character for preventing the execution if a move
# route exist for this character or for the preceding one.
#==============================================================================
class Game_Follower < Game_Character
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :move_route
attr_reader :original_move_route
#--------------------------------------------------------------------------
# * Chase Preceding Character Alias
#--------------------------------------------------------------------------
alias lemony_moveroute_chase_preceding_character chase_preceding_character
#--------------------------------------------------------------------------
# * Pursue Preceding Character
#--------------------------------------------------------------------------
def chase_preceding_character
p_c = @preceding_character if p_c.nil?
return if (@move_route != @original_move_route) || (p_c != $game_player &&
(p_c.move_route != p_c.original_move_route) || $game_temp.lfmr_wait)
lemony_moveroute_chase_preceding_character
end
end
Let me know if you run into other errors!
 

Mewens

Veteran
Veteran
Joined
Apr 24, 2012
Messages
65
Reaction score
5
Primarily Uses
Lemony, your new script let me do what I wanted w/o any crashes or apparent bugs.

You get as many cat kisses as you can stand and my cat is willing to give.

Thanks much!
 

Cherry-sama

Veteran
Veteran
Joined
Oct 13, 2013
Messages
102
Reaction score
34
First Language
English
Primarily Uses
This script is awesome! BD   I've been having one constant problem with it, though...

Often, the script works great. But during long cutscenes where the followers move around a lot, I find that when the cutscene ends, they just freeze on the last spot they were on, being uninteractable. If I try to use "$game_temp.lfmr_wait = false", and then "Gather Followers" by putting it at the end of the cutscene, the cutscene plays just fine until the end. Then the player can't move. I'm assuming this is because the game is trying to do what I asked, but it's just unable too.

I've had this numerous times during numerous cutscenes and I seriously have no idea what is wrong or how to fix it. ;_; Lemony, could you maybe look into this, please?
 

BogMod

Villager
Member
Joined
Apr 19, 2013
Messages
7
Reaction score
0
First Language
English
Primarily Uses
Ok I haven't used any scripts before but this is probably exactly what I need.  Can anyone explain where I put this script so that I can use it?  I can figure out I think how to make it work but I have no idea where to put the script in for the first place and what exactly needs to go in.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Put it at the bottom of your other custom scripts - in the Materials section.
 

BogMod

Villager
Member
Joined
Apr 19, 2013
Messages
7
Reaction score
0
First Language
English
Primarily Uses
I have no other custom scripts, don't know where the Materials section is.
 

captainproton

Dangerously Nifty
Veteran
Joined
Dec 20, 2013
Messages
1,276
Reaction score
570
First Language
english
Primarily Uses
I'm using a system that turns dead chars into coffin sprites until revived. Could Iuse this to send dead chars to the back of the line so the party isn't being led by a mobile coffin?
 

AeghtyAteKees

Nyctopheliac
Veteran
Joined
May 8, 2013
Messages
33
Reaction score
2
Primarily Uses
The speed of a follower seems to always match that of the player, regardless of setting a different speed in a move route.
 

AeghtyAteKees

Nyctopheliac
Veteran
Joined
May 8, 2013
Messages
33
Reaction score
2
Primarily Uses
I know it was posted a good while ago, but it still works well--and I'm actively using it! :) It's compatibility is highly commendable.
 

Heretic86

Veteran
Veteran
Joined
Nov 30, 2014
Messages
240
Reaction score
167
First Language
Engrish
Primarily Uses
"Lemonade Friendly"

:p
 

smeros

Villager
Member
Joined
Oct 18, 2013
Messages
15
Reaction score
3
First Language
Turkish
Primarily Uses
RMMV
Does this command work?

hawtf.png
 

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

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,085
Members
137,583
Latest member
write2dgray
Top