Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> VX Jump Restriction Script, **Fix jump in unpassable tile or out of screen~
woratana
post Jan 19 2008, 02:16 PM
Post #1


Looking for scripter to hire? PM me *O*
Group Icon

Group: +Gold Member
Posts: 1,038
Type: Scripter
RM Skill: Undisclosed




VX Jump Restriction Script

When I used Jump command in VX, I found out that it can jump on the place where it's not passable (which make player cannot move) and it can jump out of the screen! (I means out of the map)

These problems are not happen in XP, so I use same commands from RGSS1 to edit jump command in RGSS2.

Place it above Main (or replace it on def jump in Game_Character),
CODE
#==============================================================================
# ■ Game_Character - Jump Check
#------------------------------------------------------------------------------
#  キャラクターを扱うクラスです。このクラスは Game_Player クラスと Game_Event
# クラスのスーパークラスとして使用されます。
#==============================================================================

class Game_Character
    def jump(x_plus, y_plus)
    if x_plus.abs > y_plus.abs            # 横の距離のほうが長い
      x_plus < 0 ? turn_left : turn_right
    elsif x_plus.abs > y_plus.abs         # 縦の距離のほうが長い
      y_plus < 0 ? turn_up : turn_down
    end
    new_x = @x + x_plus
    new_y = @y + y_plus
    if (x_plus == 0 and y_plus == 0) or passable?(new_x, new_y)
    @x += x_plus
    @y += y_plus
    distance = Math.sqrt(x_plus * x_plus + y_plus * y_plus).round
    @jump_peak = 10 + distance - @move_speed
    @jump_count = @jump_peak * 2
    @stop_count = 0
    straighten
    end
  end
end


=========================
Feel free to ask the questions if you found any error. laugh.gif


__________________________
Check out my NEW blog!!!



MVP (Most Valuable Poster) Award 2008


Go to the top of the page
 
+Quote Post
   
Dark Dragon
post Jan 19 2008, 07:11 PM
Post #2


Level 8
Group Icon

Group: Revolutionary
Posts: 116
Type: Event Designer
RM Skill: Skilled




Yeah that's cool biggrin.gif
But why would you waste your time fixing it ? It's not like the player can jump, it's you who sets the jumps in cut scenes..
And I think the made it this way on purpose.


__________________________
وَلَقَدْ يَسَّرْنَا الْقُرْآنَ لِلذِّكْرِ فَهَلْ مِن مُّدَّكِرٍ



I have noticed that kewlness is mainly based on the behaviour of the kewl person, it doesnt matter wether u kewl or u nt kewl lol omg
I smell n00by, but is me ?
Go to the top of the page
 
+Quote Post
   
woratana
post Jan 19 2008, 07:45 PM
Post #3


Looking for scripter to hire? PM me *O*
Group Icon

Group: +Gold Member
Posts: 1,038
Type: Scripter
RM Skill: Undisclosed




I fixed it because my friend is making the action game, and he needs this script.

I thinks someone who want to make the game that has jump item or minigame may need this.


__________________________
Check out my NEW blog!!!



MVP (Most Valuable Poster) Award 2008


Go to the top of the page
 
+Quote Post
   
lahandi
post Feb 13 2008, 11:42 PM
Post #4


Level 8
Group Icon

Group: Revolutionary
Posts: 111
Type: Artist
RM Skill: Skilled




Mr. Woratana,

Can you tell me what is the default button for jump in RMVX ?

And how if we want to adjust the button for our game ?

Thank you very much smile.gif


__________________________
Go to the top of the page
 
+Quote Post
   
SeeYouAlways
post Feb 14 2008, 12:32 AM
Post #5


Demented Moogle
Group Icon

Group: Banned
Posts: 1,130
Type: None
RM Skill: Undisclosed




The "jump" that this script is referring to is the command you set in the "Define Route" event command of RPG Maker VX. i.e. There is no jumping key feature in RPG Maker VX.


__________________________
Go to the top of the page
 
+Quote Post
   
