Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Fire X button, i don't understand a thing about it!

Author
Message
DidRocks
23
Years of Service
User Offline
Joined: 28th May 2003
Location: France
Posted: 30th Jul 2003 16:08
To save the joystick's configuration, i thought using the value in argument (called hier ABC) of the command "joystick fire X(ABC)"
for example:
if i register the fire button X number 25, then i register in a file "25" for one action (walk, run, ...)
So, i saw the example given with dbpro and i tested it with a friend, whose joystick have just one fire button X.
I have added one line:
print "value of the x argument: ";FireButtonValueID

Otherwise, this value is always changing at each loading. It's totally logique because of the line:
FireButtonValueID=rnd(31)

so, the code for the button X is the following:

FireButtonValueID=rnd(31)
print " firex:";JOYSTICK FIRE X(FireButtonValueID)
print "value of the x argument: ";FireButtonValueID

What i don't understand: it seems to me that it's us who definied the argument of one X button (the number associated with it) because of this code. But how can i do with serveral button X?
I think something miss me. Thanks to enlight me!

PS: sorry for my english ...
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 30th Jul 2003 16:16
The fire buttons are already 'registered'.

Use number zero for the first button, number 1 for the second button, number 2 for the third button ...
DidRocks
23
Years of Service
User Offline
Joined: 28th May 2003
Location: France
Posted: 30th Jul 2003 16:23
But why when i load several this example with the same joystick. The value of the first X button is always changing?
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 30th Jul 2003 20:15
This is straight from the built-in help system:

Return Integer=JOYSTICK FIRE X(Button Number)


Try this:



Run it, then press buttons on your joystick. I've only coded for it to loop to 30, otherwise it scrolls the first value off the top of the display.

Login to post a reply

Server time is: 2026-07-21 21:13:18
Your offset time is: 2026-07-21 21:13:18