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

kiyasu

Veteran
Veteran
Joined
Aug 19, 2020
Messages
40
Reaction score
22
First Language
maybe English?
Primarily Uses
RMVXA
Paint on a blank tile or black tile.
@Roninator2 I just checked B and C in the Tilesets section (screen shots below) and I wonder whether the top left of each is an empty tile. If I set those empty tiles in the screen shot a Terrain Tag, I wonder whether pure empty tiles would get assigned those?! I'm also not exactly sure what you mean by painting on a blank tile because if I do, that would make it a non-empty tile (even if the display is the same thing to the player).
 

Attachments

Sheklon

Veteran
Veteran
Joined
Jan 28, 2020
Messages
41
Reaction score
16
First Language
Portuguese
Primarily Uses
RMVXA
@Roninator2 I just checked B and C in the Tilesets section (screen shots below) and I wonder whether the top left of each is an empty tile. If I set those empty tiles in the screen shot a Terrain Tag, I wonder whether pure empty tiles would get assigned those?! I'm also not exactly sure what you mean by painting on a blank tile because if I do, that would make it a non-empty tile (even if the display is the same thing to the player).
Don't assign a terrain tag to the first empty tile. This tile is applied automatically to all tiles in the map that don't have something else. Use the map editor terrain instead.
 

Attachments

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,647
Reaction score
562
First Language
English
Primarily Uses
RMVXA
that would make it a non-empty tile (even if the display is the same thing to the player).
Well that's the idea. to the player it will look like a black tile - empty space. but you would actually have a black tile there.

The top left of B has to have a star for passability, so don't use that one.
Otherwise use any tile that is set to o for passability and have it empty or black.
You can just edit the tilesets if you need to. But look at interior and you'll see an empty and black tiles half way down.

Don't assign a terrain tag to the first empty tile. This tile is applied automatically to all tiles in the map that don't have something else. Use the map editor terrain instead.
That would be incorrect. Those are region placements.
Tile tags are in the tileset.
1605993541425.png
 

kiyasu

Veteran
Veteran
Joined
Aug 19, 2020
Messages
40
Reaction score
22
First Language
maybe English?
Primarily Uses
RMVXA
@Sheklon @Roninator2 Thanks for the reply! (By the way, I only received e-mail notification from @Sheklon's post but not @Roninator2's. So it looks like I will only receive notification for the first person who replies after me. However, Alerts seem to have everything except that I don't really check Alerts that much compared to e-mail. I did, however, just receive @Sheklon's last "Oh, I didn't notice there was difference. My bad, then." reply via e-mail while leaving this window on, typing this Draft.) I noticed the first empty tile in B has a Star, while the one in C has a circle...

The empty tiles are supposed to be engine default empty tiles (the "tiles" you get in "New Map...," with no painting work) if possible, making walking from one empty tile to another empty tile impossible, hence forcing the player to jump. (I don't want to spoil the reasons for this and wanting to do it this way, and it's also a part of the plot.)

But I guess I could make a custom impassible tile that is fully transparent, and before adding any tiles to a new map, I use the Paint Bucket ("Flood Fill") tool to paint the entire map with fully transparent tiles. If there is a direct way to skip this painting step though, that would be better. Hence I asked about the empty spots in B and C. I still don't exactly know what the empty spots in B and C are for, actually. (And I don't know why A doesn't have an empty tile on the top left.)

However, if you try to paint an existing tile on a map with either one, it won't replace the existing tile back into an "empty" tile.

@Sheklon And yeah, the "map editor terrain" you mentioned are Region IDs... I can think of uses for them, especially when it comes to monster encounters, but I would say Region IDs are far different from Terrain Tags.
 

kiyasu

Veteran
Veteran
Joined
Aug 19, 2020
Messages
40
Reaction score
22
First Language
maybe English?
Primarily Uses
RMVXA
Don't know whether people would receive notifications if I Edit a post, so I am going to reply directly (hope it's OK even though 72 hours have not yet passed).

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
@Roninator2 I just tested the code added to @Galv's script... except what happened was this: I still cannot jump on impassible tiles, but if I press the jump button while walking, I would be able to walk on them. But walking on impassible tiles isn't supposed to happen; I only just want to limit the player to jumping on impassible tiles.

