Set Move Route

Napoleon

Veteran
Veteran
Joined
Dec 29, 2012
Messages
869
Reaction score
97
First Language
Dutch
Primarily Uses
Is there any way I can cancel a moveroute? I have this scenario:

Waiter walks to the kitchen (no wait). Then after some dialogs the scene fades out and the waiter is relocated. But if he is relocated before he finished moving then he continues his old moveroute... I currently worked around it by using another waiter and making the first one through+transparent but that get's messy after a few times...

Is there a way to wait for a moveroute? Like:

I have a waiter grab some drinks. Then I have some dialogs. But after the dialogs are finished I don't want the waiter to give you the drinks if he is still getting them...
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
15,354
Reaction score
8,533
First Language
English
Primarily Uses
RMMV
Can you post a screenshot of all the event pages? It would be a big help.
 

Napoleon

Veteran
Veteran
Joined
Dec 29, 2012
Messages
869
Reaction score
97
First Language
Dutch
Primarily Uses
The event pages are super long. I made a tiny sample:

http://s28.postimg.org/cwzsybbhp/sample.png

If the player skips the dialogs then "Here you go! Have a good one!" is said while the cashier is still getting the drinks and food for the player...

For the other question I probably need a way to cancel the moveroute. But I guess there is none without scripting?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Just do another Set Move Route. As long as you HAVE used a Set Move Route (and not an Autonomous Movement instead), setting a new move route will cancel the original.


You can do a Set Move Route without actually adding any movement commands. That will just have the effect of cancelling any move route already in place.
 

Napoleon

Veteran
Veteran
Joined
Dec 29, 2012
Messages
869
Reaction score
97
First Language
Dutch
Primarily Uses
Thanks Shaz that solved one problem :) .

But for the other one, I have to script I guess:

class Game_Character < Game_CharacterBase  alias nap_mrwait_update_routine_move update_routine_move  def update_routine_move    nap_mrwait_update_routine_move    command = @move_route.list[@move_route_index]    p 'end' if command.nil? #!command.nil? && command.code == 0 && @wait_count <= 0    $game_switches[10] = true if command.nil?  endendEvent code:

<some move route here w/o wait>

while not $game_switches[10] wait(1)end<show text: Thanks for waiting for me!>

Need to optimize it and make it generic and remove the ugly switch and such but I think I can handle it from here. Thanks.

Update: got it!

=begin#===============================================================================Napoleons MoveRoute WaitVersion 1.00By NapoleonAbout:- Allows you to wait for specific 'move routed events' to complete before you proceed with the event-execution.- Does not freeze anything else on the screen, just your event.- Note: Does not work for 'Autonomous Movement events'.Instructions:- Place below "▼ Materials" but above "▼ Main Process".- In the event make a new script call and then call: wait_for_moveroute(x) # where x is the id of the event that is currently being # 'move-routed' that you'd like to wait for. Requires:- RPG Maker VX AceTerms of Use:- Attribution 3.0 Unported (CC BY 3.0) http://creativecommons.org/licenses/by/3.0/- Attribution is not required. This overrules what's stated in the above license.Version History:1.00 (30 March 2014) - First Release#================================================================================end$imported ||= {}$imported[:nap_mr_wait] = 1.00#-------------------------------------------------------------------------------# * Config#-------------------------------------------------------------------------------module Nap module MR_Wait module Conf GAME_VAR = 25 # Game Variable index that contains the data end endend#-------------------------------------------------------------------------------# * Game Character#-------------------------------------------------------------------------------class Game_Character < Game_CharacterBase #-------------------------------------------------------------------------- # * Alias: update_routine_move # For: Knowing when a moveroute ended. #-------------------------------------------------------------------------- alias nap_mr_wait_update_routine_move update_routine_move def update_routine_move nap_mr_wait_update_routine_move command = @move_route.list[@move_route_index] if !@move_route.nil? $game_variables[Nap::MR_Wait::Conf::GAME_VAR][@id] = command.nil? endend#-------------------------------------------------------------------------------# * Game Interpreter#-------------------------------------------------------------------------------class Game_Interpreter #-------------------------------------------------------------------------- # * New: wait_for_moveroute # Param: ev_id = id of the 'move-routed-event' that we need to wait for. #-------------------------------------------------------------------------- def wait_for_moveroute(ev_id) while not $game_variables[Nap::MR_Wait::Conf::GAME_VAR][ev_id] wait(1) end endend#-------------------------------------------------------------------------------# * Game Variables#-------------------------------------------------------------------------------class Game_Variables #------------------------------------------------------------------------------- # * Alias: initialize # For: Default-assigning an empty hash to the game variable. #------------------------------------------------------------------------------- alias nap_mr_wait_initialize initialize def initialize nap_mr_wait_initialize @data[Nap::MR_Wait::Conf::GAME_VAR] = {} endend
MMmm... Seems the forum code-tags can not handle =begin and =end
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I have a common event for waiting for a player's or an event's move route to finish.

I'm not at my PC at the moment, so I'll see if I can remember ...

In your event that has the move route and the dialogue:

Put the event ID into a variable

Put the x and y END locations into two more variables

Call the common event to "wait for NPC move route completion"

In the common event:

