UPDATE:poor mans joystick
-
I hate to seach and rewrite code. I am very intrested in this. thanks in advance
-
MAN, please post that file!
-
Oh nothings working for me now
IT had been working. Put your other controllercommands in a safe place before installing.
Does it work for any of you? -
@phy said:
Oh nothings working for me now
IT had been working. Put your other controllercommands in a safe place before installing.
Does it work for any of you?Please, be proud of yourself, you have really outdone yourself! (And it works
) -
Nothing big, but it's a good mod (People can finally stop complaining!!)
After you download this, look at http://sketchup.google.com/3dwarehouse/details?mid=2089b6db29e339096cd8ad826e9017b8 ... it's one of my models that gets MUCH better when you can use the joypad-only features

Oh, and you'll be able to play the normal version of MotorSketch. Not that there's much difference.
-
OK I musta messed something up after I uploaded it I'll keep trying to put more buttons on.
-
Ok guys here's the file. NOTICE lb & rb do not work. the controls: joyRY=8&5, joyRX=4&6, a=7, b=9, x=1, y=3. That's all I got right now.
Put this file in place of "controllercomands" in <plugins><sketchyphysics3>.
CPhillips is it possible to get lb and rb workingEDIT: the buttons a b x y weren't working in the update they do work.
-
Cool! Thanks for doing this. If everyone likes it I will make it part of the next release.
Thanks!
-
Ok I'll soon have all the keys working. start,select, etc.
-
The finished project Ahhhh. controls: joyRY=5&2, joyRX=1&3, a=4, b=7, x=8, y=9, lb=0, rb=6, back=minus(-), start=plus(+), leftb=divide(/), rightb=multiply(*) Woohoo

-
Tell me if something doesn't work right
-
Thanks Phy!! Could you do me one favor. Break out the changes you made so I can update the code. My version has changed so much I am not sure I see all your changes.
Thanks Again!
Chris -
a=(@joystate.rgbButtons[0]/-128)+(key('numpad4')) b=(@joystate.rgbButtons[1]/-128)+(key('numpad7')) x=(@joystate.rgbButtons[2]/-128)+(key('numpad8')) y=(@joystate.rgbButtons[3]/-128)+(key('numpad9'))For the a, b, x, and y keys I just added +key('numpad 4 7 8 9') to the script that was already there.
I used your joy('rightx') script for the joybutton('a b x y lb etc.).
def joybutton(name) name.downcase! deadzone=100 case name when "a" if(@joystate.rgbButtons[0].abs>deadzone) return (@joystate.rgbButtons[0]/-128) else return (getKeyState(VK_NUMPAD4)?1;0.0) end when "b" if(@joystate.rgbButtons[1].abs>deadzone) return (@joystate.rgbButtons[1]/-128) else return (getKeyState(VK_NUMPAD7)?1;0.0) end when "x" if(@joystate.rgbButtons[2].abs>deadzone) return (@joystate.rgbButtons[2]/-128) else return (getKeyState(VK_NUMPAD8)?1;0.0) end when "y" if(@joystate.rgbButtons[3].abs>deadzone) return (@joystate.rgbButtons[3]/-128) else return (getKeyState(VK_NUMPAD9)?1;0.0) end when "lb" if(@joystate.rgbButtons[4].abs>deadzone) return (@joystate.rgbButtons[4]/-128) else return (getKeyState(VK_NUMPAD0)?1;0.0) end when "rb" if(@joystate.rgbButtons[5].abs>deadzone) return (@joystate.rgbButtons[5]/-128) else return (getKeyState(VK_NUMPAD6)?1;0.0) end when "back" if(@joystate.rgbButtons[6].abs>deadzone) return (@joystate.rgbButtons[6]/-128) else return (getKeyState(VK_SUBTRACT)?1;0.0) end when "start" if(@joystate.rgbButtons[7].abs>deadzone) return (@joystate.rgbButtons[7]/-128) else return (getKeyState(VK_ADD)?1;0.0) end when "leftb" if(@joystate.rgbButtons[8].abs>deadzone) return (@joystate.rgbButtons[8]/-128) else return (getKeyState(VK_SEPARATOR)?1;0.0) end when "rightb" if(@joystate.rgbButtons[9].abs>deadzone) return (@joystate.rgbButtons[9]/-128) else return (getKeyState(VK_MULTIPLY)?1;0.0) end end endAnd for joyRX & joyRY I used this.
joyRX=0.5+(getKeyState(VK_NUMPAD3)?0.5;0.0)+(getKeyState(VK_NUMPAD1)?-0.5;0.0) joyRY=0.5+(getKeyState(VK_NUMPAD2)?0.5;0.0)+(getKeyState(VK_NUMPAD5)?-0.5;0.0)There's probably some bad scripting in there somewhere.
-
I have added numpad support on the newest version for joystick. The file is in the first post.
I think you can use a joy stick with the file too. Can one of you guys that have a joystick confirm that for me?
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register LoginAdvertisement