Action Button -> Jump in the same direction the player is facing

Hello,

I want to make a map where every tile, if you press the Action Button, the player will Jump forward. I saw this jumping done in the Crysalis game, except they have their direction fixed as either "Up," "Down," "Left," "Right." However, I don't want that.

I want it that if you press the Action Button, the player will jump in the same direction he/she is facing (with "Skip if Cannot Move" enabled, or course). I was thinking that it might be possible in Set Move Route > Script..., but I don't know what to type there. Can someone tell me exactly what I have to type there if it works this way?

I attached screen shots taken from the Crysalis game file to better demonstrate what I want to achieve, except with the direction set to "same direction player is facing" and "Skip if Cannot Move."

Also, since I want this for every tile on this map, is it possible to achieve this without having to make every tile an event?

By the way, I prefer not to use Jumping scripts like Galv's Jump Ability because while it is a great script, I can only jump onto passable tiles with his script. My map is special in that I want players to be able to jump onto impassable tiles. Also that I want the jumping to be map specific, and if I use his script, maybe it might be a bit more complicated in certain cases... I think.

Thanks for reading!
~Kiyasu

P.S. I don't know whether this is the right forum for this... because it looks like it could be a script help thing, but at the same time it also looks like it is not. So, if I posted this in the wrong forum, I am sorry. It also doesn't look like I can cross-post this into two forums at the same time either...?
I don't know much about VX, but I'm pretty sure just using Move 1 step forward should do the trick?
@Doinathing Hey, thanks for the reply! Hmmm... I gotta try that out and see then! Can't believe I've never realized it. But what if you want certain spots to make you move 2 or 3 steps forward instead? And is it possible to not have to make every single tile an event?
prefer not to use Jumping scripts like Galv's Jump Ability
How many other scripts have you tried?
VE free jump

and yes just run a parallel event -> check direction and do a move route -> jump
@Doinathing Hey, thanks for the reply! Hmmm... I gotta try that out and see then! Can't believe I've never realized it. But what if you want certain spots to make you move 2 or 3 steps forward instead? And is it possible to not have to make every single tile an event?
Maybe just make a common event for jumping? If the jumping isn't relative to a certain tile, you could do something like this?

Key Input processing: Action Button, Variable [X]
Conditional Branch: Variable [X] is set to A
If true:
Set move route: Jump, 1 step forward
Wait 0.5

End branch
@Roninator2 Hahaha, I kept thinking that all jumping scripts would reasonably only allow you to jump onto passable tiles. I mean, who would actually want to jump onto impassible tiles except for my crazy ideas?! So, yes, Galv's Jumping script is the only one I know of and I tried. I will check out the script you linked to. However, what if in the chance that I don't want to use someone else's script for this, how can what I want still be achieved? What if in the case I want it to be like Crysalis where no scripts are used and somehow still achieved?

@Doinathing That sounds like a good idea... except what if you want *one* jump to move the player 3 steps forward? OK, I'm going to have to test what you said and get back to you with more thoughts. Thanks for your help!!
@Doinathing That sounds like a good idea... except what if you want *one* jump to move the player 3 steps forward? OK, I'm going to have to test what you said and get back to you with more thoughts. Thanks for your help!!
I'm not sure about VX, but I got the thing I wrote off the top of my head to kind of work in XP?
It might need a little fine tuning, but keep up the hard work!
@Doinathing OK, thanks ^^ I will test your earlier suggestions later on and get back to you with any thoughts I have!! You keep up the hard work too!! (If you are working hard on anything, I mean...? XD)
Just add a condition of direction ("when Player is facing X") to each of the 4 possible directions. Then perform the jump accordingly. This would probably be done better by a common event, like Doinathing said.

Correct me if I got your question wrong.
@Sheklon OK, I will test your suggestion and get back to you later with my thoughts!! Thank you so much for your time!!!
OK, I just tested things, and I will share my thoughts on each one! I don't know whether this is double-posting, and I had thought to edit my previous post instead... but then if I do, maybe the people mentioned below won't receive the notifications properly. Also, if anyone reacted to my post with "like" or "love," I don't know whether that would be accurate to then edit it after the reaction happened. Hope it's OK to post here.

just using Move 1 step forward should do the trick

I just realized that I did think of "1 step forward" before but it didn't work because the entire map only consists of impassable tiles. In Set Move Route, you cannot move a character on impassable tiles, but you can make characters jump on them. That's why I insisted that it must be "jump in the same direction character is facing."

How many other scripts have you tried?
VE free jump
and yes just run a parallel event -> check direction and do a move route -> jump

