Notice: fwrite(): Write of 44 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96
Making your character move quicker when you press a button.
Main Menu

Making your character move quicker when you press a button.

Started by Doyora, April 10, 2006, 03:23:01 PM

0 Members and 1 Guest are viewing this topic.

Doyora

I would like to know of a way to make your character run when you press a button. I would prefer run toggling rather than holding. I HAVE searched to see if it is on this forum, or any other, and I have found nowt.

If anyone could help, please?
Awwww yeah.

Tyhan

Theres a dash script somewhere, but you'd need running sprites.  Also this can easily be done with events.... make a common event...

Make a switch called Dash
Make a conditional branch to check if the switch Dash is on.
If it is... Make it...
When button [A] is pressed walking speed = 4
Turn Switch [Dash] off.
Else
When Button [A] is pressed walking speed = 5
Turn Switch [Dash] on.

Blizzard

Use this.

[code]if Input.trigger?(Input::L)
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.



Get DropBox, the best free file syncing service there is!

Doyora

Thanks. But wait... I don't understand. Could you explain again please? I also forgot to say I'm using RPG maker XP. :oops:
Awwww yeah.

Blizzard

Okay, here:

red - scripts button, press it to open the scripts window
green - the script names, find Gaem_Character2 as I did.
cyan - find def update and paste the code below in
blue - just like I did (mine differs from yours, bcoz I use mine only for debug)

Just paste the code I posted in my post above there, where the code on this screenshot is.

Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.



Get DropBox, the best free file syncing service there is!

Sir Hiro

im using this code also :), but im wondering is there a way to make it last for like 3 second and then you have to wait like 10 seconds before you can use it again?
~Soon to be~

Blizzard

Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.



Get DropBox, the best free file syncing service there is!

Doyora

 :mrgreen: Awww yeah. It works! thanks. Just one more thing... is there a way of making it so tha this only works after a switch has been turned on? Then, I'm done. Thanks!
Awwww yeah.

Blizzard

Sure. Use one of the game switches. Just replace the old code i gave you with this one. Replace the XXXX with the ID number of the in game switch you want to use. Now, turning on the switch will allow dash.

[code]if $game_switches[XXXX] == true
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.



Get DropBox, the best free file syncing service there is!

Doyora

Aargh no! I put this in, but now when I trigger the switch ON nothing happens.  :-( (the switch ID is 0061 I think)

EDIT: also I forgot to ask if you could switch to a new set of sprites when you begin to run. this is because the idea is you hit a switch, you gain the ability to turn into a monster and run dead fast. You press the change into button, and you turn into the monster and can run quickly. you press it again and you change back.
Awwww yeah.

Blizzard

Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.



Get DropBox, the best free file syncing service there is!

Doyora

OK thanks, I think I've got it cracked now... I hadn't realised how you could change your own speed using events... DUH. I will report back my success. Thanks all!

UPDATE: Yep, I got it all working now. It's kind of a strange way to do it, but you 'activate' run mode by using an item. this toggles run mode on/off. It may sound clumsy, but it works well in practice.
Awwww yeah.