Jump to content

Recommended Posts

FP: Move Routes

Author: Tsukihime

 

Overview

 

Need to extend your move route options?

Or looking for an easier way to make move routes?

 

Features

  • Move towards/away from event
  • Turn towards/away from event
  • Compact move string!

More will be added as I find more interesting things to add

 

Usage

 

All of these are accessed through "set move route" menu.

 

Choose "script" and then enter the custom move commands.

 

You can specify a sequence of move commands by typing a move-string

 

 
moves("UDUDLRLR3R3R3L3L")

 

They are in the form of "[number][direction]". It tells the event how many times to move in that direction. If no number is specified, then it's just one.

 

U means up

D means down

L means left

R means right.

 

For diagonal movement, use the following

Q is upper-left

W is upper-right

A is lower-left

S is lower-right

 

You can also specify some extended behaviors.

 

move_toward_event(2)
move_from_event(3)
turn_toward_event(1)
turn_from_event(5)

 

The events are specified by event ID. By default the events are named "EventXXX" where XXX is the event ID. You can use that for reference.

 

Download

 

Script: http://db.tt/isHnpN7H

 

notes

 

Actually, I don't want to type all of these long method names.

How about we just stick to things like

 

"tt_event" instead of turn_toward_event

"tf_event" instead of turn_from_event

 

If you look at the script I've provided some shorthand aliases if you want to use those (if you don't mind forgeting what they mean)

Edited by Tsukihime

Share this post


Link to post
Share on other sites

This would make the event for the main part of my game's first sequence much more compact. So many Move Route commands, so many, "Okay, now to--UGH, I have to scroll through this sea of gigantic Move Route commands to find it!" moments.

 

Seriously. It gets ridiculous sometimes. This script will benefit me so much.

Share this post


Link to post
Share on other sites

There was a bug where an empty custom movement list would crash the game.

The issue occurs here

 

 def process_route_end
   if @move_route.repeat
     @move_route_index = -1
     #restore_move_route #new
   elsif @move_route_forcing
     @move_route_forcing = false
     restore_move_route
   end
 end

 

The line I commented out was me hacking around to get the custom move string to repeat forever, but I guess I need to find a better way to do it.

Share this post


Link to post
Share on other sites

I've added animation balloon support.

Just use the script

 

show_balloon(n)

 

for some n from 1 to 10.

 

Same applies to animations

 

show_animation(n)

Edited by Tsukihime

Share this post


Link to post
Share on other sites

Tsukihime, is it possible to do compact movement strings through call script and designate an event id too? I'd love to have that.

Share this post


Link to post
Share on other sites

Something like call script:

moves("UDUDLRLR3R3R3L3L", event_id)

 

So I can batch them all in one go:

 

 

moves("UDUDLRLR3R3R3L3L", 1)
moves("UDUDLRLR3R3R3L3L", 2)

 

kind of like this?

What I mean to say is, movement route that is not in an event command.

Unless I'm misunderstanding your script and it has something like that already?

 

ER, hypothetical situation I guess:

I have 5 events and instead of set moving them all the time. I can just look at the editor and count the tiles and type them in notepad and paste it in a call script. Instead of setting them in their specific Define Movement button.

 

But this might be just me being mentally challenged so you don't have to take this suggestion orz.

Edited by Archeia

Share this post


Link to post
Share on other sites

how do i move away from current event?

turn_from_event(0)

the "0" isnt working for me

 

in the script instructions it says: "0 is the event itself (can be omitted)"

Share this post


Link to post
Share on other sites

im trying to make an event that when you touch it it makes the player move away from it, these events are being spawned so i dont know their IDs

"move_from_event(0)" gives me an undefined method error, it works if i give it an id though

Share this post


Link to post
Share on other sites

Hey Tsukihime, I was thinking that, if you thought they were useful, you could add the move route scripts I posted here to your script. It would probably be better if all the special move route scripts were in one place maybe?

Share this post


