The Daily Click ::. Forums ::. Klik Coding Help ::. Control - X problems
 

Post Reply  Post Oekaki 
 

Posted By Message

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
8th June, 2006 at 14:40:14 -

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.

 
n/a

Werbad



Registered
  18/09/2002
Points
  235
8th June, 2006 at 15:55:47 -

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

 
n/a

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
8th June, 2006 at 16:57:51 -

Tried that and it still reverts back to 0. My source code is at:

http://www.geocities.com/lembi2001/Engines/keymap.zip

Image Edited by the Author.

 
n/a

Fifth

Quadruped

Registered
  07/05/2003
Points
  5815

VIP MemberGOTW JULY 2010 WINNER!Kliktober Special Award TagGOTW HALLOWEEN 2011 WINNERPicture Me This Round 51 Winner!
8th June, 2006 at 17:57:52 -

Alright, I think I got it.

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.



 
Go Moon!

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
8th June, 2006 at 18:14:32 -

Fifth you are a genius!! it works! thank you!!!!!! Now is there a way to get an extra fire button or not?

Image Edited by the Author.

 
n/a

Fifth

Quadruped

Registered
  07/05/2003
Points
  5815

VIP MemberGOTW JULY 2010 WINNER!Kliktober Special Award TagGOTW HALLOWEEN 2011 WINNERPicture Me This Round 51 Winner!
8th June, 2006 at 18:26:26 -

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.

 
Go Moon!

Werbad



Registered
  18/09/2002
Points
  235
9th June, 2006 at 07:22:17 -

Reversing the orer is what i meant... Sorry if I wasn't cleara enougth

 
n/a

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
9th June, 2006 at 08:05:56 -

Werbad you are a genius aswel it's just that i am stupid and have only just noticed that what you put is the same thing as fifth.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click