@Roninator2 I tested the script you linked me to, but it seems to be the same as @Galv's script in that I can't jump onto impassable tiles. Also, could you please clarify on what you mean about the "just run a parallel event -> check direction and do a move route -> jump" part? Is this related to the script or do you mean it separately?

Maybe just make a common event for jumping? If the jumping isn't relative to a certain tile, you could do something like this?

Key Input processing: Action Button, Variable [X]
Conditional Branch: Variable [X] is set to A
If true:
Set move route: Jump, 1 step forward
Wait 0.5


End branch

@Doinathing Hmmm.... I did something similar except I didn't have the "Variable [X]" part. Been wondering what is the purpose for having that "Variable [X]" part?

Just add a condition of direction ("when Player is facing X") to each of the 4 possible directions. Then perform the jump accordingly. This would probably be done better by a common event, like Doinathing said.

@Sheklon Attached is what I did based on your suggestion! Please look at the "kiyasu_jumping_common_event.jpg" file. Sounds like a good idea! So I added "Call Common Event" to an event on a tile and tested it, and it works! But I was wondering, is the Common Event supposed to look as "messy" as it is? I was wondering whether it could be simplified. Another question is that do I have to do this for every tile? Is there a way to apply this Common Event to all tiles of this map without having to edit every single one of them? Maybe it might have to do with the "Parallel Process" thing mentioned by @Roninator2 above, so I tried to make one, as shown in "kiyasu_jumping_common_event_02.jpg" below. However, there is one thing: how can I avoid using the "Condition Switch" part on the top right if I want to turn on Parallel Process?

There is indeed one benefit for the way kiyasu_jumping_common_event_02.jpg is set up in that this one Common Event combines the Jumping Script @Roninator2 linked to. This means that, for the case where the player is on passable tiles, if I set the jumping button for both this Common Event and the Jumping Script as the same button and use the same Switch (in this case, Switch 0100: JUMP), one press of the button will give me a kind of double-jump in one go, which is pretty cool! But what if you don't want to mess with Switches and find that using a random empty switch just to fill it in doesn't look clean?

Thank you so much everyone!! I am so glad I at least know how to make jumping on a map completely made out of impassable tiles possible! I didn't know it was this simple! I kept thinking you had to do some kind of script call! If there is a script call method though, I do want to know! I still think "Just add a condition of direction ("when Player is facing X") to each of the 4 possible directions. Then perform the jump accordingly" can be a bit messy-looking, and I was wondering whether there is a script call version that directly deals with "same direction character is facing" instead of checking each direction manually.

~ Kiyasu
You keep saying the script i linked you to. Well I did link one script but I mentioned two.
The other you needed to search for. Victor Sant Free Jump.
What you have there in the common event jump (not the switch one) is exactly what you can do in the parallel event on the map. No common event needed.
You just have to put that entire conditional branch inside one more conditional branch. If button Z is pressed. (or whatever button you wanted) just like the one with a switch.
The event will only be on that one map so it will not affect other maps and you would just put in on every map you need it.
Alternatively you can use the common event already made and just turn the switch on when entering the map, and turn it off when exiting.
If you are new to the program then there are some tutorials that can help understand things.
Follow the links in my signature
here
↓
You keep saying the script i linked you to. Well I did link one script but I mentioned two.
The other you needed to search for. Victor Sant Free Jump.

@Roninator2 Oh! I am so sorry!! Now it makes sense!! I kept thinking your "VE free jump" part meant "VE free jump (is below): [link]." Hence I thought it was only one script. Really sorry about that.

If you are new to the program then there are some tutorials that can help understand things.

I am aware of @Andar's and others' tutorials just that I haven't had much "Advanced > Script" experience (not sure whether calling this "script call" was accurate... sorry if I made a mistake here). Almost everything I want to achieve so far can be achieved through basic events either standalone or mixed together, combined with scripts downloaded online. So there has mostly been no need for "Advanced > Script" part of the Event Commands window. If it is not a copy-and-pasted bit from someone else's demo, then I most likely go blank on what to type when it comes to that part. I feel familiar enough with the engine except for the "Advanced > Script" part of Event Commands. That's my only "issue" at the moment. I am aware that VX Ace has an entire information section about Ruby syntax and everything under Help > Contents, but I was thinking that direct experience combined with that would be better. Hence I asked whether there is a simpler way to achieve the "jump in same facing direction" through using some script calls. This way it would be easier for me to figure things out, since I know what I am getting from it.

Thank you again for clearing things up!! Helps a lot!!
OK, I just tested things, and I will share my thoughts on each one! I don't know whether this is double-posting, and I had thought to edit my previous post instead... but then if I do, maybe the people mentioned below won't receive the notifications properly. Also, if anyone reacted to my post with "like" or "love," I don't know whether that would be accurate to then edit it after the reaction happened. Hope it's OK to post here.



