Is there a way you can set somthing to happen based on pressing two buttons at the same time.
For example, ctrl / (fire button 2) is attack, and shift / (fire button 1) is jump.
I want to be able to do somthing different if they are both pressed at the same time, but it also needs to be joystick and keyboard compatible, is there a way to do it?
The problem you are experiencing is most likely that you have events tied to both hitting "CTRL" and "SHIFT"; so whenever one of them is pressed, it will attack or jump. The problem then is that when someone tries to hit two keys at the same time, 99% of the time one of the keys will be pressed down before the other one. Then the game will interpret it in order of what was hit.
So for example, if you mash the A & S buttons really fast, you'll most often type AS, not SA. This means that by nature one of the keys must go down first. If you want CTRL + SHIFT to have a completely different use then CTRL or SHIFT on their own, what you need to do is time delay your events;
For example, trigger it so that you will not attack IMMEDIATELY after hitting CTRL, but rather while holding control, a counter is added up to say 4 or 5, and when it reachs that number, it counts it as hitting control.
For example:
+While Control is Pressed
Add one to A
+If A >= 5
Set Flag 0 On
+Flag 0 is on
Play Attack Animation
You'll need to play around with the numbers. If you set the delay too high, the controls will feel slippery. If you set it too low, it will register alot of false positives
Originally Posted by Peblo If you have the 'two button at once' code above the other two button code, then it should register first.
That seemed to fix the problem
Thanks everyone for the help.
Now... the next problem is when pressing the two button together, due to it being repeat while button is pressed the sound effect goes all horrible (repeats).