Home
Help
Search
Calendar
Login
Register
Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Click here to join us on IRC (#charas on irc.freenode.net)!
Charas-Project
»
Game Creation
»
Requests
»
Tutorials
»
Jump skill tutorial
« previous
next »
Print
Pages: [
1
]
Author
Topic: Jump skill tutorial (Read 3249 times)
Master Uei
Assailant of doom
Initiate
Posts: 40
Jump skill tutorial
«
on:
March 18, 2004, 11:55:39 AM »
Jump Skill Tutorial
----------------------------------------------------------------------------------
THIS ONE IS REALLY LONG SO DO NOT USE THIS UNLESS YOU Are willing TO READ IT THROUGH COMPLETELY!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
----------------------------------------------------------------------------------
In today's tutorial, we look at how to create a Jump skill.
For this, you will need: Switches, variables, fork conditions, and attack attributes.
Okay, let's start off with, how to make the skill itself. This is really easy, it's just a switch skill called Jump. For simplicity's sake, we will also call the switch Jump.
Now, the programming behind the Jump skill. One of the good things about the Jump skill was: while your character is using it, you were absolutely 100% immune to enemy attacks. So, you'd use Jump, the character would leave the battle, they'd reappear in a few rounds, hitting some enemy for a nice bit of damage. Now, this is kind of tricky using RM2K, requiring a lot of programming.
First, you will need a character who is an exact copy of your original one with the Jump skill. Absolutely identical in every way.....except, they will have E class resistance to all attack attributes. To make the immunity effect take hold properly, set E resistance to 0% damage. Thus, no attack type hurts the new hero.
But this still leaves regular enemy attacks able to hurt him. So, a new attack attribute called "Enemy Attack" will be created. It will do 0% damage to anything with E class resistance. Next, create a skill called "Enemy Attack" that has an attack attribute of "Enemy Attack". Finally, go into the Monsters section of your game database, and under behavior, replace the behavior of Attack with the skill "Enemy Attack".
Next, create a common event that sets variables to your original hero's: Weapon ID; Shield/Second Weapon ID; Armor ID; Helmet ID; Other Item ID; Experience; Current HP; Current MP.
We'll call these variables, in order, Weapon; Shield; Armor; Helmet; Other; Exp; Hp; Mp.
Next, set a second set of variables to the same things for the copy of the first hero. These will be called Weapon2; Shield2; Armor2; Helmet2; Other2; Exp2; Hp2; Mp2.
Now, in that same common event, set a fork condition saying:
If Weapon isn't the same as Weapon2, set hero 2's weapon to Weapon, discard 1 item with an ID number of Weapon2.
Repeat this with all the other equipment based variables. Now the second hero will always have the same equipment as the first.
Now, for the Exp, Hp, and Mp variables, set the fork condition to read like this:
If Hp is not the same as Hp2, decrease hero 2's HP by Hp2, increase by Hp.
Do the same with MP and experience. Now the second hero will always be the same level as the first, and will have the same HP and MP totals.
Now that the two heroes will have the same stats, it's time to set up the system for switching them. In the Monsters Party section of your game's database, create a page saying, If switch Jump is on, change party: remove hero 1, add hero 2. Change switch Jump off, change switch In Air on.
Now, make a page saying: if switch In Air is on, change variable Jump Rounds +1.
Finally, make a page saying: if variable Jump Rounds is 2, change party - remove hero 2, add hero 1; change variable Jump Rounds to 0, change switch In Air off.
Now, your character jumps, stays in the air for a round or two, and lands. But, what if the battle ends while he's still in the air? Well, in that case there needs to be a common event to fall back on. It should basically say the same as the last page in the Monsters Party section.
So, your coding should look something like this:
Common event 1:
<>Change Var: Var[0001:Weapon] (Set)-Hero1's Weapon#
<>Change Var: Var[0002:Shield] (Set)-Hero1's Shield#
<>Change Var: Var[0003:Armor] (Set)-Hero1's Armor#
<>Change Var: Var[0004:Helmet] (Set)-Hero1's Helmet#
<>Change Var: Var[0005:Other] (Set)-Hero1's Accessory#
<>Change Var: Var[0006:Hp] (Set)-Hero1's HP
<>Change Var: Var[0007:Mp] (Set)-Hero1's MP
<>Change Var: Var[0008:Exp] (Set)-Hero1's EXP
<>Change Var: Var[0009:Weapon2] (Set)-Hero2's Weapon#
<>Change Var: Var[0010:Shield2] (Set)-Hero2's Shield#
<>Change Var: Var[0011:Armor2] (Set)-Hero2's Armor#
<>Change Var: Var[0012:Helmet2] (Set)-Hero2's Helmet#
<>Change Var: Var[0013:Other2] (Set)-Hero2's Accessory#
<>Change Var: Var[0014:Hp2] (Set)-Hero2's HP
<>Change Var: Var[0015:Mp2] (Set)-Hero2's MP
<>Change Var: Var[0016:Exp2] (Set)-Hero2's EXP
<>If Var(0001:Weapon) V[0009](=)
<>
:Else Case
<>Equipment: Hero2===>V[0001] (Equip It)
<>Chng Item Count:(V[0009]) 1 (Rem)
<>
:End Case
<>If Var(0002:Shield) V[0010](=)
<>
:Else Case
<>Equipment: Hero2===>V[0002] (Equip It)
<>Chng Item Count:(V[0010]) 1 (Rem)
<>
:End Case
<>If Var(0003:Armor) V[0011](=)
<>
:Else Case
<>Equipment: Hero2===>V[0003] (Equip It)
<>Chng Item Count:(V[0011]) 1 (Rem)
<>
:End Case
<>If Var(0004:Helmet) V[0012](=)
<>
:Else Case
<>Equipment: Hero2===>V[0004] (Equip It)
<>Chng Item Count:(V[0012]) 1 (Rem)
<>
:End Case
<>If Var(0005:Other) V[0013](=)
<>
:Else Case
<>Equipment: Hero2===>V[0005] (Equip It)
<>Chng Item Count:(V[0013]) 1 (Rem)
<>
:End Case
<>If Var(0006:Hp) V[0014](=)
<>
:Else Case
<>Change HP: Hero2's HP V[0014] (Rem)
<>Change HP: Hero2's HP V[0006] (Add)
<>
:End Case
<>If Var(0007:Mp) V[0015](=)
<>
:Else Case
<>Change MP: Hero2's MP V[0015] (Rem)
<>Change MP: Hero2's MP V[0007] (Add)
<>
:End Case
<>If Var(0008:Exp) V[0016](=)
<>
:Else Case
<>Change EXP: Hero2's EXP V[0016] (Rem)
<>Change EXP: Hero2's EXP V[0008] (Add)
<>
:End Case
Monster Party page 1 (triggered by switch Jump)
<>Change Hero's Party: (Hero1) (Rem)
<>Change Hero's Party: (Hero2) (Add)
<>Change Switch: Var[0002:InAir] Switch ON
<>Change Switch: Var[0001:Jump] Switch OFF
Monster Party page 2 (triggered by switch InAir)
<>Change Var: Var[0017:Jump Round] (+)- 1
Monster Party page 3 (triggered by variable Jump Round being equal to 2)
<>Change Hero's Party: (Hero2) (Rem)
<>Change Hero's Party: (Hero1) (Add)
<>Change Switch: Var[0002:InAir] Switch OFF
<>Change Var: Var[0017:Jump Round] (Set)- 0
<>
And the final common event (triggered by switch InAir)
<>Change Hero's Party: (Hero2) (Rem)
<>Change Hero's Party: (Hero1) (Add)
<>Change Switch: Var[0002:InAir] Switch OFF
<>Change Var: Var[0017:Jump Round] (Set)- 0
<>
Now, the way this is set up, the hero gains no experience for finishing off a battle in the air. To change this, change the part in the first common event where it says
<>If Var(0008:Exp) V[0016](=)
<>
:Else Case
<>Change EXP: Hero2's EXP V[0016] (Rem)
<>Change EXP: Hero2's EXP V[0008] (Add)
<>
:End Case
To instead say
<>If Var(0008:Exp) V[0016](>=)
<>Change EXP: Hero2's EXP v[0016] (Rem)
<>Change EXP: Hero2's EXP V[0008] (Add)
<>
:Else Case
<>Change EXP: Hero1's EXP v[0008] (Rem)
<>Change EXP: Hero1's EXP V[0016] (Add)
<>
:End Case
<>
As well, the HP and MP variables are for the most part just for show. You can either remove them or place their part of common event 1 in a page in the monsters party area of the database.
Now that all the programming is finished, you can change the names of the two heroes. That Could have been done at the start, but that would have confused things horribly in the tutorial.
So, there you have it: I really don't remember if this one works. I remember trying to use it on one of my really old games. I typed this up and completely forgot to delete it. Hope you all like it!
Logged
Print
Pages: [
1
]
« previous
next »
Charas-Project
»
Game Creation
»
Requests
»
Tutorials
»
Jump skill tutorial