sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Emitters...

    Scheduled Pinned Locked Moved SketchyPhysics
    5 Posts 3 Posters 726 Views 3 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.
    • N Offline
      Naththagr8
      last edited by

      Hi, naththagr8 here. I'm working with emitters (they emit when I press a key). And I'm wondering if there is a way to have them emit only once when I press the key. I don't want to change the rate because i may want to press they key quickly. Currently I'm doing: (0.0-key("e"))*-80
      Also, is there a way to delay a emitter? Like, I press the key and one second later it starts emitting.

      Naththagr8
      Top Headlines: "Beverly Hills 90210, Cleveland Browns 3"

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

        I made a script a while ago; it toggles a variable, but the main thing is it detects single key presses. This should do it:

        
        if frame==1;setVar("repeat",0);end;if key("e")==0;setVar("repeat",1);0;elsif getVar("repeat")==0;0;else;setVar("repeat",0);80;end;
        
        

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

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

          Thanks a lot. It's just what I needed. One problem.... It seems that I can only have one of those codes turned on in the model. I need 15 on. When I have five objects with that code turned on (each with their different key changed from "e" (q,w,e,r,t)) they emit constantly when I hold the key. I'm using the keys q-p, a-l, c-n,space. I'm working on my rock band model if you haven't figured it out. I'm putting the code in "strength" if that means anything.

          Naththagr8
          Top Headlines: "Beverly Hills 90210, Cleveland Browns 3"

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

            @naththagr8 said:

            Thanks a lot. It's just what I needed. One problem.... It seems that I can only have one of those codes turned on in the model. I need 15 on. When I have five objects with that code turned on (each with their different key changed from "e" (q,w,e,r,t)) they emit constantly when I hold the key. I'm using the keys q-p, a-l, c-n,space. I'm working on my rock band model if you haven't figured it out. I'm putting the code in "strength" if that means anything.

            if your going to have fifteen different toggle scripts in your model, you'll need to give the setVars and getVars a different name. example:

            if frame==1;setVar("rep",0);end;if key("o")==0;setVar("rep",1);0;elsif getVar("rep")==0;0;else;setVar("rep",0);80;end;
            

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

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

              That worked. thanks! i just want to know the last part of my original post:
              @unknownuser said:

              Also, is there a way to delay a emitter? Like, I press the key and [so many frames] later it starts emitting.
              I'm using the same code: (0.0-key("e"))*-80
              rate:1

              I suppose there's no way to keep emitted objects going on a straight line at the same speed?

              Naththagr8
              Top Headlines: "Beverly Hills 90210, Cleveland Browns 3"

              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