Loop Wait 4 Frames Conditional Branch: if event is on required x and y positions Break Loop EndRepeatI can't remember if I used two additional variables to put the event's current X and Y positions (using a script call: $game_variables[x] = $game_map.events[eventid].x, where eventid is the variable with the event numbe) and then compared them to the two previously set variables, or if I just did the whole thing in a script within the conditional branch.Post back whether your solution works, or you can get my suggestion working. If you still need help, I'll give you a screenshot of my common event when I get home.
 

Napoleon

Veteran
Veteran
Joined
Dec 29, 2012
Messages
869
Reaction score
97
First Language
Dutch
Primarily Uses
You sometimes have those really smart events and without scripting :) .

But I prefer my script in this particular case because it is possible that they come back at that specific coordinate but without finishing their moveroute. Like when you enter the Burger World:

- Cashier gets you a milkshake.

- Comes back and places milkshake on counter (is now at the original coordinate again). # <Your example would finish here>

- Goes to get some food and comes back to place it on the counter.

- Now the moveroute has ended and she asks you to pay. # <My script finishes here>

I know it's probably possible to edit your example to make it compatible with the above.

Yes my solution works. I just call wait_for_moveroute(x) in my event just before the dialog and all is good.

Just one question, you wait 4 frames, my script waits 1. Is there any specific reason for choosing 4? Isn't it possible to be like 3 frames 'late' this way?

Since you can only wait for one moveroute at a time, waiting just 1 frame is not a performance issue.
 
Last edited by a moderator:

Napoleon

Veteran
Veteran
Joined
Dec 29, 2012
Messages
869
Reaction score
97
First Language
Dutch
Primarily Uses
I updated the script:

=begin#===============================================================================Napoleons MoveRoute WaitVersion 1.01By NapoleonAbout:- Allows you to wait for specific 'move routed events' to complete before you proceed with the event-execution.- Does not freeze anything else on the screen, just your event.- Note: Does not work for 'Autonomous Movement events'.Instructions:- Place below "▼ Materials" but above "▼ Main Process".- In the event make a new script call and then call: wait_for_moveroute(x) # where x is the id of the event that is currently being # 'move-routed' that you'd like to wait for. Requires:- RPG Maker VX AceTerms of Use:- Attribution 3.0 Unported (CC BY 3.0) http://creativecommons.org/licenses/by/3.0/- Attribution is not required. This overrules what's stated in the above license.Version History:1.01 (2 April 2014) - Fixed a bug where a show dialog between 2 moveroutes would cause it to instantly finish on the 2nd run. - Removed the game_variable and improved performance.1.00 (30 March 2014) - First Release#================================================================================end$imported ||= {}$imported[:nap_mr_wait] = 1.01#-------------------------------------------------------------------------------# * Game Character#-------------------------------------------------------------------------------class Game_Character < Game_CharacterBase #-------------------------------------------------------------------------- # * New Method: move_route_finished? # For: Knowing when a moveroute finished. #-------------------------------------------------------------------------- def move_route_finished? return @move_route.list[@move_route_index].nil? endend#-------------------------------------------------------------------------------# * Game Interpreter#-------------------------------------------------------------------------------class Game_Interpreter #-------------------------------------------------------------------------- # * New: wait_for_moveroute # Param: ev_id = id of the 'move-routed-event' that we need to wait for. #-------------------------------------------------------------------------- def wait_for_moveroute(ev_id) while not $game_map.events[ev_id].move_route_finished? wait(1) end endend
Problem solved, topic can be closed.
 

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
I have a common event for waiting for a player's or an event's move route to finish.

I'm not at my PC at the moment, so I'll see if I can remember ...

In your event that has the move route and the dialogue:

Put the event ID into a variable

Put the x and y END locations into two more variables

Call the common event to "wait for NPC move route completion"

In the common event:

Loop Wait 4 Frames Conditional Branch: if event is on required x and y positions Break Loop EndRepeatI can't remember if I used two additional variables to put the event's current X and Y positions (using a script call: $game_variables[x] = $game_map.events[eventid].x, where eventid is the variable with the event numbe) and then compared them to the two previously set variables, or if I just did the whole thing in a script within the conditional branch.Post back whether your solution works, or you can get my suggestion working. If you still need help, I'll give you a screenshot of my common event when I get home.
Isn't there something missing from that script, like the definition/variable slot for the required, X and Y position.

Something like ()  after the x, and after the Y, so you can put the specified X, and Y locations in there? Or am I wrong, and the word position in this case, recognizes the X, and Y spots as the locations by default, in which case you just replace X, and Y with the apropiate numbers?
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Yes. "if event is on required x and y positions" is just a pseudocode placeholder. It's up to you to figure out the exact syntax.


As I said, I wasn't at my PC when I wrote that, so I would have just been guessing, and probably would have included a few errors.


Which is also why I said "if you still need help, I'll give you a screenshot of my common event when I get home." ;)
 

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
Yes. "if event is on required x and y positions" is just a pseudocode placeholder. It's up to you to figure out the exact syntax.

As I said, I wasn't at my PC when I wrote that, so I would have just been guessing, and probably would have included a few errors.

Which is also why I said "if you still need help, I'll give you a screenshot of my common event when I get home." ;)
Ah ok, thought so.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

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.
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'??

Forum statistics

Threads
105,862
Messages
1,017,045
Members
137,569
Latest member
Shtelsky
Top