RMRK is retiring.
Server is paid up for the rest of 2026, but the forum may go after that. See here for more information. Please archive or save anything you would like to keep before 2027.
Main Menu
  • Welcome to The RPG Maker Resource Kit.

Jumping Script [RMVXA]

Started by crow5derlock, February 14, 2013, 01:52:37 PM

0 Members and 1 Guest are viewing this topic.

crow5derlock

Hello, So i found a simple jumping Script here and i made an edit to it, but that's not really the point.

What I need is a restriction in the script that prevents the player from jumping over more than on impassable tile, a restriction so that the player cannot jump over the sides of cliffs that are not on the same level as the character, the level being defined by a region specified by a script call.

Thank you for your time.


# Allows jumping by input...
# ** module INPUT

module JUMP
  module Settings
  DashJumpSize = 3
  JumpSize = 2
  Key = :Z # the game key that can be pressed to jump. Not necessarily the
  # same as the keyboard key
  end # End - Settings
end # End - JUMP

# ** Game_Player

class Game_Player < Game_Character

  # alias method move_by_input
  alias jump_settings_move_by_input_alias_method_49271 move_by_input
  def move_by_input
jump_settings_move_by_input_alias_method_49271
try_jump if Input.trigger?(JUMP::Settings::Key)
  end # End - move_by_input

  def try_jump

#print "inside try_jump \n"

jump_x, jump_y = 0,0
case @direction
when 2
  jump_y = get_jump_size
    $game_temp.reserve_common_event(event_id=1)
when 4
  jump_x = -get_jump_size
    $game_temp.reserve_common_event(event_id=1)
when 6
  jump_x = get_jump_size
    $game_temp.reserve_common_event(event_id=1)
when 8
  jump_y = -get_jump_size
    $game_temp.reserve_common_event(event_id=1)
end
jump(jump_x, jump_y) if map_passable?(jump_x+@x, jump_y+@y, @direction)
  end # End - try_jump

  def get_jump_size
val = dash? ? JUMP::Settings::DashJumpSize : JUMP::Settings::JumpSize
#print "jump size = #{val}\n"
#val
  end

end # End - Game_Player


Edit: My apologies I forgot to state what maker this is for. It is For RMVX Ace.
Final Statement: I chowder5lock am a dipshit and MA is a pretty cool dude.

modern algebra

I think I will do this for you, but I am going to write a new script for it. That script doesn't allow for followers, so I want to write a script that accomodates the caterpillar.

I'm not sure on a timeline.

crow5derlock

Ok, Thank you MA, I appreciate it, as i'm sure many others will too.
Final Statement: I chowder5lock am a dipshit and MA is a pretty cool dude.