I also tested your code using @Galv's Demo Download as well. Added your code, made the water tiles have a Terrain Tag of 4, and the player would end up walking on those impassible tiles only if the Jump button is pressed while walking. But still no jumping :'(
 

trakorof

Villager
Member
Joined
Nov 21, 2020
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMVXA
@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!



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?
Yes, RPG Maker has an Command to check X/Y coordinates of the player or an event
To do that you need to create 3 new variables, one for X coordinate and one for the Y coordinate. If you need to check the coordinates of the player, "PlayerX and PlayerY" would do. The Other one is a variable just for info later, you will not directly use it.


Now to check their coordinates, create an event (No graphic, parallel process) that does this:
Screenshot_1.png

Control variable is simple, just use the variable created (PlayerX/Y) and check Player X/Y position respectively, you could also check and event X/Y instead, on the same box;

Screenshot_3.png

"Get location Info" is an command available on the third page of the Event commands, dont know if youre using VXA or MV, but I think MV has it too.

You will want to config it like this:
Screenshot_2.png
Info is the other variable you created, the rest is obvious


Now you just created an event that checks coordinates. To use that practically, is simple:
Create a condition branch checking the Player/event X and Y coordinates, the numbers to imput are the same of the map's X and Y coordinates.
For example, in the same event that lets the player jump (common event or not) right before the jumping put a conditional branch like below checking if the player is in a position that would lead to his "death", if so dont let him, with a message for example.
If he dont match the coordinates, let him jump normally (on the "Set handling when condition do not apply"
Screenshot_4.png

I hope its easy to understand now
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,647
Reaction score
562
First Language
English
Primarily Uses
RMVXA
@Roninator2 I just tested the code added to @Galv's script... except what happened was this: I still cannot jump on impassible tiles, but if I press the jump button while walking, I would be able to walk on them. But walking on impassible tiles isn't supposed to happen; I only just want to limit the player to jumping on impassible tiles.

I also tested your code using @Galv's Demo Download as well. Added your code, made the water tiles have a Terrain Tag of 4, and the player would end up walking on those impassible tiles only if the Jump button is pressed while walking. But still no jumping :'(
That is the opposite of what I have setup in a demo project.
I cannot walk on impassible tiles while pressing the button, it only jumps two tiles in whatever direction I'm facing, three tiles if I'm pressing the direction button in that direction.

I put my patch into galv's demo and it works exactly as I described.
I have no idea what you are doing wrong.
 

kiyasu

Veteran
Veteran
Joined
Aug 19, 2020
Messages
40
Reaction score
22
First Language
maybe English?
Primarily Uses
RMVXA
@trakorof Thank you so much!! I will test what you showed me in more detail later, and let you know what I think. Will let you know if I have any questions after that!

@Roninator2 OK, I rebooted everything and for some reason now it finally works like you said except just one thing: if I try to move diagonally, it will function like what I previously said: only walking, but no jumping : ( The characters will only walk diagonally if you press the jump button while moving in that diagonal direction. I want the player to be able to jump diagonally as well.

I just tested the diagonal movement in @Galv's Jump Ability demo as well. The diagonal movement script I am using is @Tsukihime's Eight Directional Movement script. Also, what if you want different jumping Sound Effects (SE) depending on who the leader of your party is? For example, Actor 1 always plays the "boing!" sound effect when jumping, and Actor 2 always plays a different jumping sound effect.
 

ZachyTemp

[Insert Title]
Member
Joined
Apr 20, 2020
Messages
4
Reaction score
1
First Language
Spanish
Primarily Uses
RMVXA
Also, what if you want different jumping Sound Effects (SE) depending on who the leader of your party is? For example, Actor 1 always plays the "boing!" sound effect when jumping, and Actor 2 always plays a different jumping sound effect.
Hey, you can have different jumping sounds for every actor with this script right here:
Ruby:
#===============================================================================
# Galv's Jump Ability | Jump SE Add-on
#-------------------------------------------------------------------------------
# Made by: Zachy
#===============================================================================
module Galv_Jump
#===============================================================================
# Instructions:
#-------------------------------------------------------------------------------
# Every "JUMP_SE_X" entry contains the information for every actor.
#
# You need to add an entry for every actor ID that you want to have a
# different jumping sound. Take line 24 as an example.
#
# If you don't define a sound for an actor, it'll use "JUMP_SE_DEFAULT"
# instead.
#===============================================================================
# Configuration START
#===============================================================================

   JUMP_SE_DEFAULT = ["Jump2", 65, 120] #<= General Jumping Sound

#-------------------------------------------------------------------------------
#  JUMP_SE_(Actor) = ["Filename", Volume, Pitch]
#-------------------------------------------------------------------------------
   JUMP_SE_1 = ["Jump1", 65, 100]               #<= Actor 1 Sound
   JUMP_SE_2 = ["Flash1", 65, 120]              #<= Actor 2 Sound

#===============================================================================
# Configuration END
#===============================================================================
end

class Game_Player < Game_Character

# Overwrite "do_jump" method.

  def do_jump
    get_bonuses
    @distance = Galv_Jump::DEFAULT_DISTANCE + @jump_bonus
    check_region
    check_distance
    if @can_jump
      if Galv_Jump.const_defined?("JUMP_SE_#{$game_party.leader.id}")
        jump_param = Galv_Jump.const_get("JUMP_SE_#{$game_party.leader.id}")
      else
        jump_param = Galv_Jump::JUMP_SE_DEFAULT
      end
      RPG::SE.new(jump_param[0], jump_param[1], jump_param[2]).play
      jump(@jump_x, @jump_y)
      @followers.each { |f| f.jump(@x - f.x, @y - f.y) }
    end
  end

end

Just make sure to put it under Galv's original script and @Roninator2's script.

@Roninator2 I want the player to be able to jump diagonally as well.
About jumping diagonally... Well it's not impossible but I wouldn't recommend trying it.

As far as I know the only script that allows you to do this is Victor's Free Jump, but it requires you to install Pixel Movement. So unless you really need diagonal jumping in your game, I think it'd be better to stay with your current jumping script.

@Roninator2 if I try to move diagonally, it will function like what I previously said: only walking, but no jumping
Movement scripts usually don't work well when put together. Probably one of them is overwritting the jumping method and that messes things up.

Place Himework's 8-directional script above the jump script and that should fix it.
 
Last edited:

kiyasu

Veteran
Veteran
Joined
Aug 19, 2020
Messages
40
Reaction score
22
First Language
maybe English?
Primarily Uses
RMVXA
Just make sure to put it under Galv's original script and @Roninator2's script.
@ZachyTemp Cool, it seems to work well! Thank you!! I was wondering though, can one jump have more than one Sound Effect playing? For example, if you have voice acting, and you want the player to play more than one sound file for each jump! And maybe when the player lands on grass, there will be another Sound Effect playing for the landing!

Place Himework's 8-directional script above the jump script and that should fix it.
I just noticed that I do have @Tsukihime's script above @Galv's script. So, what's the problem?

Use doubleX diagonal movement
Place above galv jump
@Roninator2 Is @DoubleX's Diagonal Movement script the same as Moghunter's Diagonal Movement script? Why are you suggesting a change of scripts?

I used to use Mog's script but found that the movement was so fake and amateur-like in that there are no diagonal sprites! That's why I switched to @Tsukihime's Eight Directional Movement script. Also, about the "walking only, no jumping" issue on impassible tiles, I noticed that if I change the Switch that affects whether jumping is enabled, there will be a problem! Like, if you disable jumping through the Switch in @Galv's script, it will then function like what I said before: you can move on impassible tiles if you press the Jump button. :'(

Another problem I have is that the player's jump distance on passable tiles is smaller than when the player jumps on impassible tiles. This would look odd on a map consisting of, say, half-passable and half-impassible tiles! How can I make it that they are the same jumping distance? Or even better: custom set the jumping distance for each situation?
 

ZachyTemp

[Insert Title]
Member
Joined
Apr 20, 2020
Messages
4
Reaction score
1
First Language
Spanish
Primarily Uses
RMVXA
@ZachyTemp Cool, it seems to work well! Thank you!! I was wondering though, can one jump have more than one Sound Effect playing? For example, if you have voice acting, and you want the player to play more than one sound file for each jump! And maybe when the player lands on grass, there will be another Sound Effect playing for the landing!
Yes it's possible to randomize the sounds to have more than one per actor. You can also add sounds for different tiles by using terrain tags and playing a SE after the jump ends (think about Victor's Step Sound but only playing the sound when jumping).

However, I went on a trip so I may not be able to write code for a while cuz I don't have my PC.

Also it would be nice if you could give us a list of the current scripts you're using right now, since I can't seem to reproduce the issues you're having.
 

Users Who Are Viewing This Thread (Users: 1, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Lately when I listen to 1970s songs, I always think that the "real world" is still at mid 70s. What we experience now is a futuristic dream. With this point of view, even 80s and 90s looks super futuristic. :D

The GIF of this seemed too cool to bury in replies. :LZSwink:
You may have slept with my aunt... but, given the circumstances, cheers.

- Professor Ian Duncan, 2013
Ami
--- Swimming ---

F.Knight: This Shrine always Flood. We don't have a choice,we have to Swimming in this place
F.Healer: That Insane!
F.Mage: We can use…Boat,rather than Swimming
F.Knight: You guys…Can't Swim?
F.Healer & F.Mage: (Shocked) Eehh??

Forum statistics

Threads
105,528
Messages
1,014,426
Members
137,211
Latest member
RikuTales
Top