kill object with thyme ?

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

kill object with thyme ?

Postby pixartist » Mon Feb 01, 2010 7:30 pm

how to do it? density = NaN bugs my scene, even when is set collideSet = 0 before killing it...
Image
pixartist
 
Posts: 65
Joined: Wed Sep 02, 2009 5:30 pm

Re: kill object with thyme ?

Postby standardtoaster » Mon Feb 01, 2010 7:44 pm

Spawn a very small circle with a radius of 0.001 with an onCollide of e.this.killer = true; e.other.killer = true.
Code: Select all
Scene.addCircle({pos := e.pos; radius := 0.001; onCollide := (e)=>{e.this.killer = true; e.other.killer = true}})
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: kill object with thyme ?

Postby pixartist » Mon Feb 01, 2010 9:48 pm

standardtoaster wrote:Spawn a very small circle with a radius of 0.001 with an onCollide of e.this.killer = true; e.other.killer = true.
Code: Select all
Scene.addCircle({pos := e.pos; radius := 0.001; onCollide := (e)=>{e.this.killer = true; e.other.killer = true}})


that doesnt work very good for a huge amount of collisions
Image
pixartist
 
Posts: 65
Joined: Wed Sep 02, 2009 5:30 pm

Re: kill object with thyme ?

Postby standardtoaster » Mon Feb 01, 2010 10:10 pm

Then spawn more with different collision layers. Come on, man, try to think of how you can do it differently if this method does not work well for you.
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: kill object with thyme ?

Postby Mystery » Tue Feb 02, 2010 11:01 am

Code: Select all
e.other.denisty = +inf; e.other.collideset = 0; e.other.attraction = 0; e.other.drawborder = false; e.other.color = [0.0, 0.0, 0.0, 0.0]


Won't destroy it but make it mostly non existent, with no real interference shouldn't make too much lag.
User avatar
Mystery
 
Posts: 2802
Joined: Thu Sep 03, 2009 1:16 pm
Location: Southern Australia

Re: kill object with thyme ?

Postby blahblah200 » Tue Feb 02, 2010 6:04 pm

Code: Select all
e.other.density = 0;  e.this.density = 0

Does that work?
Image<-- Made with GIMP
User avatar
blahblah200
 
Posts: 61
Joined: Tue Sep 01, 2009 11:33 am
Location: Somewhere over the rainbow...


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 23 guests