Link to post
Share on other sites

Ah see your looking up the event form the array manually, you want to call the Game_Interpreter's "get_character" method. Replace the "$game_map.events[event_id]" with "get_character(event_id)" if you want to use 0 and -1 for the current event and the player.

 

Hmmm, I wonder if this would work (only changed parts):

 

  #--------------------------------------------------------------------------

# * Move toward event, by event id

#--------------------------------------------------------------------------

def move_toward_event(event_id = 0)

character = get_character(event_id)

move_toward_character(character)

end

alias_method :mt_event, :move_toward_event

 

#--------------------------------------------------------------------------

# * Move away from event, by event id

#--------------------------------------------------------------------------

def move_from_event(event_id = 0)

character = get_character(event_id)

move_away_from_character(character)

end

alias_method :mf_event, :move_from_event

 

#--------------------------------------------------------------------------

# * Turn toward event, by event id

#--------------------------------------------------------------------------

def turn_toward_event(event_id = 0)

character = get_character(event_id)

turn_toward_character(character)

end

alias_method :tt_event, :turn_toward_event

 

#--------------------------------------------------------------------------

# * Turn away from event, by event id

#--------------------------------------------------------------------------

def turn_from_event(event_id = 0)

character = get_character(event_id)

turn_away_from_character(character)

end

alias_method :tf_event, :turn_from_event

 

Edited by KilloZapit

Share this post


Link to post
Share on other sites

Silly. :P I know how it is to get a vexing bug and wreck your brain over it only to realize you made a durpy mistake. :B

Share this post


Link to post
Share on other sites

Tsukihime: I get another error when using your script.

 

I use it as a means of traveling to other islands via ship. Player buys a ticket in a common event shop, the common event (set to trigger none or autorun, doesn't matter because both produce the same error) runs as it should, but when my ship reaches the last point of its destination, it just stays there and I can't do anything anymore. As if it was an unerased autorun going on forever. No error message shows.

 

I'm wondering why this is happening, because it works just fine when I use regular move route commands. Maybe something else that needs to be updated or a vehicle incompatibility? Any other information you might need?

 

Anyway, thanks for your time!

Edited by Caveras

Share this post


Link to post
Share on other sites

Yes, Yanfly's Common Event Shop => http://yanflychannel.wordpress.com/rmvxa/menu-scripts/common-event-shop/

 

It's a simple shop call where you can buy common events (that is, you buy an "item"/array object and it immediately acts out the specified common event). I use it as some sort of travel agency/ticket shop.

 

(And sorry for not explaining; I always think you script guys know each other's work by heart ;)

Edited by Caveras

Share this post


Link to post
Share on other sites

My question/error is no longer relevant; turns out it's just that ships cannot "unload" the party on a pier tile for whatever reason when Victor's Pixel Movement isn't modified accordingly.

 

Sorry for bothering you, Tsukihime!

 

Nay, Pixel Movement wasn't the bad guy: the common event still gets stuck after moving along the route. Even if I set the route to end in the midst of the water, the ship just won't do anything I tell it to do after the move route.

 

Damn vehicles. Guess it's back to regular move commands. Thanks anyway.

Edited by Caveras

Share this post


Link to post
Share on other sites

I've fixed the bug with move routes freezing at the end of my custom move commands.

 

Instead of trying to do fancy "force moves" and whatever, I simply replace the custom command with the actual move instructions that the engine expects.

 

move up
moves("DLR")
move down

 

Will be translated to

 

move up
move down  # replace my command with the actual instructions
move left  #
move right #
move down

 

In the end, my script basically cuts in and says "wait, add these commands to the list, and then delete me"

 

This should be much more flexible because as the engine is going down the move route, all it will see is a bunch of move commands and doesn't really care where they came from.

 

Now I just need to re-factor it so that you can pass a list of move commands to me and I will do all of the necessary replacing, and then you can easily write your own custom move commands.

Edited by Tsukihime

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted