Box spawning help...

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

Box spawning help...

Postby Dezzeron » Tue Feb 09, 2010 11:22 pm

I want to spawn ONE box, i got it to spawn , but it makes five instead... whats wrong? Heres the script:
Code: Select all
(e)=>{
    Scene.addbox({         collideSet := 9;         Color := [0.755, 0.74400002, 0.068000004, 1.0];         size := [0.30000001, 0.1];         vel := e.normal((*))     });     scene.addpen({         color := [0.77499998, 0.764, 0.07, 0.76499999];         size := 0.1     }) }
Check out my stuff HERE!
MY WEB SITE HERE!

Image
Sorry, I just had to.

Phundamentalist!
Mystery wrote:I'm convinced that dezzerons scenes are all epic. He's one of the biggest underdogs of algobox.
User avatar
Dezzeron
 
Posts: 296
Joined: Tue Sep 01, 2009 12:45 am
Location: Dark Side Of The Moon

Re: Box spawning help...

Postby Versieon » Tue Feb 09, 2010 11:43 pm

The collider that spawns the box is probobly hiting more than once.
User avatar
Versieon
 
Posts: 375
Joined: Tue Sep 01, 2009 4:45 pm

Re: Box spawning help...

Postby Cs24 » Tue Feb 09, 2010 11:50 pm

I'm assuming you put this in onCollide (phun user?), it works fine here, are you sure the object isn't colliding multiple times?

EDIT: dang Versieon beat me

And the pen doesn't spawn with the box.

Code: Select all
(e)=>{Scene.addbox({         collideSet := 9;         Color := [0.755, 0.74400002, 0.068000004, 1.0];         size := [0.30000001, 0.1];         vel := e.normal((*))     });     scene.addpen({         color := [0.77499998, 0.764, 0.07, 0.76499999];         size := 0.1     })}


this code sort of works, if the spawner moves too much (very little) the pen will spawn on one of the colliding objects and not the bullet.
Newbie Thymer
Intermediate Phuner
Cs24
 
Posts: 41
Joined: Tue Nov 03, 2009 5:30 am

Re: Box spawning help...

Postby Dezzeron » Wed Feb 10, 2010 6:00 am

That code doesnt work at all, I'll check if it's colliding multiple times... and I dont even want the pen, the code just wont delete...
Check out my stuff HERE!
MY WEB SITE HERE!

Image
Sorry, I just had to.

Phundamentalist!
Mystery wrote:I'm convinced that dezzerons scenes are all epic. He's one of the biggest underdogs of algobox.
User avatar
Dezzeron
 
Posts: 296
Joined: Tue Sep 01, 2009 12:45 am
Location: Dark Side Of The Moon

Re: Box spawning help...

Postby Cs24 » Wed Feb 10, 2010 8:21 pm

oh whoops wrong script

Code: Select all
(e)=>{
    Scene.addbox({      pos:=e.pos;   collideSet := 9;         Color := [0.755, 0.755, 0.068, 1.0];         size := [0.3, 0.1];         vel := e.normal((*))     });     }


that should (...) work (typing at school)
do the colliding objects have 0 restitution? that fixes it for me
Newbie Thymer
Intermediate Phuner
Cs24
 
Posts: 41
Joined: Tue Nov 03, 2009 5:30 am


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 8 guests

cron