Scripted Move Routes

How can I do a scripted move route based on the event id of the event I am running? For example, I have an event (say the event's id is 1).

I want this for example:

Turn Up

Jump y = 2

Move Up

Move Up

I want to do this so I can just make a pool of script and then do a script call on the Parallel Processed event so that's what it should do or that I can just set a custom move route and call the script.

Second question is, is there a way in a script to know if the certain event through an ID is facing right, left, up or down?
I tend to avoid scripting the Move Routes themselves, and instead scripting ways to access different pages on the event that have their own Move Route, or by actually changing the base behavior of the commands themselves to be more polymorphic, such as:

  alias :move_in_pattern :move_random  def move_random    m_type = 0 # The Custom Movement Pattern for a given event    case character_name    when "Evil"      m_type = 1 if character_index = 7    end    case m_type    when 1      rng = rand(4).to_i      if rng == 3        move_straight(4)      elsif rng == 2        move_straight(6)      else        @wait_count = 15      end    else      move_in_pattern    end  endSo since that's how I approach it, I can't really help you much more with scripting the Move Route yourself, if that's how you're set on doing it.  But I think you can find the "Move Route" command's equivalent scripting here:

http://forums.rpgmakerweb.com/index.php?/topic/25759-script-call-collection-for-vxace/

Just replace the numbers with the ones that you'll find in the default Game_Character script.
I'll try to experiment with such. Thanks!
I would also recommend avoiding scripting the move routes. For academic's sake though and to give you an idea how tedious it is, your example can be accomplished with the following:

Code:
t_up = RPG::MoveCommand.new(19)r_jump = RPG::MoveCommand.new(14, [0,2])m_up = RPG::MoveCommand.new(4)r_end = RPG::MoveCommand.new(0)route = RPG::MoveRoute.newroute.list = [t_up, r_jump, m_up, m_up, r_end]route.repeat = false$game_map.events[event_id].force_move_route(route)
To get a direction an event is facing, you can use
Code:
$game_map.events[event_id].direction
That means a lot to me Yato, thank you very much.
Wait, where do I place the script? I tried to call it via the script on the custom move routes but the sprite just stood there.
Did you change event_id to the be the id of your event?

Original thread: https://forums.rpgmakerweb.com/threads/scripted-move-routes.37437/