Demo – Version 1.6 >
#------------------------------------------------------------------------------#
# Galv's Jump Ability
#------------------------------------------------------------------------------#
# For: RPGMAKER VX ACE
# Version 1.6
#------------------------------------------------------------------------------#
# 2013-06-02 - Version 1.6 - fixed a bug with region block jumping
# 2013-03-14 - Version 1.5 - fixed priority bug when jumping behind things
# - cleaned up code a bit
# 2013-01-15 - Version 1.4 - added follower jumping
# 2013-01-11 - Version 1.3 - added ability to make event pages block jumping
# 2012-12-05 - Version 1.2 - fixed some more bugs
# 2012-11-30 - Version 1.1 - fixed jumping in vehicles bug
# 2012-11-29 - Version 1.0 - release
#------------------------------------------------------------------------------#
# This script allows the player to jump with the press of a button. The player
# will jump as far as their max distance will take them without landing on a
# blocked tile. Use regions to block players jumping completely to prevent the
# player from doing things like jumping between rooms.
#------------------------------------------------------------------------------#
# INSTRUCTIONS:
# Put script under Materials and above Main
# Read options and settings below.
#------------------------------------------------------------------------------#
#------------------------------------------------------------------------------#
# COMMENT FOR EVENT (Must be first event command)
#------------------------------------------------------------------------------#
#
# <block>
#
# add this comment as the first event command of a page to make it unable to
# be jumped over. Change the page to a new event page without the comment when
# you want it to be jumpable.
#------------------------------------------------------------------------------#
# NOTETAG FOR ACTORS, ARMORS, WEAPONS
#------------------------------------------------------------------------------#
#
# <jump_bonus: x> # Adds that many tiles to jump distance
#
#------------------------------------------------------------------------------#
# Only the jump bonus for the party leader and his/her equips are calculated
#------------------------------------------------------------------------------#
# SCRIPT CALL:
# You can change an actor's jump bonus (that was set with the notetag) during
# the game with a script call:
#
# jump_bonus(actor_id,jump_bonus)
#
# EXAMPLE:
# jump_bonus(3,2) # Changes actor 3's jump bonus to 2
#------------------------------------------------------------------------------#
($imported ||= {})["Galvs_Jump_Ability"] = true
module Galv_Jump
#------------------------------------------------------------------------------#
# SCRIPT SETUP OPTIONS
#------------------------------------------------------------------------------#
DISABLE_SWITCH = 1 # Cannot jump when this switch is ON
BUTTON = :X # Button to press to jump. :X is "a" key.
DEFAULT_DISTANCE = 2 # Distance player can jump with no bonuses
SPRINT_BONUS = 1 # Distance increased with a running jump
JUMP_SE = ["Jump2", 50, 120]
MAX_JUMP_BONUS = 3 # The maximum bonus you can get from equips/actors
NO_JUMP_REGIONS = [1,2,3] # Region ID's that the player cannot jump over
#------------------------------------------------------------------------------#
# END SCRIPT SETUP OPTIONS
#------------------------------------------------------------------------------#
end
class RPG::BaseItem
def jump_bonus
if @jump_bonus.nil?
if @note =~ /<jump_bonus: (.*)>/i
@jump_bonus = $1.to_i
else
@jump_bonus = 0
end
end
@jump_bonus
end
end # RPG::BaseItem
class Game_Player < Game_Character
attr_accessor :priority_type
alias galv_jump_player_initialize initialize
def initialize
galv_jump_player_initialize
@jump_equip_bonus = 0
end
alias galv_jump_player_refresh refresh
def refresh
get_jump_equip_bonus
galv_jump_player_refresh
end
def get_jump_equip_bonus
bonus = 0 + $game_party.leader.jump_bonus
$game_party.leader.equips.each { |eq| bonus += eq.jump_bonus if !eq.nil?}
@jump_equip_bonus = [bonus,Galv_Jump::MAX_JUMP_BONUS].min
end
alias galv_jump_move_by_input move_by_input
def move_by_input
return if jumping?
@priority_type = 1 if !jumping?
galv_jump_move_by_input
if !$game_switches[Galv_Jump::DISABLE_SWITCH] && Input.trigger?(Galv_Jump::BUTTON)
do_jump if !$game_map.interpreter.running? && !jumping? && normal_walk?
end
end
def do_jump
get_bonuses
@distance = Galv_Jump::DEFAULT_DISTANCE + @jump_bonus
check_region
check_distance
if @can_jump
RPG::SE.new(Galv_Jump::JUMP_SE[0], Galv_Jump::JUMP_SE[1], Galv_Jump::JUMP_SE[2]).play
jump(@jump_x, @jump_y)
@followers.each { |f| f.jump(@x - f.x, @y - f.y) }
end
end
def get_bonuses
@jump_bonus = 0 + @jump_equip_bonus
@jump_bonus += Galv_Jump::SPRINT_BONUS if dash? && moving?
end
def check_region
@max_x = 0
@max_y = 0
case @direction
when 2
@max_y = @distance
(@distance+1).times { |i| return @max_y = i if stopper?(@x, @y+i+1) }
when 4
@max_x = -@distance
(@distance+1).times { |i| return @max_x = -i if stopper?(@x-i-1, @y) }
when 6
@max_x = @distance
(@distance+1).times { |i| return @max_x = i if stopper?(@x+i+1, @y) }
when 8
@max_y = -@distance
(@distance+1).times { |i| return @max_y = -i if stopper?(@x, @y-i-1) }
end
end
def stopper?(x,y)
Galv_Jump::NO_JUMP_REGIONS.include?($game_map.region_id(x,y)) ||
!$game_map.stopper_event?(x,y)
end
def canpass?(x,y)
map_passable?(x, y, @direction) &&
$game_map.blocking_event?(x,y) ||
Galv_Jump::NO_JUMP_REGIONS.include?($game_map.region_id(x,y))
end
def check_distance
@jump_x = 0
@jump_y = 0
ch = []
@can_jump = true
case @direction
when 2
@jump_y = @distance
@distance.times { |i| ch << @jump_y - i if canpass?(@x, @y + @jump_y - i) }
ch.delete_if {|x| x > @max_y }
@jump_y = ch.max if !ch.empty?
when 4
@jump_x = -@distance
@distance.times { |i| ch << @jump_x + i if canpass?(@x + @jump_x + i, @y) }
ch.delete_if {|x| x < @max_x }
@jump_x = ch.min if !ch.empty?
when 6
@jump_x = @distance
@distance.times { |i| ch << @jump_x - i if canpass?(@x + @jump_x - i, @y) }
ch.delete_if {|x| x > @max_x }
@jump_x = ch.max if !ch.empty?
when 8
@jump_y = -@distance
@distance.times { |i| ch << @jump_y + i if canpass?(@x, @y + @jump_y + i) }
ch.delete_if {|x| x < @max_y }
@jump_y = ch.min if !ch.empty?
end
if ch.empty?
@jump_y = 0
@jump_x = 0
@can_jump = false
end
end
def jump(x_plus, y_plus)
@priority_type = 1.5
super
end
end # Game_Player < Game_Character
class Game_Map
def blocking_event?(x,y)
events_xy(x,y).each { |e| return false if e.priority_type == 1 }
return true
end
def stopper_event?(x,y)
events_xy(x,y).each { |e|
next if e.list.nil?
return false if e.list[0].code == 108 && e.list[0].parameters[0] == "<block>"
}
return true
end
end # Game_Map
class Game_Actor < Game_Battler
attr_accessor :jump_bonus
alias galv_jump_actor_initialize initialize
def initialize(actor_id)
galv_jump_actor_initialize(actor_id)
@jump_bonus = $data_actors[actor_id].jump_bonus
end
end # Game_Actor < Game_Battler
class Scene_Menu < Scene_MenuBase
def return_scene
$game_player.refresh
super
end
end # Scene_Menu < Scene_MenuBase
class Game_Interpreter
def jump_bonus(actor,bonus)
$game_actors[actor].jump_bonus = bonus
$game_player.refresh
end
end # Game_Interpreter
Why it says “invalid octal digit:008 # 2012-11-30 – Version 1.1…” i don’t understand it
You are copying the line numbers from the script. When you mouse-over the script box, some buttons will appear in the top right. One of them allows you to copy the script when you click it.
hey galv i need your help i keep getting line 242 type error occurred undefined superclass scene_menubase
https://galvs-scripts.com/errors-using-scripts/
the link you give me did not fix the error i copy all of the script. in i did not copy the numbers line. the script keep getting line 242 type error occurred undefined superclass scene_menubase
One of the steps in the link I gave you was to test for other script incompatibilities. I believe another script you are using with this one is causing the error.
I have no special script in my game all i have is regular script for the game
The script is working fine in a default project for me.
Checking the steps in that error trapping list I sent you should have lead you to the problem if you followed them.
As you are saying it did not solve your problem, I am sorry I have no idea how to help you.
Is this script for rpgmaker vx or rpgmaker vx ace
Are you serious?
You told me you checked everything on the list I sent you. One of the points on the list is (copy pasted here)
2. Is the script for the correct RPGMaker?
Most of the time a script will say if it was written for a certain RPGMaker. For example, there’s a good chance a script written for RPGMaker VX will not work in RPGMaker VX Ace.
Now, if you REALLY checked the list – you would have answered this question already.
At the top of my site and every page, it says “My RPGMaker VX Ace script archive”.
At the top of every script I have written under the script name it says “For: RPGMAKER VX ACE”.
I’m sorry to sound rude but I tried to help you and you obviously ignored my help. I can not help you if you lie to me and don’t follow my suggestions.
OH I sorry man i did not no i was act very stupid i did not read the script….. but thx for help me bro you are the best and i will sorry
Is it possible to change the character graphic while they jump? I’m doing a Mario game, so it would make all the difference if you could.
Not without a change to the script and I don’t have time to do requests at the moment
Please update me when you are taking requests again. :) I’m patient.
Sorry Galv, for bothering you again, but as I’ve said before, I am making a Mario fan game and I currently have chests’ sprites set as “?” Blocks from Mario. I was wondering if there was a way of jump under them to open them rather than normally interacting with it.
Not with this script without modifications. It is written for rpgmaker engine and not a 2D sidescroller. Sorry, I don’t have time to do requests
When you jump, followers in your party won’t follow you and will only catch up to you if you move. Is there any way to fix that?
Example: http://i.imgur.com/XivpB.png
I can’t think of and don’t know how to make followers jump effectively with the player. It was designed for no followers I’m afraid.
Alright, well, thanks for the response. I love your scripts, using a few for a game I’m putting together.
I added ability for followers to jump now
Oooh, thanks! I’m sorry to ask anytihng else of you, but is there an easy way to add a pause between jumps? I still haven’t learned ruby enough to do this :/
blarg, *anything.
Why do you want to add a pause between jumps? I feel adding a pause would be clunky
because holding onto the jump button just continuously jumps :/ I was hoping to add a pause before you’re allowed to jump again, not pause the whole game.
Oh? Maybe you have conflicting script somewhere as it shouldn’t continuously jump. I just double checked and it doesn’t for me.
I fixed it. I’m using Fomar’s keyboard input script and I had trouble getting it to work at first, so I had replaced the Input.trigger? with his custom call (Keyboard.trigger?) which just kept jumping continuously. I should have tried looking at that :/, sorry. All is well now.
how to see the effect of ability for followers to jump?
oh! i know it, i did’t use the new scrips~
thank,hehe~
I’m so sorry for not completely understanding the script or instructions, but I have a scene in where I have a bridge and I have events that call up so that when you are walking up stairs to reach the bridge, you can’t fall of off the tiles and when you go down the stairs, you are able to walk underneath it. My problem is that I want to add an event that would change the script so that you can still jump, but not off the bridge, in the case, up or down the tiles.
Well, I don’t know how you have set that up, but the script offers two ways to block the player jumping.
Regions. And events with a comment in them.
If you can use events with the comment to do the blocking, you can change the event’s page to one that doesn’t block and back to one that does.
Hi Galv! Loving the script so far, but I’m running into an issue – blocking with comments isn’t working and I really have no idea how to use regions. Halfway done with my game (5 hours of gameplay so far) and haven’t needed them, so… Found this and thought it would be a super cool feature and was going to work it into prior levels. However, I can’t seem to make it so you CAN’T jump over things, even with your instructions.
But maybe I’m an idiot. Totally possible.
Just to clarify, to make something “unjumpable” you add a single event on a black with the comment , correct? Because if I’m not doing it wrong, I’m kinda frustrated. And I suppose I’ll have to learn regions.
Hey! I really am an idiot. I see you put in certain regions that players can’t jump over!
Except that doesn’t work for me either. He still hops right over. :(
Take a look at the demo to see if you are doing it right.
Also here’s a list of error trapping things you can do:
https://galvs-scripts.com/errors-using-scripts/
Yes! The comment eventing will be great! I would most likely do that one! Except… how would I do it with this script? Sorry once again, I am clueless (for now) ;D Thanks too!
How to do it is in the script instructions. If they don’t make sense to you, please download the demo (I just uploaded the most recent version into the demo) and look at the top right npc event.
Ok, I have already tried looking in the instructions but go confused (probably because it’s a late night), but I will make sure to check out the demo! I also just thought of another cool eventing solution. Thank you so much! Kind regards.
Too bad this isn’t compatible with Victor’s Pixel Movement script >< wah. Do you have any plans for compatibility?
No sorry, no plans. Does Victor have a script that allows actions like jumping?
He has one, but not one that allows jumping “over” gaps like yours. :\ That’s a pity. Thanks anyway.
Sorry for bothering today but i cant get the jump working. Line 111: NoMethodError
undefined method ‘jump_bonus’ for nil: NilClass
Please use this list of error trapping ideas to see if you can find the reason for the crash:
https://galvs-scripts.com/errors-using-scripts/
hello Galvs, i used your script but can’t find a way to correctly disable jump by the function “DISABLE_SWITCH = 1” when i am walking in differents map could you advise me ?
here is what i tried :
1 – add “DISABLE_SWITCH = 1” on map notes
2 – create an event on the concerned map with a script inside contening “DISABLE_SWITCH = 1”
3 – try to figure out how to create an instance “Jump” then “No Jump”
but i believe that i should be wrong somewhere, would you give me some help ?
DISABLE_SWITCH = 1 is the settings. You choose which switch you want to use.
In an event you would use ‘Control Switches’ and turn the switch you set ON there.
hi, thank you for your answer, i spent all yesterday evening and night to find out how to disable switches as you said, but unfortunatly i didn’t succeed. hope to find a way this week end.
sorry but i still don’t get it, would you update your demo by inserting a way to disable jump maybe ? that should help me and others
Sorry, I don’t have time to do that. I recommend looking up some rpgmaker tutorials on how to use switches.
It’s an event command. ‘Control Switches’. Turn switch ON.
chrome says the demos are malicious…
Yes, it does. They are not malicious.
in fact the way looks really simple to do, but i’ve not been able to make it work, still searching, also i understand your point about time, it’s ok i will try to find it by myself
Galv I’m using Falcao’s ABS scripts. If a player that is not the main party member it seems any in the party (followers) dead bodies follow you and kind of magnetically jump all the way to you whenever you jump. I’m thinking of how to patch this because it really does not make sense at all. The dead party character should stay in place on ground until he/she/it regain it’s hp.
Any ideas?
The script wasn’t written for ABS so a patch will be needed. I don’t have time to do patches, though, sorry – could ask in a forum to see if someone else will
Thanks for the fast reply tho! much appreciated. I will turn to the awesome forum community to see if I can get some direction on the matter.
Thanks for your time and I wish you luck!
How do I change the keys, say to the space bar?
Press F1 while playing your game. Go to keyboard controls. See which buttons relate to which keys you can use by default.
Spacebar is the interact button so that might not work well
setting regions doesn’t work my character jumps on tiles set as region 1 and also walking on them evan tho they’re set to x
https://galvs-scripts.com/errors-using-scripts/
Setting regions does work, I have used this script in my own games.
“Walking on them even though they are x”. I think you are referring to the default rpgmaker wall-tops. You can walk on them even without my script.
well i tried setting the tiles with regions 1, 2, and 3 and it did nothing.
is there another way to prevent character from jumping on tiles
https://galvs-scripts.com/errors-using-scripts/
Did you go to this link? In particular did you check for script conflicts?
It’s a shame you can’t do compatibility with ABS! I plugged in the script but it seems that I can jump past blocked off areas and even into things (like trees and buildings) — weird
:\
ABS’ rewrite a lot of how the game works. I made this script for the default maker without a script I have never seen before that someone else I never met before wrote.
I don’t know why you think it’s weird or why you feel the need to tell me what I can’t do.
I give my scripts to people for free and don’t take kindly to people such as yourself thinking I should do something more for them when I don’t get paid for this.
Doesn’t work for you? Please don’t use it.
Actually I tried this with XAS v0.6 plus Moghunter’s Simple Anti Lag v2.0, and it worked fine. Thanks Galv, for this awesome script!
I’m getting the error unexpected tIDENTIFIER, expecting keyword_end
…ABLE_SWITCH = 0 #cannot jump when this swit…
What do I do?
Sounds like the script did not copy properly. Try copying it again or copy it from the script demo.
Nope… I’ve copied it multiple times…
Are you positive? Then try this checklist to try to error trap.
https://galvs-scripts.com/errors-using-scripts/
Hi, the scrip work fine thanks but I have a problem the jum bonus only work after player with the equip, change to second and put it at first party member again. how can i change that?
Sounds like a bug – could you describe your setup? Does the actor begin the game with the equip on them?
Script ‘Galv jump’ line 111: TypeError occurred.
nil can’t be coerced into fixnum
I hit the jump button, I dash forward. I hit the menu button and this error pops up and the game crashes. I don’t know if it is a bug or if I am just an idiot. it is probably because I am an idiot.
Make sure you start a new game after adding the script. I believe that error is appearing because your lead actor doesn’t have jump bonus defined (which happens when starting a new game with the script installed)
Sorry to bother but how to install this script, just copy and paste whole text or certain part?
Copy and paste the whole script in the script editor into it’s own section underneath “Materials” and above “Main”
How to jump with animation?
That is not a function of this script, it would need to be scripted in
Hi!
The script works perfectly, but I want to make a request… Can you modify it so to jump in one direction need to press the key of that direction, but, if only press the jump button, jump on site (x0, y0)??
Thanks so much and excuse my terrible english.
Sorry, I am too busy for requests. I recommend asking in a forum
Ok, thanks :)
Hi again! Escuse for doble post but i can´t find edit option… :S
Although I´m not scripter, i´ve made the modification…
Starts at line 179. Replace the case @direction with this one if you want my request:
case @direction
when 2
if Input.press?(:DOWN)
@jump_y = @distance
else
@jump_y = 0
end
@distance.times { |i| ch < @max_y }
@jump_y = ch.max if !ch.empty?
when 4
if Input.press?(:LEFT)
@jump_x = -@distance
else
@jump_x = 0
end
@distance.times { |i| ch << @jump_x + i if canpass?(@x + @jump_x + i, @y) }
ch.delete_if {|x| x < @max_x }
@jump_x = ch.min if !ch.empty?
when 6
if Input.press?(:RIGHT)
@jump_x = @distance
else
@jump_x = 0
end
@distance.times { |i| ch < @max_x }
@jump_x = ch.max if !ch.empty?
when 8
if Input.press?(:UP)
@jump_y = -@distance
else
@jump_y = 0
end
@distance.times { |i| ch << @jump_y + i if canpass?(@x, @y + @jump_y + i) }
ch.delete_if {|x| x < @max_y }
@jump_y = ch.min if !ch.empty?
end
Hey there your demo say use ‘a’ to jump but its the ‘v’ key to jump, if you mean a as in the a input this should be made more clear for new comers.
Also what is your rules on this script ? is it free for all to use for free and communal games ?
Free for all projects including commercial
This confuses me. Have changed your controls via the F1 command? As it is the ‘a’ key by default in the demo. Newcomers also have a help file that teaches them the input and buttons, I don’t see why I ‘should’ teach newcomers everything in a script I don’t charge anything for? :(
Galv’s, it would be possible to allow this script jump only on certain maps? If yes, how could I do that?
Turn the disable switch you chose ON each of the maps is the only way you can currently.
Not to bother you, I’ve seen other comment about it.
Im still getting the
Script “JUMP” line 111: NoMethodError occured
undefined method ‘jump_bonus’ for nil:NillClas
I’ve installed it in my previous game and it worked.
but now Im trying to reinstall it, nothing happens, just that error
(I’ve done everything you said..)
You must have an actor in your party. You must start a new game after adding the script
Im so srry to bother u but…
It says
Script “line 95: NameError occured
unintialized constant Object::Game_Character
Run through this error trapping list:
https://galvs-scripts.com/errors-using-scripts/
Character jumps great for two maps after starting a new game, but after an event where i have the character automatically jumping backwards, I can no longer jump using the the A key as it did before.
The script has a switch that when turned ON disables jumping. I think you used that switch in game. See the script settings, change it to a different switch.
So I notice in the test map you cant jump over the tree and scarecrows yet when I try that it doesn’t work for me. Why is that?
In the script settings:
NO_JUMP_REGIONS = [1,2,3] # Region ID’s that the player cannot jump over
The tree and scarecrow in the demo have region 2 and 3 applied to them, preventing jumping over.
how do you put two actors in the bonus?
The jump bonus is taken from the party leader only.
Hi Galv, is there anyway to make the function “dash + jump = jump farther” more efficient and consistent? This is such a great, great function for gameplay. I’m testing it for half a hour now and if I’m playing a real game I would be having a hard time jumping farther to advance the game. Some time it’s works, some time it’s not.
The reason why it doesn’t seem consistent currently is that RPG Maker is tile-based and the jump happens from the tile the character is on when they press the button.
As soon as the character stops moving (hits impassible object/terrain) then they are no longer counted as sprinting for the sprint-jump. That’s usually where the odd bit is.
Unfortunately I don’t have any plans to update this, though – but I imagine to fix I’d have to add a little timer that made the jump still count as sprinting for a short time after they stop.
Hello.
I got this script a long time ago and it worked wonders.
However it seems it’s not compatible for Effectus. Sprint jump doesn’t function and the jump button sometimes does not work when standing still. I tried multiple things like tinkering with Effectus’ settings, however nothing seems to work.
Here’s the script page http://rpgmakersource.com/ourproducts/effectus/
However the script itself is $20 so I will understand if you cannot help me.
Thank you and have a nice day.
I’m not sure why effectus would have an impact on this script. Have you tried changing the order of it? Eg. this script under effectus
Yes actually, below and above. The same result happened.
It’s odd I know.
I had a quick look (I have effectus) and I see what you mean. It seems to detect 1 square before jumps for certain tiles.
As this is because effectus changes how everything works, I would try asking the coder of it to make a compatibility patch :)
Where can you download the demo of this script?
At the top of this very page there is a link that says “Demo – Version 1.6 >”
I must say that I really like this script, but is it possible to make it so that whenever your character jumps, it turns On a switch, but when you land, it turns that switch back Off?
Not without modifying the script. You could, however, if you want it for conditional branches use inside the conditional branch script:
$game_player.jumping?
To check if player is currently in the middle of a jump.
Perfect! This should work for my project.
I’ve been getting an error in my game. Here’s a screencap of a detailed error message: https://ibb.co/nRCHx7F
In my game, the enemies appear on the map and you battle after running into them. This error happened after pressing the “jump” key immediately after a battle.
Not sure why that would happen. You sure you started a new game?
Also here’s a list of things to try.
https://galvs-scripts.com/errors-using-scripts/
It is a new game, I always test things on a new game. I’m sure I’m using the plugin correctly but I was hoping the detailed error report would be more helpful.
I’ve not heard of it happening before, so we need to replicate in a project that has no other scripts installed to eliminate conflicts as a possible cause. (This is one of the points in other things to try, please try them)
I tried it again, this time turning off all the plugins save for this one.
Still getting an error. “TypeError Cannot read property ‘list’ of undefined”
Wait… are you using MV? You’re posting on the VX Ace version of the script which has confused me and I’ve been trying to replicate… :(
I cannot replicate this in the MV version, either.
In MV, when you get an error, press F12 to bring up the console. Screenshot that.
Also, please create a whole new project and try to replicate the issue.
Hi there, is there any way to change the distance of the jump mid-game? So we can make it further for certain parts? Thanks.
The only things you can do is what is written in the script description text at the top.
Hey, I have a problem, I have 2 games with the same plugins and scripts, but the problem is that when I install the script into the games, one of them marks me error on line 111 saying that jump_bonus does not exist, while the works perfectly. what should I do?
Make sure to start a new game after adding the script. And here are some other error-trapping ideas. https://galvs-scripts.com/errors-using-scripts/