Gw Temp

Menu

Tutorial - 'Sword Fight System' by Bilbo

An item about RPGMaker 2000 posted on

Blurb

A tutorial on Sword Fighting

Body

Sword fight System
For RM2k
By Bilbo

This is a very easy fight system…If you don’t understand it then you may still be able to use it :D

You need the know how of: Variables
Common events
Switches
Enter Password
Fork Conditions

That’s all you need to know
If you don’t understand the Enter password then don’t worry, I’ll tell you what buttons to press to use that part

First you need the Enemy
Make it simple…maybe a Alex
(My Ultimate revenge on Alex’s is here! MWAHAHAHAHAHAHAHA!)
Remember too set the graphic for the enemy event

The enemy event will take 3 pages
Alive and kicking
You attacking
It dead


First Page
This will be what happens when it attacks you
Here I will show the basic “Ow and jump back”
When you are hurt you will jump back so that you can’t be hurt constantly

Set it to “On Hero touch”
Here set what you want the enemy to do when it attacks…
Maybe have it jump up and down or make a sound effect or use a battle animate to have it strike the hero
I will use Jump up and down

<>Move event this event: Start jump, End jump

Here add a sound effect for you being hit

<>Play SE: Blow

For effect you can add that the character flashes red

Now use Fork Conditions to make the hero jump back in pain
This will take four fork conditions

<>Fork Optn: Hero- Up face direct
<> Move Event: This event: Escape from hero, Escape from hero **
<> Move event: Hero- Start jump, move down, move down, End jump
<> Variable Ch: (Herohealth) +1 *

*Using a variable there means that the hero loses 1 health
I will explain later how to have the health maximum so you die when you lose all your health
** This means that you can not be hurt constantly or get stuck

<>Fork Optn: Hero- Left face direct
<> Move Event: This event: Escape from hero, Escape from hero
<> Move event: Hero- Start jump, move right, move right, End jump
<> Variable Ch: (Herohealth) +1



<>Fork Optn: Hero- Down face direct
<> Move Event: This event: Escape from hero, Escape from hero
<> Move event: Hero- Start jump, move up, move up, End jump
<> Variable Ch: (Herohealth) +1

<>Fork Optn: Hero- Right face direct
<> Move Event: This event: Escape from hero, Escape from hero
<> Move event: Hero- Start jump, move left, move left, End jump
<> Variable Ch: (Herohealth) +1

On all of those fork conditions remember to add in the move event ”Ignore if can’t be moved”

That’s all you need for the enemy attack, I’ll put the coding in full here

<>Move event this event: Start jump, End jump
<>Play SE: Blow
<>Fork Optn: Hero- Up face direct
<> Move Event: This event: Escape from hero, Escape from hero
<> Move event: Hero- Start jump, move down, move down, End jump
<> Variable Ch: (Herohealth) +1
<>Fork Optn: Hero- Left face direct
<> Move Event: This event: Escape from hero, Escape from hero
<> Move event: Hero- Start jump, move right, move right, End jump
<> Variable Ch: (Herohealth) +1
<>Fork Optn: Hero- Down face direct
<> Move Event: This event: Escape from hero, Escape from hero
<> Move event: Hero- Start jump, move up, move up, End jump
<> Variable Ch: (Herohealth) +1
<>Fork Optn: Hero- Right face direct
<> Move Event: This event: Escape from hero, Escape from hero
<> Move event: Hero- Start jump, move left, move left, End jump
<> Variable Ch: (Herohealth) +1

Now that that is done I can say happily that that is the biggest bit of coding in it
The rest is much smaller

Ok, now here is your attack
On the enemy event (above) press new page
Set the page to “Push Key”
On the new page create a switch like “Hero attack”
And set it so it needs to be on

All you need for this bit is accually just
<>Variable Ch: (Enemyhealth) +1
But that’s boring

Add a sound effect at the start (maybe a scream) to show that he’s in pain
Also add a
<>flash character: this event
Make it red to show that he’s been hurt
Also add
<>Move Event: This Event :Start Jump, Escape from hero, end jump
So that he doesn’t just keep coming after you like the Terminator
And that’s that bit done, so I’ll put it in full



<>Play SE: Scream
<>flash character: this event
<>Move Event: This Event :Start Jump, Escape from hero, end jump
<>Variable Ch: (Enemyhealth) +1

The variable is the enemy health, you will need it for the next bit which is making the enemy die

Just press “New Page” on the enemy event
This bit takes no coding so it’s very easy

At the side where you can set the switches and all that
Set it on the Variables bit that it uses the variable you used for enemy health
Under that set the health of the enemy (in the bit just under variable)

For effect on this page make the graphic something dead, maybe a dead body or something spattered in blood or you can do nothing at all for the graphic

That’s the enemy done
For every enemy you do just change the variable
That means they run off separate health

Now I will tell you the “Common Event” bit
Its quite easy though
Here you set your attack up

FOR PEOPLE THAT DON’T HAVE A CLUE ABOUT COMMON EVENTS:
Go into the database and press the button that says common events
There you can set the common event up
It works the same as an event so its not hard

Make a new common event
Call it what you want
For this I will call it “Hero attack”
At the top set it to “Parallel progress”
Click the box under “Appearance Conditions Switch”
And set up a new switch
For this I will call it “Attack on”

Basicly this means you can control whether you can attack in a map or not
I will explane this later on in the tut

Back to the Common Event
Go to your attack common event
Here set up what you want to happen when you attack
Here is the coding for the common event (its very simple)

<>Wait: 0.1
Here set what you want for attack
I use a sound effect, it works well
Don’t use a jump or anything, it causes you to miss when you attack most of the time
Don’t put too much here as when in a fight you don’t want to spend ages attacking
<>Wait: 0.2

The waits mean that you can’t just constantly attack

Next I will explane how to set up the hero health
Its very easy
On the map that uses a fight make an event
Set it to “Parallel Progress”
At the side at the “Variables” part set the hero health part (used in the first part of my tut in the enemy attack part)
Under that will be a bit for numbers, Set what you want your health to be
I use 15 usually but you can use what you want

In the event bit set what you want to happen when you die
A very basic is

<>Game over

But that’s boring
Add a screaming sound effect
Or set screen tone to go black
Or set screen tone to go into black and white

Do that before you go
<>Game over

Make it interesting

Only one thing left! (Yay!)

Make a new event on the map you want to use this fight on
Set it to “Parallel Progress”

On the event bit put
<>Enter Password (Attack)

As I said at the start I will tell you what buttons to press to set the password
Make a new event command
On page 3 press “Enter Password”
Unclick the two buttons that have “Direction” and “Cancel” next to them
Make sure the one in the middle (“Decision”) has a tick in the box next to it
Set a new variable to store the password in
Name it what you want
And then hit “Ok”
That’s the enter password done

After
<> Enter Password (Attack)
put

Change Switch (Attack On) ON set
Wait 0.5s
Change Switch (Attack On) OFF set

The switch is the common event from before

And that’s it
That event means you can us the attack you set in the common event
The enter password means it only happens when you press Enter or space bar
The wait means you can’t just constantly attack

And that’s the end of my Tutorial on a basic Sword Fight system
I hope it has helped you

Now I gotta go because my hands have gone numb from typing this out,

Cya!