Charas-Project
Game Creation => Requests => Tutorials => Topic started by: DragonBlaze on January 04, 2005, 11:06:17 PM
-
Allright this tutorial explains how to make your character dash by holding down the spacebar (or any key you wish), and when letting up on the spacebar you go back to your normal speed. This is my first tutorial ever, but I might start making more if I make some more scripts.
I thought of how to do this sunday while I was in church, the pastor was giving a really boring sermon, so my mind wandered and all of the sudden I was thinking of rm2k3. And well thats when I thought of how to do this.
Note: I included a picture of what the script should look like when its done at the bottom of the post.
The first thing you have to do is make an even in the "common events", name it DASHING, and set it to a parallel process event.
Now make a "key input process", set it to an unused variable (lets calle it "DASH INPUT"). In the area thats labeled "keys to process" click on the box for the spacebar, and make sure that all the other boxes are unchecked. Before selecting "ok" be sure that the option "wait till key is pressed" box is unchecked. If it is checked instead of dashing while you hold the spacebar, you will just increase your movement speed the first time to press it, and nothing further will happen.
Under that key input process place a conditional branch. Set it so that it branches if the variable "DASH INPUT" is equal to 0. After making that conditional branch, make another conditional branch inside of it so that it branches if the switch "DASH 2" is off. At this time you need to make two swiches and label them "DASH" and "DASH 2".
Allright now inside the branch for "Dash 2" Being off, select the command "move event". For the even to move set it to hero, and for the movement set "move speed down".
Now under that move speed down event, turn the switch "DASH" OFF, and turn the switch "DASH 2" ON. Lastly set the variable "DASH INPUT" to 0. You're half done now.
Make another conditional branch below the "If DASH INPUT is equal to 0..." (make sure its below and not in that branch). Set the new conditional branch so that if "DASH INPUT" is equal to 5 it branches.
Like in the other conditional branch, make another conditional branch in that one so that if the switch "DASH" is off, it branches. Now inside that conditional branch click the option "move event" again. Instead of decreasing the movement speed though, increase the movement speed.
Then simply turn the switch "DASH 2" ON, turn the switch "DASH" OFF, and finally set the variable "DASH INPUT" to 0.
There is one last thing you have to do. At the way bottom of the script, put a little wait command. Set the wait to 2 tenths of a second to 5 tenths of a second. You need this here otherwise you can keep hitting the spacebar really fast and your movement speed will keep increasing.
Anyway thats it, your done :). There is one bug I found with this script while testing it. If you have an event that moves the hero automatically, and you press and hold the spacebar while you are moving then, the current movement is interupted prematurely. Sometimes it dosn't matter, but sometimes it dose. To fix this you can set the common even "DASHING" to run only if the a certain switch is on. Turn on that switch at the start of the game, then during every time you are using the "move event" command to move a hero, turn that switch off, every time you're done moving that hero turn it back on. You can also set it up so that you can only walk in buildings and such that way if you don't want your hero running in buildings and such.
And heres what the script should look like (You can ignor the loop command)
-
Interesting... Very interesting.
I might actually have some use of this. :bend:
Good job, Dragon.
-
that might be a good help to everyone
-
Nice use of your mind.. Pretty cool.
-
A simple system, but you explained eveything very clearly. I say... 9/10.
-
Well thanks everyone :)
Now that I finished making my cbs, I'm gonna start making a lot more little sytems and mini games. If I come up with any cool ones I'll probably make tutorials for them as well. However I'm not even going to try and explain more complicated things (such as a cbs) simply because I don't think I can. I'm not too good at explaining how to do varios things, one of the reasons I would never want to be a teacher :)
-
Nice. I could use something like this in my game. Welcome to my credits, DragonBlaze.
-
yay, thanks. You should probably check back in a few days for an updated version of the dash script. I have found that if you start dashing just before you hit a event that you can pass over (such as a teleport event) you will skip right over it. So I gotta fix that :|
-
... very good, very good, this can come into very good use in my new game... the thing is that I don't like long lines of text...this could be complicated :P thanks for the info btw... I'll tty is later on
Edit: What the cr*p! This dashing thingy won't work! I've tried several times doing exactly what you told me, the list does not even match... did you write something wrong or what???
Anyhow, the hero 'does' move slower but NOT faster...
what did I do wrong? all I did was what you wrote down
(I combined your two posts - Kijuki)
-
this looks good, but im kind of new... i wiil post agian if i try it out
-
Don't kick old topics