i'm using control x to set definable keys but after a good couple of hours playing with this extension i am stuck. I want the user to be able to press the desired key after a prompt until all keys are mapped the way they want them. This however is not working.
I have setup my prompts as a string with diff. paragraphs and i have got a counter visible on screen (for now) just to help me.
example code:
+Button "Configure" is pressed
+Counter=0
-Make Button "Configure" Invisible
-Disable Button "Configure"
-Set Counter to 1
-Reset Last Key pressed "controlx"
+Upon pressing any key
+Counter=1
-Set Player 1 up to Last Key Pressed "Controlx"
-Display Next Paragraph
-Set counter to 2
and so on right through to set counter to 6
however when i press the config button it displays the first prompt waits for input then resets the counter to 0 as per the final event in event editor which is:
+Upon pressing any key
+Counter=6
-Set Player 1 Fire Two to Last Key Pressed "Controlx"
-Display Paragraph 1
-Set counter to 0
-Make Button "Configure" Visible again
-Enable Button "Configure"
Please tell me what i am doing wrong. if you want me to i will host my source code for you to look at.
First of all you should use Control X's Any key pressed for the best result...
Make sure that the events are in descending order
example:
+Upon pressing any key
+Counter=6
-Set Player 1 Fire Two to Last Key Pressed "Controlx"
-Display Paragraph 1
-Set counter to 0
-Make Button "Configure" Visible again
-Enable Button "Configure"
+Upon pressing any key
+Counter=5
-Set Player 1 Fire One to Last Key Pressed "Controlx"
-Display Next Paragraph
-Set counter to 6
...
+Upon pressing any key
+Counter=1
-Set Player 1 up to Last Key Pressed "Controlx"
-Display Next Paragraph
-Set counter to 2
If you put the events the other way, all events will run the same loop...
Hope this helps
It's running through the process successfully, but it's doing it all on one game loop. Thus, all 6 keys are set to whatever button you first press. The simplest way to fix this would be to reverse the order of your counter-numbered events, so it's like this:
any key is down and counter=6 ...
any key is down and counter=5 ...
any key is down and counter=4 ...
any key is down and counter=3 ...
any key is down and counter=2 ...
any key is down and counter=1 ...
button is clicked and counter=0 ...
The other issue is that the changed controls don't display in the edit boxes.
This is because, for some reason, GetUp$( "Control X", 1 ) actually refers to player TWO's controls. Just set them to display like GetUp$( "Control X", 0 ) and you should be fine.
Just use player 2's controls as well. Unless you're making a 4-player game, it really won't matter if you borrow a couple extra buttons from the unused players.