Main Menu
  • Welcome to The RPG Maker Resource Kit.

Key Item + Running [2k3]

Started by Xenomic, December 27, 2010, 09:11:30 AM

0 Members and 1 Guest are viewing this topic.

Xenomic

I know, title is vague but couldn't think of a better one....

So, I was reading some tutorials, and someone suggested me to make a key item that'll let you run faster if you hold a button, much like in the Pokemon games. Thing is, I'm not exactly sure on how to code this. Like....you can walk normally when you have said item, but by holding like say....B....you'll run double speed....kinda like Sprint Shoes, but not equipped.

OngekibouRekka

Common Event (Trigger: Parallel Process)

Branch if Switch [0001] is OFF
Key Input Processing: Var [0001] (Set to "Equal to 7", untick "Wait until key pressed")
Branch if Var [0001] is 7
  Move Event: Hero, Increase Move Speed, Change Graphic
  Wait 0.2 Sec
  Switch [0001] ON
End
End

Branch if Switch [0001] is ON
Key Input Processing: Var [0001] (Set to "Not 7", untick "Wait until key pressed")
Branch if Var [0001] is 7 Not
  Move Event: Hero, Decrease Move Speed, Change Graphic
  Wait 0.2 Sec
  Switch [0001] ON
End
End

If you're increasing and decreasing speed more than what I've shown, remember its a 0.1 Sec wait for each additional movement.

If you want it to trigger only when a certain item is equipped, encase the first part in a "Conditional Branch: HERO equipped with Speed Item". If you want it to work for all heroes, add an else, and put in a "Conditional Branch: HERO2 equipped with Speed Item". If you want to

Probably a neater way, but that should work anyway. Coincidentally, I'm making a Pokémon game. Go figure.

RikaPSO

Quote from: OngekibouRekka on August 30, 2011, 09:11:59 PM
Common Event (Trigger: Parallel Process)

Branch if Switch [0001] is OFF
Key Input Processing: Var [0001] (Set to "Equal to 7", untick "Wait until key pressed")
Branch if Var [0001] is 7
  Move Event: Hero, Increase Move Speed, Change Graphic
  Wait 0.2 Sec
  Switch [0001] ON
End
End

Branch if Switch [0001] is ON
Key Input Processing: Var [0001] (Set to "Not 7", untick "Wait until key pressed")
Branch if Var [0001] is 7 Not
  Move Event: Hero, Decrease Move Speed, Change Graphic
  Wait 0.2 Sec
  Switch [0001] ON
End
End

If you're increasing and decreasing speed more than what I've shown, remember its a 0.1 Sec wait for each additional movement.

If you want it to trigger only when a certain item is equipped, encase the first part in a "Conditional Branch: HERO equipped with Speed Item". If you want it to work for all heroes, add an else, and put in a "Conditional Branch: HERO2 equipped with Speed Item". If you want to

Probably a neater way, but that should work anyway. Coincidentally, I'm making a Pokémon game. Go figure.

Wow, I was never able to figure this out when I tried it myself for my own projects. It always managed to skip itself and go way slower or way faster depending on how often I hit the button. I guess the wait prevents that? o.O

OngekibouRekka

It does, but the whole thing is a pain in the butt. A lot of the time it just decides "hey, I'm gonna screw up".

Xenomic

I remember a friend of mine implementing a run system in his game. There were times when if you mashed the run button (I tested this to see what would happen), it would perma-force you to run faster by a certain speed, and other times, it ends up making you move super slow. @_@