RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[XP] Script - How do I make a scripted move event to "Wait for Move's Completion

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 70
RMRK Junior
I'll keep it short.  Got a script I wrote.  Messing directly with @event.move_route, the stuff I am sending to it works fine, dynamic moves.  Called from an Event Script.  After that, I try to put in a "Wait for Move's Completion" (remember XP not VX), and it immediatly recoginzes as that event has completed its move.  I figure a simple flag @move_route_forcing = true, but that makes the event stop moving around.

...huh?
Heretic's Vehicles XP (Boat and Magic Carpet)

Heretic's Collection XP Ver 2.3 - Updated to include Dynamic Lighting, Moving Platforms, Vehicles, and much much more!

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Well, I don't know why you would need to force a move route through a script in a call event instead of just using the set move route event command, but you might find it helpful to take a look at the Interpreter class. In Interpreter 5, you will see:

Code: [Select]

  #--------------------------------------------------------------------------
  # * Set Move Route
  #--------------------------------------------------------------------------
  def command_209
    # Get character
    character = get_character(@parameters[0])
    # If no character exists
    if character == nil
      # Continue
      return true
    end
    # Force move route
    character.force_move_route(@parameters[1])
    # Continue
    return true
  end
  #--------------------------------------------------------------------------
  # * Wait for Move's Completion
  #--------------------------------------------------------------------------
  def command_210
    # If not in battle
    unless $game_temp.in_battle
      # Set move route completion waiting flag
      @move_route_waiting = true
    end
    # Continue
    return true
  end

Once you understand that and what that all does in Game_Character and in other parts of Interpreter, I think you will see where you are going wrong. Consider your basic event - you can set the event's autonomous movement for each page of an event, and then you can force the event to deviate from that autonomous movement with a Set Move Route command. If you use the "Wait for Move's Completion" event command, then it waits for move routes you set through Set Move Route event commands, but it doesn't wait for every event to complete their autonomous move routes. Therefore, if you want to make use of the "Wait for Move's Completion" code, then you want to use the event's force_move_route method, not edit their autonomous move route directly. (The force_move_route method essentially just saves the original move route and executes the forced move route, and then there are other methods which restore the original move route once the forced move route is executed).
« Last Edit: March 02, 2012, 12:49:33 AM by modern algebra »

***
Rep:
Level 70
RMRK Junior
Thank you!  That is exactly what I am going to do. 

And it worked!  To explain why, working with a Caterpillar, and only want the events in the Caterpillar to do something.  The Caterpillar isnt dependant on Event.ID, so map 1 could have the Caterpillar Event.ID's different than map 2.  The thing I was working on moves only the Events in the Caterpillar (which can vary) the way I wanted to make them move.

I am having a little trouble with Command_29 (Set Speed), cant seem to get it to work...
Code: [Select]
route_to_force.list.unshift(RPG::MoveCommand.new(29, speed)) if code != 0 and speed != nil

Speed is just an Int apparetly, not a Speed.new, well, I think

Could someone explain why that appears to set the speed to the lowest possible setting regardless of what the speed is?
« Last Edit: March 02, 2012, 11:15:37 PM by Heretic86 »
Heretic's Vehicles XP (Boat and Magic Carpet)

Heretic's Collection XP Ver 2.3 - Updated to include Dynamic Lighting, Moving Platforms, Vehicles, and much much more!