I just realized that I did think of "1 step forward" before but it didn't work because the entire map only consists of impassable tiles. In Set Move Route, you cannot move a character on impassable tiles, but you can make characters jump on them. That's why I insisted that it must be "jump in the same direction character is facing."




@Roninator2 I tested the script you linked me to, but it seems to be the same as @Galv's script in that I can't jump onto impassable tiles. Also, could you please clarify on what you mean about the "just run a parallel event -> check direction and do a move route -> jump" part? Is this related to the script or do you mean it separately?



@Doinathing Hmmm.... I did something similar except I didn't have the "Variable [X]" part. Been wondering what is the purpose for having that "Variable [X]" part?



@Sheklon Attached is what I did based on your suggestion! Please look at the "kiyasu_jumping_common_event.jpg" file. Sounds like a good idea! So I added "Call Common Event" to an event on a tile and tested it, and it works! But I was wondering, is the Common Event supposed to look as "messy" as it is? I was wondering whether it could be simplified. Another question is that do I have to do this for every tile? Is there a way to apply this Common Event to all tiles of this map without having to edit every single one of them? Maybe it might have to do with the "Parallel Process" thing mentioned by @Roninator2 above, so I tried to make one, as shown in "kiyasu_jumping_common_event_02.jpg" below. However, there is one thing: how can I avoid using the "Condition Switch" part on the top right if I want to turn on Parallel Process?

There is indeed one benefit for the way kiyasu_jumping_common_event_02.jpg is set up in that this one Common Event combines the Jumping Script @Roninator2 linked to. This means that, for the case where the player is on passable tiles, if I set the jumping button for both this Common Event and the Jumping Script as the same button and use the same Switch (in this case, Switch 0100: JUMP), one press of the button will give me a kind of double-jump in one go, which is pretty cool! But what if you don't want to mess with Switches and find that using a random empty switch just to fill it in doesn't look clean?

Thank you so much everyone!! I am so glad I at least know how to make jumping on a map completely made out of impassable tiles possible! I didn't know it was this simple! I kept thinking you had to do some kind of script call! If there is a script call method though, I do want to know! I still think "Just add a condition of direction ("when Player is facing X") to each of the 4 possible directions. Then perform the jump accordingly" can be a bit messy-looking, and I was wondering whether there is a script call version that directly deals with "same direction character is facing" instead of checking each direction manually.

~ Kiyasu
The X Variable part is what variable the value for the key you pressed will be stored in, is that not a thing in VXA? Also, if you want the player to move through impassible tiles, you need to add 'Through ON' before the jump, and 'Through OFF' after the jump.
There is one point we are missing. VXA not only allows you to jump to impassable tiles, but it also allows you to jump out of the map. VXA's way to handle jumping is quite messy, honestly.

That being said, you mentioned being able to use the jump script together with your personal jumping through events. Instead of doing double-jump, can you do something like @Doinathing said ('Through ON' when pressing jump key and wait a few frames to toggle 'Through OFF') alongside using one of @Roninator2 suggested scripts? I believe those scripts will have fixed the jump-out-of-screen bug.
There is one point we are missing. VXA not only allows you to jump to impassable tiles, but it also allows you to jump out of the map. VXA's way to handle jumping is quite messy, honestly.
If the map has only a few places where jumping is not allowed he could created a parallel process event in the map which checks the player X/Y coordinates, and in the event of the jump, add a condition to check the Player X/Y + direction and dont allow jumping if that would make the character go out of bounds
Without spoiling anything from my project, here is a sample map I just made for easier demonstration. Please see kiyasu_sample_map.jpg. Here I want the player to be able to "move" through this map freely by jumping around, but not able to actually walk from tile to tile. Jumping is the only way to travel through this map.

The X Variable part is what variable the value for the key you pressed will be stored in, is that not a thing in VXA? Also, if you want the player to move through impassible tiles, you need to add 'Through ON' before the jump, and 'Through OFF' after the jump.

There is one point we are missing. VXA not only allows you to jump to impassable tiles, but it also allows you to jump out of the map. VXA's way to handle jumping is quite messy, honestly.

@Doinathing I actually haven't had much experience with variables. I have only done it with numbers and I just checked the Variables window and don't seem to understand what you mean by "value for the key you pressed will be stored in." Here is a screen shot, kiyasu_variables.jpg, of what it looks like in VX Ace. Unless it is something to do with the "Script" part there, which as mentioned previously, is something I haven't had experience doing and thus don't know what to put there. (T_T)

