Spawning object that dissapear

About advanced scenes, and the Thyme scripting language used in Algodoo.

Spawning object that dissapear

Postby ArmoredDice » Sat Jun 19, 2010 5:46 pm

hello, I just wanted to quickly ask if anyone can help me out in a script that would spawn an object that dissapears after a second or so. I am working on some thrusters, I already have some that I like and that work well, but they use water and the water is too large for my liking. I am looking for a square that is 1by1 /72 of a meter where as a water particle is 4by4 /72. I have a very simple thruster that spawns water on lazer hit.

Some other qualities of the particle that I require is no friction and a very low weight. :)
ArmoredDice
 
Posts: 3
Joined: Sat Jun 19, 2010 5:35 pm

Re: Spawning object that dissapear

Postby Rideg » Sun Jun 20, 2010 3:03 am

Do you want to spawn an objevt that collides with something cuz then I can make something for you

Are you using Algodoo or Phun?
Image
make sure to check out my work.
User avatar
Rideg
 
Posts: 948
Joined: Tue Dec 15, 2009 5:17 pm
Location: Östersund, Sweden

Re: Spawning object that dissapear

Postby ArmoredDice » Mon Jun 21, 2010 4:32 pm

:) I want the object to collide with only G, I am using Algodoo :) that sounds fantastic thank you.
ArmoredDice
 
Posts: 3
Joined: Sat Jun 19, 2010 5:35 pm

Re: Spawning object that dissapear

Postby Rideg » Mon Jun 21, 2010 6:31 pm

well does it collide Immediatly after it spawns?
Image
make sure to check out my work.
User avatar
Rideg
 
Posts: 948
Joined: Tue Dec 15, 2009 5:17 pm
Location: Östersund, Sweden

Re: Spawning object that dissapear

Postby Rideg » Mon Jun 21, 2010 6:45 pm

Code: Select all
(e)=>{
    Scene.addCircle({
        color := [0.0, 0.0, 0.0, 0.99];
        controllerAcc := sim.time + 1;
        onHitByLaser := (e)=>{
            e.geom.density = {sim.time >= controllerAcc ? {0.0} : {2.0}};
            e.laser.onHitByLaser = (e)=>{}
        };
        collideSet := 64;
        geomID := 1;
        pos := e.pos;
        radius := 0.25
    });
    Scene.addLaserPen({
        geom := 1;
        relPoint := [0.0, 0.0];
        size := 0.025;
        maxRays := 1;
        collideSet := 127;
        rotation := -3.1415927
    })
}
This will work! ;)
Image
make sure to check out my work.
User avatar
Rideg
 
Posts: 948
Joined: Tue Dec 15, 2009 5:17 pm
Location: Östersund, Sweden

Re: Spawning object that dissapear

Postby ArmoredDice » Mon Jun 21, 2010 8:59 pm

Thank you :)

Just one more question, where do I paste it too? So far I only been using very very basic Thyme scripting.
ArmoredDice
 
Posts: 3
Joined: Sat Jun 19, 2010 5:35 pm

Re: Spawning object that dissapear

Postby Rideg » Mon Jun 21, 2010 11:31 pm

Well If you're triggering this by making a laser hit a box then paste it in the box's onHitByLaser ;)
Image
make sure to check out my work.
User avatar
Rideg
 
Posts: 948
Joined: Tue Dec 15, 2009 5:17 pm
Location: Östersund, Sweden


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 2 guests