Spawner spawnig ob. w. script

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

Spawner spawnig ob. w. script

Postby Jackyy » Sat Oct 31, 2009 1:25 pm

How to spawn ob. w. script in onCollide?
Code: Select all
(e)=>{
    scene.addcircle({         pos = e.pos;         radius := 0.02002001;         density := 20.5;         color := [0.0, 0.0, 0.0, 1.0];         collideset := 1;         restitution := 0.5;         heterocollide := true;         drawBorder := true;         drawcirclecace := false;         attraction := 0; onCollide = (e)=>{ scene.addpen({         pos = e.pos;         color := [1.0, 1.0, 0.0, 1.0];         size := 0.02002001;         fadeTime := 0.0     }) }}  })


^This dont work...
Jackyy
 
Posts: 3
Joined: Sat Oct 31, 2009 12:58 pm

Re: Spawner spawnig ob. w. script

Postby niffirg1 » Sat Oct 31, 2009 3:05 pm

Won't work it needs ti be oncollide := (e)=>{BLA} you missed the colon and i saw some other little errors
User avatar
niffirg1
 
Posts: 376
Joined: Mon Aug 31, 2009 10:31 pm
Location: The Great American South!

Re: Spawner spawnig ob. w. script

Postby Jackyy » Sat Oct 31, 2009 3:19 pm

Still bad
Jackyy
 
Posts: 3
Joined: Sat Oct 31, 2009 12:58 pm

Re: Spawner spawnig ob. w. script

Postby KarateBrot » Sat Oct 31, 2009 5:51 pm

niffirg1 wrote:i saw some other little errors


Jackyy wrote:Still bad


Of course it still doesn't work until you corrected the other little errors. it's nothing special but you need a } bracket somewhere. i don't know if there are more errors but be sure you correctly typed in every single character
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: Spawner spawnig ob. w. script

Postby standardtoaster » Sat Oct 31, 2009 6:01 pm

Code: Select all
(e)=>{Scene.addCircle({pos := e.pos; radius := 0.02002001; density := 20.5; color := [0,0,0,1]; collideSet := 1; restitution := 0.5; heteroCollide := true; drawBorder := true; drawCake := false; attraction := 0; onCollide := (e)=>{scene.addPen({pos := e.pos; color := [1, 1 ,0, 0]; size := 0.02002001; fadeTime := 0})}})}

Fixed the errors for you. BTW it's drawCake not drawCircleCace. ;)
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: Spawner spawnig ob. w. script

Postby Jackyy » Sat Oct 31, 2009 6:45 pm

Thanks. !!! :clap: :clap: :clap: :clap:
Jackyy
 
Posts: 3
Joined: Sat Oct 31, 2009 12:58 pm


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 15 guests

cron