TheoAllen 830 Posted May 20, 2014 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 : No credit needed ~ 2 Share this post Link to post Share on other sites
Faye V. 52 Posted May 20, 2014 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 1 Share this post Link to post Share on other sites
TheoAllen 830 Posted May 20, 2014 You should learn script. It will help you a lot if you're too lazy Share this post Link to post Share on other sites
Faye V. 52 Posted May 20, 2014 ^ I'm too lazy to learn scripting. 2 Share this post Link to post Share on other sites
Coolie 148 Posted May 20, 2014 I love you Theo, this is really useful for me. Share this post Link to post Share on other sites
Demintika 63 Posted May 20, 2014 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. 1 Share this post Link to post Share on other sites
Maliki 33 Posted May 20, 2014 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
TheoAllen 830 Posted May 20, 2014 Thanks guys 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
Demintika 63 Posted May 21, 2014 Thanks guys 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
TheoAllen 830 Posted May 21, 2014 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
Euphoria 147 Posted May 21, 2014 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
Demintika 63 Posted May 21, 2014 (edited) 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 May 21, 2014 by Demintika Share this post Link to post Share on other sites
Euphoria 147 Posted May 21, 2014 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. 1 Share this post Link to post Share on other sites
TheoAllen 830 Posted May 21, 2014 If you're in hurry, try this instead http://rpgmaker.net/scripts/224/ It's not about calculating. But it's simplifier than put move to x duration in n times. Share this post Link to post Share on other sites
Demintika 63 Posted May 21, 2014 So... it inserts n times move_x into @move_route I forgot the .insert command >.=.> Share this post Link to post Share on other sites
TheoAllen 830 Posted May 21, 2014 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