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!
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download

    SP3 Useful controller scripts

    Scheduled Pinned Locked Moved SketchyPhysics
    15 Posts 7 Posters 2.4k Views 7 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.
    • C Offline
      CPhillips
      last edited by

      rightx-0.5
      

      For keyboard right/left

      1 Reply Last reply Reply Quote 0
      • B Offline
        BTM
        last edited by

        Any chance a guide or tutorial will be made to explain how to use these codes? It doesn't seem like something you could just pick up and figure out in a few minutes. Oh, and what do you type in the box to duplicate the object connected to the joint, like in the preview video?

        Oh, and to make thrusters/magnets controllable:

        (0.5-righty)*100000

        0.5-: not necessary, but allows reverse directions. 0.8- would make it go 80%forward, 0.5- makes it half and half, so neutral means no thrust, and 0.2- would make it go 20% forwards.

        right: right or left, which joystick to use/ wasd or arrow keys.

        y: x or y, left and right, or up and down.

        *100000: a *, and the strength of the thruster/magnet.

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

          Will the beta version have the copy function?

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

            I just figured out how to make the copy function work. Its now called Emitters and it will be in next version.

            1 Reply Last reply Reply Quote 0
            • B Offline
              BTM
              last edited by

              do you know what controller scripts are used to make a keyboard key do an action
              (like the spacebar, or letters other than WAS and D),
              or for a slider to multiply an object like in the pre-release video?

              Also, do you know why the script

              (lefty-0.5)*300+slider('hover')*150
              

              won't work in a thruster controller box? without the '-0.5', it seems to work, but I can't get it to do what I'm trying to.

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

                @unknownuser said:

                do you know what controller scripts are used to make a keyboard key do an action
                (like the spacebar, or letters other than WAS and D),
                or for a slider to multiply an object like in the pre-release video?

                Also, do you know why the script

                (lefty-0.5)*300+slider('hover')*150
                

                won't work in a thruster controller box? without the '-0.5', it seems to work, but I can't get it to do what I'm trying to.

                that worked fine for me though the controls were switched so I did this

                -(lefty-0.5)*300+slider('hover')*150
                

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

                1 Reply Last reply Reply Quote 0
                • N Offline
                  nosam55
                  last edited by

                  how do you make a motor controled by the arrow keys and have reverse?

                  1 Reply Last reply Reply Quote 0
                  • B Offline
                    BTM
                    last edited by

                    righty-0.5

                    righty-0.5

                    right: controlled by right joystick, or keyboard arrow keys. left would be left joystick, or WASD keys.

                    y: y= up and down. x=left and right.

                    -0.5: makes .5 of the speed going backwards, in other words, allows reverse. you could also put 0.5- before righty, if the motor is going in the wrong direction.

                    Oh, and Phy, thanks; but for me, only half the controls were reversed: I managed to fix it after though.

                    1 Reply Last reply Reply Quote 0
                    • N Offline
                      nosam55
                      last edited by

                      Thanks 😄

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

                        @unknownuser said:

                        do you know what controller scripts are used to make a keyboard key do an action
                        (like the spacebar, or letters other than WAS and D),
                        or for a slider to multiply an object like in the pre-release video?

                        Also, do you know why the script

                        (lefty-0.5)*300+slider('hover')*150
                        

                        won't work in a thruster controller box? without the '-0.5', it seems to work, but I can't get it to do what I'm trying to.

                        Not yet. But I think I am going to add something like

                        key("space") or key("1")

                        Mulitply an object will be the new emitters.

                        Your script should work as far as I can tell.

                        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