Control X grief - Perplexed by something?
Maybe i've got the wrong end of what this feature of control x is, but, if I haven't, could someone point me in the right direction?
Basically, I want my game to have customisable controls inside the app, (classier :P), and control X is great for doing this. That's not the problem i'm having.
I also want the app to have the option of Joystick controls, and I figured the easiest way to do this was to simulate the keypress.
Therein lies the problem. Have I got "Key Down" incorrect?
The event for movement is something like this:
Code:
Condition: (Control X) - Key value LEFTBUTTON is pressed.:
Movement coding.
And i've been trying to get the joystick to simulate the keystroke like this:
Code:
Condition: (Joystick) - Direction of joystick is 4 (left):
(Control X) - Key Value LEFTBUTTON is held down.
Have I done something wrong here? :confused:
For the record, the "Condition: (Control X) - Key value LEFTBUTTON is pressed." is used ALOT during the coding. It's alot of hassle to copy every event and change that to the Joystick coding.
And i've tried using hte OR function, but that doesn't seem to want to work either.
EDIT: LEFTBUTTON is a global value thats loaded when the app is loaded from an ini file..
Re: Control X grief - Perplexed by something?
I would do it like this instead (just an idea, pseudo code):
Where you customize the controls
Any button pressed
-Set player up/down/left/right (GetLastKeyPressed())
And then use the condition:
Player 1 moved top/bottom/left/right
-Your action
Or you could do like this:
CtrlX Key LEFTBUTTON pressed
OR
Joystick dir is 4
(I tried it and it works..)
Re: Control X grief - Perplexed by something?
Interpreting the direction controls through Control-X is something that stuck me for a while too, because they're interpreted in a different way depending on whether you're using a joystick (separate direction control) or keyboard (keys like the triggers).
To get around this, I use four alterable values in a separate object like flags to indicate which directions are being pressed on the joystick (direction 0 is "right" only, direction 1 is "right" and "up" together, and so on), then I check against that object's alterable values (with an OR in the events that look at the directional controls) in place of checking for joystick directions directly.
Re: Control X grief - Perplexed by something?
very lateral thinking, nice... however it would nice if they just resolved the problem.