sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    SketchyPhysics 4?

    Scheduled Pinned Locked Moved SketchyPhysics
    18 Posts 7 Posters 12.9k 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.
    • D Offline
      darkPhysics
      last edited by

      I downloaded SP3X June25 (http://sketchyphysics2.googlecode.com/files/SetupSketchyPhysics3x-Jun25.exe) and on Sketchup's startup i get this error:

      Error Loading File sketchyphysics.rb
      No such file to load -- SketchyPhysics4/SketchyPhysics4.rb
      

      but then everything goes normal, and I see new features like density,but i cant find destroy function and some other outlined in topic "Working on a new scripting system".

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

        I havent released it yet because I found that problem and I need to write some release notes.

        The "scripted" field is totally different from the other scripted fields. Command that work in there will not work in Controller (for example) and visa-versa.

        Try this in the Scripted field

        
        onclick{
           destroy
        }
        
        

        The body will be destroyed when you click it.

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

          Chris, did you use my idea for destroying objects? Or had you thought of that before I said it 😆

          BTW, I'm having a big problem with the events. Entering the script for the event even slightly wrong wrecks SP (I can't start the simulation 😕 ), and I have to restart SU to get anything to work again. Other than that, teleporting short distances every frame causes the object to ignore gravity and collisions, which is slightly wierd, but probably unfixable 😞

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

          1 Reply Last reply Reply Quote 0
          • J Offline
            JaViXP
            last edited by

            I am having problems too. I tried to copy your code, this one:

            #At sim start hide the object
            setEvent("onstart"){hidden=true}
            
               #When an object touches me...
            setEvent("ontouch"){|toucher|
               #if the object that touched me is named "box
              if toucher.name=="box"
                 #unhide and become solid
                hidden=false
                nocollision=false
              end
            }
            
              #unhide group at end of sim
            setEvent("onend"){hidden=false}
            

            in the Scripter field, when I hit "play" I can't do anything with the box that has the script. When I hit "reset" it displays an error.


            Error

            "Giving up is way harder than trying"
            JaViXP's Rendering

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

              CPhillips does not have "$curEvalGroup" quite embedded yet. At one point I got this working but I can't right now.

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

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

                There is another problem with it also. It is vastly slower than the current version. So slow that I reverted back...

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

                  I haven't had that much trouble with it being slow it acts just like the previous one.

                  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

                    I think I had the idea before but I am not sure. The hard part was the plumbing around it.

                    $curEvalGroup isnt used anymore. Instead just use "group".

                    The code in the old scripting thread is obsolete. Here is almost the same thing:

                    onstart{
                       group.hidden=true
                       @unhideAtEnd=true
                       solid=false
                    }
                    ontouch{|toucher,speed,pos|
                       if(toucher.name=="sphere")
                          group.hidden=false
                          solid=true
                       end
                    }
                    

                    I dont know any reason this version would be slower than the last.

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

                      Chris, shouldn't the scripting window have error checking? It lets me stick any old junk into it, tries to run it, and breaks the model forever. Basically, it's trial and error, making a new model every time my code's wrong 😞

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

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

                        It will eventually. Right now this is just a work in progress release.

                        Unless you get into a loop you should be able to reset and get back to the start no matter what errors.

                        If you do find a piece of script that permanently breaks a model post it here.

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

                          Ah, I think I see the problem with bad scripts "breaking" the model. I'll fix it.

                          Hitting reset or a bunch of undo's might allow you to get back to start.

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

                            Well, when it comes to big models where a line-less and shaded-only style has to be used, it is terrible compared to the current. I know for sure because I was playing with a fast battleship game, which slowed down to about a frame PER second once I downloaded the latest version.

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

                              Thanks Chris 👍
                              It happens with anything except perfect script 😞

                              I don't have the slowdown problem, that's wierd...

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

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

                                I'll try again.

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

                                  If you open the ruby console it will print performance statistics after each run. If you find a model that is much slower post a link and I'll take a looks.

                                  1 Reply Last reply Reply Quote 0
                                  • J Offline
                                    JaViXP
                                    last edited by

                                    I've downloaded the June 25 version and I noticed a little "error". When you hit the press button there's a quote ( " ) in the SketchyPhysics Control Panel 😉

                                    "Giving up is way harder than trying"
                                    JaViXP's Rendering

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

                                      Thanks. I fixed it.

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

                                        Hello, when will the new version? which works in the SU Make 2013?

                                        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