Setting collideSet depending on which object collided

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

Setting collideSet depending on which object collided

Postby Jimmio92 » Sat Feb 27, 2010 12:10 pm

Hello all,
I'm making a simple circle spawn type engine, and I'm trying to add multiple pistons to one cylinder.. and attempting to change the spawned circle's collideSet depending on which object collided.

The "spark plug" object's onCollide is:
Code: Select all
(e)=>{
    Scene.addCircle({         radius = 0.1;         pos = e.pos;         collideSet := e.collideSet + 4     })}


Theoretically, this should set the spawned object's collideSet to the value of the piston, plus group C, C being the killer of the object. What am I doing wrong here? The circle is only getting group A.

Thanks,
Jimmio
Jimmio92
 
Posts: 1
Joined: Sat Feb 27, 2010 11:59 am

Re: Setting collideSet depending on which object collided

Postby KarateBrot » Sat Feb 27, 2010 1:32 pm

Code: Select all
(e)=>{Scene.addCircle({         radius := 0.1;         pos := e.pos;         collideSet := e.other.collideSet + 4})}


You forgot to type "other".
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: Setting collideSet depending on which object collided

Postby electronicboy » Sun Feb 28, 2010 3:37 am

using just "e.something" addresses the command to the object the code is on while, e.other addresses the other object
When asking for help, READ THE STICKIES!
electronicboy
 
Posts: 1694
Joined: Mon Aug 31, 2009 6:18 pm


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 9 guests

cron