lahandi
post Feb 15 2008, 08:03 AM
Post #6


Level 8
Group Icon

Group: Revolutionary
Posts: 111
Type: Artist
RM Skill: Skilled




QUOTE
The "jump" that this script is referring to is the command you set in the "Define Route" event command of RPG Maker VX. i.e. There is no jumping key feature in RPG Maker VX.



Ow... like that... tongue.gif


__________________________
Go to the top of the page
 
+Quote Post
   
kami no kitsune
post Apr 8 2008, 07:25 PM
Post #7


Level 5
Group Icon

Group: Member
Posts: 70
Type: Event Designer
RM Skill: Beginner




Is there a way to turn "on" or "off" the jumping restriction so you can make scenes with buffed characters that can jump over cliffs, buildings and such?

Edit: And it's not compatible with the caterpillar script.

This post has been edited by kami no kitsune: Apr 8 2008, 07:32 PM


__________________________
Go to the top of the page
 
+Quote Post
   
woratana
post Apr 8 2008, 08:07 PM
Post #8


Looking for scripter to hire? PM me *O*
Group Icon

Group: +Gold Member
Posts: 1,038
Type: Scripter
RM Skill: Undisclosed




I don't know about caterpillar system, since I'm not using it tongue.gif

but here is the way to turn on and off smile.gif

CODE
class Game_Character

    RESTRICT_JUMP_SWITCH_ID = 1 # Turn this switch ID ON to restrict jump

    alias wor_gamcha_jump_old jump
    def jump(x_plus, y_plus)
    if $game_switches[RESTRICT_JUMP_SWITCH_ID]
      wor_gamcha_jump_old(x_plus, y_plus); return
    end
    if x_plus.abs > y_plus.abs            # 横の距離のほうが長い
      x_plus < 0 ? turn_left : turn_right
    elsif x_plus.abs > y_plus.abs         # 縦の距離のほうが長い
      y_plus < 0 ? turn_up : turn_down
    end
    new_x = @x + x_plus
    new_y = @y + y_plus
    if (x_plus == 0 and y_plus == 0) or passable?(new_x, new_y)
    @x += x_plus
    @y += y_plus
    distance = Math.sqrt(x_plus * x_plus + y_plus * y_plus).round
    @jump_peak = 10 + distance - @move_speed
    @jump_count = @jump_peak * 2
    @stop_count = 0
    straighten
    end
  end
end


I typed in this board directly, so I didn't try the script yet >_>.
it should work though smile.gif


__________________________
Check out my NEW blog!!!



MVP (Most Valuable Poster) Award 2008


Go to the top of the page
 
+Quote Post
   
kami no kitsune
post Apr 9 2008, 10:53 AM
Post #9


Level 5
Group Icon

Group: Member
Posts: 70
Type: Event Designer
RM Skill: Beginner




Hey, thank you very much. this is something pretty useful.

I will try to talk about the incompatibility of this on the caterpillar script topic, to see if there is a way to use both. The problem is that when you use the caterpillar script, the jump restriction doesn't do nothing.


__________________________
Go to the top of the page
 
+Quote Post
   
Red Blood
post Apr 15 2008, 08:01 AM
Post #10


...!
Group Icon

Group: Revolutionary
Posts: 205
Type: None
RM Skill: Masterful




Thank you woratana, I Needed this smile.gif


__________________________
Someday I'll get a better banner =\


Go to the top of the page
 
+Quote Post
   
Lil_J93637
post Aug 9 2008, 06:18 PM
Post #11


Level 8
Group Icon

Group: Revolutionary
Posts: 110
Type: Event Designer
RM Skill: Advanced




Thanks man...this is just what i needed for my game, i had made a common event which allowed a person to jump if they had something equipped, and was pushing a button but they had
always gone onto things they shudnt be going onto..but this fixed that


__________________________
Event crafters now has its own website!
It has
-Its own domain
-People willing help
-No limitations on makers

It's just starting, so it has a few members. Help us out. Join us!

Go to the top of the page
 
+Quote Post
   
