Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> [Eventing]Exclusive Jumping Tutorial, Jump anytime without in-game freezing!
rojse
post Jun 25 2008, 02:09 AM
Post #1


Level 19
Group Icon

Group: Revolutionary
Posts: 373
Type: None
RM Skill: Skilled




This tutorial will show you how to create an in-game jump event that can be used at any time, without causing the game to freeze, as is normally the situation in 2k3. This will allow you to jump any time, and will automatically recognise if the player is trying to jump to no-go zone, such as an ocean, a cliff-face, or a non-walking tileset. This was completed in 2k3, but I assume it can be adapted for XP and VX.

Make yourself a map first, that will give you something to jump around. Include some no-go areas, like cliff or water. Here's my attempt:



Create a new common event, and make it a parallel processing event.

First, create a conditional branch to check that jumping is enabled. You can then turn this off whenever you deem appropriate, such as in buildings, where you may not want the character to leap around, but remember to turn this switch back on later. Create a Key Input Processing event, set a key to press to allow jumping (such as shift, "0" and so forth), then run a conditional branch event that checks that the key input variable is equal to that number.

Check the sprite’s facing through conditional branches, and for each possibility, set the X Coord and Y Coord. YOU NEED TO SET EACH INDIVIDUALLY THROUGH VARIABLE OPERATIONS INSTEAD OF USING THE EVENT “MEMORISE POSITION.” I have emphasised this heavily because the event will not work if you do not do this. For some reason, setting the coordinates through Memorise Position does not work, so set it through variable operations. For the Hero facing up, take two from the y coordinate (if your jump event is to move two spaces). When facing right, add two to the x coordinate, when facing down, add two to the y coordinate, and when left, take two from the x coordinate.

On the second page, bottom of the left column is an event called “Terrain ID.” Set this to the X and Y coordinates. Create a conditional branch if this variable is 10 (Or create a custom terrain number for this, if you wish.) For every tileset which you do not wish a character to land on, set this to 10 in the tileset screen.

If the conditional branch is met, leave it blank. If it is not met (you can move on the tile in some way), set the jump event – Move Event > Hero > Begin Jump, Move [Direction], Move [Direction], End Jump. You can also set conditional branches for other numbers, such as swamp, if you feel players should not be jumping in these areas.



This is an example of the coding, and shows the events required for two different sprite facings. The rest of the code is nearly identical, apart from the modifications I outlined earlier.

Now, your jump system should be complete. You should be able to jump around freely without causing the game to freeze, and your character will not jump into no-go areas. The game should automatically stop you if you try and jump over a cliff or into water. Here is an example of the event in action.



Hopefully, this will help you implement a jumping system into your game. I hope people can find a use for this. Please feel free to leave feedback or comments if parts need clarification or you feel that there need to be modifications made to this tutorial.

EDIT: Pictures not displaying properly.
Go to the top of the page
 
+Quote Post
   

Posts in this topic
- rojse   [Eventing]Exclusive Jumping Tutorial   Jun 25 2008, 02:09 AM


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: 19th June 2013 - 05:07 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker