Author Topic: Hold Shift to Run  (Read 2400 times)

Offline G_G

  • Green Gmod Game_Guy AKA G4 AKA hyper-G AKA G-force
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 6591
  • LV: 407
  • Gender: Male
    • View Profile
Hold Shift to Run
« on: August 13, 2008, 10:47:34 PM »
Ok this was an easy tutorial and thoughtI'd share it. On the Map or in Common events make the event parallel and enter this

Loop
Label 1
Wait 1 Frame
Branch if A Button is Held
 Branch if Var[xxxx:Run] = 0
   Move Event Player:Set Speed 5
   VarOper:[xxxx:Run] set = 0
   Jump to Label 1
  Else
   Jump to Label 1
 End
Else
 Branch if Var[xxxx:Run] = 1
   Move Event Player:Set Speed 4
   VarOper[xxxx:Run] set = 0
   Jump to Label 1
 Else
   Jump to Label 1
 End
End

I don't know if alot of you know this but I decided to post anyways as my first post! :)

Offline DeathLock

  • Astral Trancist
  • *****
  • Posts: 586
  • LV: 53
  • Gender: Male
    • View Profile
Re: Hold Shift to Run
« Reply #1 on: August 13, 2008, 11:02:49 PM »
This isn't much of a tutorial, if you just post a the event code instead of instructions.

But, its too simple. Oh well, welcome to forum.


Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20016
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: Hold Shift to Run
« Reply #2 on: August 13, 2008, 11:05:42 PM »
Nice. But I suggest that you avoid using the loop command in a parallel process since parallel process already gets executed over and over. This code would work better. :)

Code: [Select]
Branch if A Button is Held
  Move Event Player:Set Speed 5
Else
  Move Event Player:Set Speed 4
End

Of course this should be disabled when making cutscenes where the player speed is changed.
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline G_G

  • Green Gmod Game_Guy AKA G4 AKA hyper-G AKA G-force
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 6591
  • LV: 407
  • Gender: Male
    • View Profile
Re: Hold Shift to Run
« Reply #3 on: August 13, 2008, 11:06:17 PM »
I guess you're right and thank you. I will start posting some detailed instructions and what each command does next time.

Offline Sally

  • Sallygirl :P
  • Chaos User
  • ******
  • Posts: 1283
  • LV: 12
  • Gender: Female
    • View Profile
Re: Hold Shift to Run
« Reply #4 on: August 15, 2008, 03:53:57 PM »
Of course this should be disabled when making cutscenes where the player speed is changed.

just put that code in common events and during cutscenes take the switch off. then put it back on after :P

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20016
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: Hold Shift to Run
« Reply #5 on: August 15, 2008, 04:25:42 PM »
That was what I meant. ^_^
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Sally

  • Sallygirl :P
  • Chaos User
  • ******
  • Posts: 1283
  • LV: 12
  • Gender: Female
    • View Profile
Re: Hold Shift to Run
« Reply #6 on: August 16, 2008, 02:38:04 AM »
oh, :P didnt know.