killerrin
post Jan 6 2009, 12:09 PM
Post #12


Level 4
Group Icon

Group: Member
Posts: 58
Type: Event Designer
RM Skill: Advanced




hey Waratana is their a way to turn off the sound when the person cant jump becuase i want to put the jump button on space but when i talk to people using space/enter you can hear the you cant jump here sound


__________________________
Go to the top of the page
 
+Quote Post
   
Mickadell
post Jan 18 2009, 02:48 AM
Post #13


Level 5
Group Icon

Group: Member
Posts: 71
Type: Event Designer
RM Skill: Masterful




Hey Wara,
Can you please create a Jump Script. Since your talking about
Jump Restrictions, or if you have please post the link. I really wanted
to try Jumping and I have put in the Jump Restrictions and its useless
if I don't have a jump script.
Go to the top of the page
 
+Quote Post
   
killerrin
post Jan 20 2009, 12:38 PM
Post #14


Level 4
Group Icon

Group: Member
Posts: 58
Type: Event Designer
RM Skill: Advanced




QUOTE (Mickadell @ Jan 18 2009, 02:48 AM) *
Hey Wara,
Can you please create a Jump Script. Since your talking about
Jump Restrictions, or if you have please post the link. I really wanted
to try Jumping and I have put in the Jump Restrictions and its useless
if I don't have a jump script.

its useless to make a jumping script since you can do it with events just make a switch called jump go to common events set move routes and set it to player and use the jump command its easy try messing around with it but here is a better explained tutorial
here you go
and remember scripters like wortana probably wont waste their time scripting something that can be easily achieved with events

like i always say all things you can do with scripting can be done with eventing (with the exception of major things like a battle system) it may be hard but it is possible


__________________________
Go to the top of the page
 
+Quote Post
   
woratana
post Jan 20 2009, 05:23 PM
Post #15


Looking for scripter to hire? PM me *O*
Group Icon

Group: +Gold Member
Posts: 1,038
Type: Scripter
RM Skill: Undisclosed




I would say everything that can be done in eventing can be done in scripting. ^^
And without event command 'Script..', it would be impossible for eventing to do everything that scripting can do.

Though, eventing is a good practice of writing algorithm, and it could be useful when you learn how to script.


__________________________
Check out my NEW blog!!!



MVP (Most Valuable Poster) Award 2008


Go to the top of the page
 
+Quote Post
   
metmanr
post Feb 22 2009, 02:26 PM
Post #16



Group Icon

Group: Member
Posts: 1
Type: None
RM Skill: Advanced




=========================
Feel free to ask the questions if you found any error.

... I, MicroJumper found an error in "Jump Restriction script" ... if jou jump above an event or an non passable field and try to jump back, you can't jump because there, where your first jump starts, is now a non passable field...

+ = passable
- = non passable
E = Event or non passable field
< = Player comes from right and jump to left
> = Player comes from left and jump o right

BEFORE:
++++++++++++++ # > (Player) comes from left and jump above the E (Event)
++++++++++++++ # to this point all is right
++++++ > E +++++
++++++++++++++
++++++++++++++

SINCE THE JUMP:
++++++++++++++ # < comes from right and want to jump back above the E
++++++++++++++ # IT CAN'T - now there is a unvisible non passable block -
++++++ - E <++++
++++++++++++++
++++++++++++++

and thats in all directions !!! ........ PLS FIX IT !!!!! ...... and sry for bad english^^
... for Questions or so to metmanr@web.de ...



This post has been edited by metmanr: Feb 22 2009, 02:31 PM
Go to the top of the page
 
+Quote Post
   
woratana
post Feb 22 2009, 06:04 PM
Post #17


Looking for scripter to hire? PM me *O*
Group Icon

Group: +Gold Member
Posts: 1,038
Type: Scripter
RM Skill: Undisclosed




How come the passable tile changed to unpassable? tongue.gif


__________________________
Check out my NEW blog!!!



MVP (Most Valuable Poster) Award 2008


Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 18th May 2013 - 05:34 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker