Posted By
|
Message
|
William Bernting
Registered 26/06/2004
Points 2
|
8th August, 2005 at 10:28:18 -
hey guys, look I have this huge problem I cannot avoid, u can call me n00b if you like I don't care, been working with mmf/tgf/knp for about 4½ years, but I'm oldschool so please help me out here will ya?
See, I want this Edit text thingie to say the latest button pressed, and I ran into this problem which later on interfered with many of the events/commands related to the Extension.
when I import the "latest button pressed" from Joypad Object to the expression thing in edit text object, it looks like this:
LastButtonPressed( "Joypad object", > Enter value here < )
What do they mean with "Enter Value Here"? Of course I know it wants you to input a text or something like all other event things with this, but this one wont allow anything!! Things ive tried and result:
LastButtonPressed( "Joypad object", 1 ) = Please Enter an Alphanumeric Expression
LastButtonPressed( "Joypad object", d ) = Syntax Error
LastButtonPressed( "Joypad object", "d" ) = Mixed Strings and Numbers
LastButtonPressed( "Joypad object" ) = Syntax Error
LastButtonPressed( "Joypad object", Edittext$( "Edit" )) = Mixed Strings and Numbers
What the hell should I do???
Thanks in advance!
Don't Drink and Drive, Smoke and Fly!
|
DeadmanDines Best Article Writer
Registered 27/04/2006
Points 4758
|
8th August, 2005 at 11:01:13 -
Hmm.
I've never used Joypad Object, but Edittext wants a string value. String values always have a $ at the end (eg: left$(), mid$(), hex$(), str$(), etc). Since LastButtonPressed() has no $, it must return a number not text.
Try this:
str$(LastButtonPressed( "Joypad object", 1 ))
It sounds like the 'value' field is the player number (in case you have more than one joypad installed).
Each button on the pad will have an ID number.
This function doesn't say: "Up" when you press up, I think it says "42" (or whatever the 'up' ID is).
So you need to try that and run some tests. Press each key and make a note of what number it gives you.
Hope this helps
191 / 9999 * 7 + 191 * 7
|
William Bernting
Registered 26/06/2004
Points 2
|
8th August, 2005 at 12:14:38 -
omfg you did it! If I only would have figured this out myself, I feel tired x_x
Anyway, great job man you saved an oldschooler
Don't Drink and Drive, Smoke and Fly!
|
|
|