sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    ⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update

    UPDATE:poor mans joystick

    Scheduled Pinned Locked Moved SketchyPhysics
    16 Posts 6 Posters 2.9k Views 6 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • W Offline
      Wacov
      last edited by

      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.

      http://sketchup.google.com/3dwarehouse/cldetails?mid=3096a836877fb9af6cd8ad826e9017b8&prevstart=0

      1 Reply Last reply Reply Quote 0
      • P Offline
        phy
        last edited by

        OK I musta messed something up after I uploaded it I'll keep trying to put more buttons on.

        Tableau de comparaison de Staxyn s'agit d'un mГ©dicament uniquement sur ordonnance.

        1 Reply Last reply Reply Quote 0
        • P Offline
          phy
          last edited by

          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 working

          EDIT: the buttons a b x y weren't working in the update they do work.


          ControllerCommands.rb

          Tableau de comparaison de Staxyn s'agit d'un mГ©dicament uniquement sur ordonnance.

          1 Reply Last reply Reply Quote 0
          • C Offline
            CPhillips
            last edited by

            Cool! Thanks for doing this. If everyone likes it I will make it part of the next release.

            Thanks!

            1 Reply Last reply Reply Quote 0
            • P Offline
              phy
              last edited by

              Ok I'll soon have all the keys working. start,select, etc.

              Tableau de comparaison de Staxyn s'agit d'un mГ©dicament uniquement sur ordonnance.

              1 Reply Last reply Reply Quote 0
              • P Offline
                phy
                last edited by

                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 😍


                ControllerCommands.rb

                Tableau de comparaison de Staxyn s'agit d'un mГ©dicament uniquement sur ordonnance.

                1 Reply Last reply Reply Quote 0
                • P Offline
                  phy
                  last edited by

                  Tell me if something doesn't work right

                  Tableau de comparaison de Staxyn s'agit d'un mГ©dicament uniquement sur ordonnance.

                  1 Reply Last reply Reply Quote 0
                  • C Offline
                    CPhillips
                    last edited by

                    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

                    1 Reply Last reply Reply Quote 0
                    • P Offline
                      phy
                      last edited by

                              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
                          end  
                      

                      And 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.

                      Tableau de comparaison de Staxyn s'agit d'un mГ©dicament uniquement sur ordonnance.

                      1 Reply Last reply Reply Quote 0
                      • P Offline
                        phy
                        last edited by

                        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?

                        Tableau de comparaison de Staxyn s'agit d'un mГ©dicament uniquement sur ordonnance.

                        1 Reply Last reply Reply Quote 0
                        • 1 / 1
                        • First post
                          Last post
                        Buy SketchPlus
                        Buy SUbD
                        Buy WrapR
                        Buy eBook
                        Buy Modelur
                        Buy Vertex Tools
                        Buy SketchCuisine
                        Buy FormFonts

                        Advertisement