Jump to content

Recommended Posts

Introduction :

For long distance jumping, it's must be troublesome if you have to calculate where you character should jump. This script snippet simply make the character jump to specific point / coordinate. This was actually just for my own developing tool. But I decided to share. Here is the snippet.

class Game_Character
  # --------------------------------------------------------------------------
  # Jump to point/coordinate. Coz, I hate to calculate
  # --------------------------------------------------------------------------
  def jump_to_point(xpos, ypos)
    x_dist = xpos - x
    y_dist = ypos - y
    jump(x_dist, y_dist)
  end
  
end 

How to use :

Put this snippet below material but above main

Set move route >> Script >> jump_to_point(x,y)

Where the (x,y) is target coordinate

 

Example :

5TGNJ5q.png

 

No credit needed ~

  • Like 2

Share this post


Link to post
Share on other sites

Man, if i only knew about this script yesterday. I made a bunch of jumping characters for two scenes and had to calculate everything ~_~ but i will use it in the future! you're just as lazy as i am :P

  • Like 1

Share this post


Link to post
Share on other sites

You should learn script. It will help you a lot if you're too lazy :P

Share this post


Link to post
Share on other sites

^ I'm too lazy to learn scripting.

  • Like 2

Share this post


Link to post
Share on other sites

I love you Theo, this is really useful for me.

Share this post


Link to post
Share on other sites

Next step: Calculating how many Up/down/left/right steps it takes to reach a point; because Move Up x 10 aren't for lazy people.

  • Like 1

Share this post


Link to post
Share on other sites

Actually, a coordinate based movement system for use during multi-NPC cutscenes would be pretty sweet!

Share this post


Link to post
Share on other sites

Thanks guys :D
 

Next step: Calculating how many Up/down/left/right steps it takes to reach a point; because Move Up x 10 aren't for lazy people.

Did you talk about pathfinding?

Share this post


Link to post
Share on other sites

Thanks guys :D

 

Next step: Calculating how many Up/down/left/right steps it takes to reach a point; because Move Up x 10 aren't for lazy people.

Did you talk about pathfinding?

Path finding are buggy.

I meant just calculating how many steps it takes to reach a point in straight line.

I'm tired of it when I have to make an NPC walk half way across the map: "Hmm, 12 move-lefts and 10 move-downs would be enough... Wait... where are you going?!"

Share this post


Link to post
Share on other sites

Straight line. Nice idea. I will try to work on it when I have time.

Share this post


Link to post
Share on other sites

Perfect timing, I was just screwing with the jump command last night and realized how annoying it was!

Share this post


Link to post
Share on other sites

Straight line. Nice idea. I will try to work on it when I have time.

"when you have time"

It would take like 1 minute to edit your jump_to_point and make it walk_to_point(x,y,direction)

Edit: okay...

Edited by Demintika

Share this post


Link to post
Share on other sites

 

Straight line. Nice idea. I will try to work on it when I have time.

"when you have time"

It would take like 1 minute to edit your jump_to_point and make it walk_to_point(x,y,direction)

Edit: Nope, n x move_straight isn't that easy.

 

 

Even if it is simple he may have more important things to do first.

  • Like 1

Share this post


Link to post
Share on other sites

Yes, it's all about inserting command.

The script may look simple. But, the debug part isn't

I need to test all cases so I won't miss anything. And it takes time

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