• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Setting up multiple moves?

J

JinNJuice

Guest
I'm making a sort of fighting game where the players can choose which moves to assign to their controls. Most of these moves have two functions; quick attack and charge heavy. The problem I'm facing is getting a button to do different moves from pressing or releasing.

Currently, I have it set up where buttons can be remapped, so button presses have control variable names linked to them. Afterwards, moves set in scripts can be designated to each control button.

So for instance, when the game first loads, there's a basic .ini file that defines and sets the variables and values related to controls, such as up, down, left, right, A, B, and C. Then the players can set moves to A, B, or C, then choose the stage.

How would I go about getting one button to do a different move in the script according to how long it is pressed down?
 

obscene

Member
Just an idea... could need a lot of changes based on your own code... and it's always best to post your own code so people know how best to approach it...

Code:
// If holding button
if punch_button_held
  {
  // Maximum punch if player keeps holding
  if punch_counter> 10 scr_punch_hard();
  else punch_counter++
  }
else
  {
  // Medium punch if player held for 5 steps
  if punch_counter>5 scr_punch_medium();

  // Light punch if tapped
  else if punch_counter>0 scr_punch_light();

  // Reset counter
  punch_counter=0;
  }
 
Top