RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Jumping Script [RMVXA]

0 Members and 1 Guest are viewing this topic.

***
You pie feeders!
Rep:
Level 68
Everyone... Actually Everyone hates me :)
2012 Biggest Drama Whore
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.


Code: [Select]
# 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.
« Last Edit: February 14, 2013, 07:35:38 PM by crow5derlock »
Final Statement: I chowder5lock am a dipshit and MA is a pretty cool dude.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
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.

***
You pie feeders!
Rep:
Level 68
Everyone... Actually Everyone hates me :)
2012 Biggest Drama Whore
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.