Activate a motor oncollision help

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

Activate a motor oncollision help

Postby docg » Fri Feb 05, 2010 4:06 am

I need help
docg
 
Posts: 17
Joined: Thu Nov 12, 2009 12:31 am

Re: Activate a motor oncollision help

Postby standardtoaster » Fri Feb 05, 2010 4:57 am

You should really check out Grady's tut on starting to learn thyme.
Code: Select all
//Variables
Scene.my.motor = false

//onCollide
(e)=>{Scene.my.motor = true}

//Motor
{Scene.my.motor}
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: Activate a motor oncollision help

Postby Mystery » Fri Feb 05, 2010 11:53 am

Just to expand on standardtoaster's code

Make sure you have Advanced mode ON
Open Console (~)
Type in
Code: Select all
Scene.my.motor = false

Press enter to save it(Copy and paste works to)

On the object you want to trigger the Motor turning on in the Script menu in oncollide. Pump in
Code: Select all
(e)=>{Scene.my.motor = true}
Once again Press enter to save it.

And on the hinge you want to be triggered in the script menu in Motor put in
Code: Select all
{Scene.my.motor}

And simply press enter to save it.
Last edited by Mystery on Sat Feb 06, 2010 2:49 am, edited 1 time in total.
User avatar
Mystery
 
Posts: 2802
Joined: Thu Sep 03, 2009 1:16 pm
Location: Southern Australia

Re: Activate a motor oncollision help

Postby docg » Fri Feb 05, 2010 12:57 pm

thanks
docg
 
Posts: 17
Joined: Thu Nov 12, 2009 12:31 am

Re: Activate a motor oncollision help

Postby standardtoaster » Fri Feb 05, 2010 4:24 pm

Mystery, for the motor it would be:
Code: Select all
{Scene.my.motor}

not
Code: Select all
(e)=>{Scene.my.motor = true}
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: Activate a motor oncollision help

Postby docg » Sat Feb 06, 2010 2:47 am

I know
docg
 
Posts: 17
Joined: Thu Nov 12, 2009 12:31 am

Re: Activate a motor oncollision help

Postby Mystery » Sat Feb 06, 2010 2:50 am

Whoops. Thanks for the correction.
User avatar
Mystery
 
Posts: 2802
Joined: Thu Sep 03, 2009 1:16 pm
Location: Southern Australia


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 4 guests