I didn't have the "Through ON" thing because you can actually jump on impassable tiles. And really? You can jump out of the map? I didn't know that! Hmm... you're right, I just tested a sample event, and it does allow it, but this is what makes cut scenes possible. So I like that players can jump out of the map because in a cut scene, I want that to happen. So I didn't see this as a "messy" handling as it was what I wanted when I did cut scenes. However, when you are fully controlling the player in a dungeon exploration, I probably wouldn't want to jump out of the map in most cases.

Instead of doing double-jump, can you do something like @Doinathing said ('Through ON' when pressing jump key and wait a few frames to toggle 'Through OFF') alongside using one of @Roninator2 suggested scripts? I believe those scripts will have fixed the jump-out-of-screen bug.

@Sheklon I am currently testing both scripts @Roninator2 suggested, and just tested Victor's Free Jump script. In fact, I also tried both scripts being on at the same time. If I have the Jumping Common Event turned off, both scripts seem to function like how @Galv's script prevents players from jumping out of the map, but it also prevents players from jumping onto anything but passable tiles.

When I previously mentioned the "kindof double-jump in one go" on impassible tiles, that was caused by the Common Event being on at the same time. So, the Common Event made jumping on impassible tiles possible, and seemed to have carried some of the jumping from the scripts, hence I get an extra jump. However, the scripts alone without any Common Event can't seem to do anything for my case. This means I will still be jumping out of the map if I want to use the Common Event. This is good if I have certain cut scenes-style effects I want to achieve, but if I want it to be a free travel dungeon the player explores, it might be an issue.

Here are more screen shots: kiyasu_jumping_test_01.jpg, kiyasu_jumping_test_02.jpg, and kiyasu_jumping_test_03.jpg.

So, the conclusion: The jumping is working perfectly now if I have the Common Event turned on EXCEPT that 1) you can jump out of the map and 2) you can jump onto the NPC. The scripts doesn't seem to do anything for my case unless if I have the Common Event run with them. This will make jumping out of the map possible, however, even if the scripts should have prevented it.

I want the player to be able to jump onto impassible tiles, but when there is an object or an NPC standing there, I want to be able to enable blocking for most of them. I might want some objects to be jumped on, but stuff like the NPC in the screen shot, I don't want the player to be able to jump onto him.
be able to jump onto impassible tiles
use this with Galv's jump
Ruby:
module Galv_Jump
   Terrain_Tag = 4 
end
class Game_Map
  def check_passage(x, y, bit)
    all_tiles(x, y).each do |tile_id|
      flag = tileset.flags[tile_id]
      next if flag & 0x10 != 0            # [☆]: No effect on passage
      return true  if flag & bit == 0     # [○] : Passable
      if terrain_tag(x, y) == Galv_Jump::Terrain_Tag && Input.trigger?(Galv_Jump::BUTTON)
        return true
      end
      return false if flag & bit == bit   # [×] : Impassable
    end
    return false                          # Impassable
  end
end # Game_Map
paste below galv's jump

Then just set a terrain tag for the impassible tiles in your tileset
If the map has only a few places where jumping is not allowed he could created a parallel process event in the map which checks the player X/Y coordinates, and in the event of the jump, add a condition to check the Player X/Y + direction and dont allow jumping if that would make the character go out of bounds

@trakorof Ah, so sorry I didn't see this earlier!! Might have been because I left the window open for hours, typing up my Draft bit by bit and the forums didn't send me an e-mail about your post either. It seems that I would get a notification e-mail only for the first person who posted after me, but I am not sure. Anyway, thank you so much for taking time to share your thoughts!

created a parallel process event in the map which checks the player X/Y coordinates, and in the event of the jump, add a condition to check the Player X/Y + direction

I would like to know more about the checking of X and Y coordinates and how specifically it can be done. Could you please elaborate on this?

paste below galv's jump

Then just set a terrain tag for the impassible tiles in your tileset

@Roninator2 Wow, thank you so much for this! I can't wait to try it out on @Galv's script and let you know my thoughts! I do have a question though, what if you also want to do this for empty tiles (places on the map that doesn't have any tiles)? <- Don't ask why... me and my, once again, crazy(?) ideas!!

I do have the usage of empty tiles in my map and game, and so I want this to work for them. It doesn't look like I can set a Terrain Tag for empty tiles.

Thanks for your time and everybody who have helped me. Really appreciate all the help I am receiving!

Kind regards,
Kiyasu
empty tiles (places on the map that doesn't have any tiles)?
Paint on a blank tile or black tile.

Original thread: https://forums.rpgmakerweb.com/threads/action-button-jump-in-the-same-direction-the-player-is-facing.130092/