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!
    Mac User? | Join the Rayscaper Beta for Mac Learn More

    Coding Field

    Scheduled Pinned Locked Moved SketchyPhysics
    9 Posts 4 Posters 1.1k Views 4 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.
    • P
      Physicsguy1
      last edited by

      Can there be another field that won't have to function on a certain event? i ran into this when i was building an arm, which had a receiver that calculated and processed everything, but the ontouch and ontick fields require an event to trigger them. Can there be a simple field for code like: if getVar('sens')==1 then setVar('claw',0.6);end
      if a==1 then setVar('claw',0);end?

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

        ...ontick does it fine, but there can't be 2 ends, one should be elsif.

        1 Reply Last reply
        Reply Quote 0
        • W
          Wacov
          last edited by

          Actually there can be as many ends as you want. But in this case, there could be a conflict, so you may as well use elsif. Also, onTick works fine and doesn't need an event to trigger it; it's a 'frame' event, occuring every frame or every rate frame. Next version there should be global script, which'd be perfect for this.

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

          1 Reply Last reply
          Reply Quote 0
          • M
            MrPlanet
            last edited by

            if getVar('sens')==1 then setVar('claw',0.6);elseif joybutton("a")==1 then setVar("claw",0);end;
            

            I reject your reality and substitute my own.

            1 Reply Last reply
            Reply Quote 0
            • M
              MrPlanet
              last edited by

              I think thats it...

              I reject your reality and substitute my own.

              1 Reply Last reply
              Reply Quote 0
              • W
                Wacov
                last edited by

                You don't need the first 'then'... but yeah

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

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

                  the second time you use setVar("claw"), should be getSetVar.

                  1 Reply Last reply
                  Reply Quote 0
                  • W
                    Wacov
                    last edited by

                    If it's going in onTick, what's the point?

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

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

                      yeah, you're right πŸ˜†

                      1 Reply Last reply
                      Reply Quote 0

                      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 Login
                      • 1 / 1
                      • First post
                        Last post
                      Buy SketchPlus
                      Buy SUbD
                      Buy WrapR
                      Buy eBook
                      Buy Modelur
                      Buy Vertex Tools
                      Buy SketchCuisine
                      Buy FormFonts

                      Advertisement