How to change jump speed?

AllyJamy

Veteran
Veteran
Joined
Sep 24, 2015
Messages
63
Reaction score
35
First Language
English
Primarily Uses
RMVXA
Hi,

I'm trying to get the jump speed to be slower.

Context here is the player is in a low gravity environment and the fast and snappy default jump looks out of place.

I'd like to slow it down so it looks like gravity is affecting the player. Does anyone know how this can be done?
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,323
Reaction score
482
First Language
English
Primarily Uses
RMVXA
Just tested it. Works but has undesired results.
Game_CharacterBase line 285 if you set the @jump_count -= 0.1 instead of 1
the jump goes slow at the end and fast at the start. Because there needs to be math to calculate the real position or perhaps pixel movement.
With this the jump goes to the landing position and drops slowly.
If there is a better way it involves complex calculations and I don't know those.
 

AllyJamy

Veteran
Veteran
Joined
Sep 24, 2015
Messages
63
Reaction score
35
First Language
English
Primarily Uses
RMVXA
Just tested it. Works but has undesired results.
Game_CharacterBase line 285 if you set the @jump_count -= 0.1 instead of 1
the jump goes slow at the end and fast at the start. Because there needs to be math to calculate the real position or perhaps pixel movement.
With this the jump goes to the landing position and drops slowly.
If there is a better way it involves complex calculations and I don't know those.
In my game my character just did the cha cha slide back and fro before finally sliding to the place he would have landed if he had jumped. Very odd behaviour lol. Thanks though, I'll keep playing around with that line of code.

Edit: @jump_count -= 0.5 is the sweet spot. Works perfect.

Thanks a lot!
 

AllyJamy

Veteran
Veteran
Joined
Sep 24, 2015
Messages
63
Reaction score
35
First Language
English
Primarily Uses
RMVXA
Just tested it. Works but has undesired results.
Game_CharacterBase line 285 if you set the @jump_count -= 0.1 instead of 1
the jump goes slow at the end and fast at the start. Because there needs to be math to calculate the real position or perhaps pixel movement.
With this the jump goes to the landing position and drops slowly.
If there is a better way it involves complex calculations and I don't know those.
I've been trying to get this to work depending on a condition switch. but I can't get that to work. Sorry, but do you know how i can set this up in the script? xd

Heres what I currently have...


Ruby:
  #--------------------------------------------------------------------------
  # * Update While Jumping
  #--------------------------------------------------------------------------
  def update_jump
    
  if $game_switches[937] #switch for low G
    @jump_count -= 0.5 # 1 ,  0.5
  else
    @jump_count -= 1 # 1 ,  0.5
    @real_x = (@real_x * @jump_count + @x) / (@jump_count + 1.0)
    @real_y = (@real_y * @jump_count + @y) / (@jump_count + 1.0)
    update_bush_depth
    if @jump_count == 0
      @real_x = @x = $game_map.round_x(@x)
      @real_y = @y = $game_map.round_y(@y)
      
    end
  end
end
 

AllyJamy

Veteran
Veteran
Joined
Sep 24, 2015
Messages
63
Reaction score
35
First Language
English
Primarily Uses
RMVXA
Well I figured it out eventually. If anyone else wants to do anything similar to this replace the "update while jumping" section in Game_CharacterBase with this


Ruby:
  #--------------------------------------------------------------------------
  # * Update While Jumping
  #--------------------------------------------------------------------------

  def update_jump
   
     if $game_switches[937] #switch for low G
       @jump_count -= 0.5
            @real_x = (@real_x * @jump_count + @x) / (@jump_count + 1.0)
    @real_y = (@real_y * @jump_count + @y) / (@jump_count + 1.0)
    update_bush_depth

     else
       @jump_count -= 1
      @real_x = (@real_x * @jump_count + @x) / (@jump_count + 1.0)
    @real_y = (@real_y * @jump_count + @y) / (@jump_count + 1.0)
    update_bush_depth
    if @jump_count == 0
      @real_x = @x = $game_map.round_x(@x)
      @real_y = @y = $game_map.round_y(@y)
   
      end
  end
end
 

AllyJamy

Veteran
Veteran
Joined
Sep 24, 2015
Messages
63
Reaction score
35
First Language
English
Primarily Uses
RMVXA
All you needed was
Ruby:
  if $game_switches[937] #switch for low G
    @jump_count -= 0.5
  else
    @jump_count -= 1
  end
Think I tried this and had various weird results
 

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

Latest Threads

Latest Posts

Latest Profile Posts


:3c here's a thing i made a while while while back
Tried mochi for the first time. It's quite nice. Has a pleasant smell and taste, and is nice and chewy.
made a bio for the protag in my project!
Beggar : "I haven't eat for days..."
Kid : "Just do crime! You will get daily necessity for free in prison~"

Forum statistics

Threads
99,159
Messages
962,454
Members
130,725
Latest member
teendinsaikha
Top