Color (bounded to bad type)?

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

Color (bounded to bad type)?

Postby Antotabo » Sat Mar 06, 2010 2:17 am

I have a problem, I want boxes to change their colour individually in relation to their attraction.
So what I did is that code in each box :

COLOR= {[ - attraction / 200 + 0.7, - attraction / 200 + 0.7, attraction / 200 + 0.7, 1.0]}

I works well, but each time I reload my scene, each boxes get a random colour and the script is gone.
When I bring down the console, I read approximately this : colour bound to bad type.

Can this be resolved?? Maybe I should use something else then simply attraction like e.this.attraction or e.this .geom.color (this doesnt work).

Please help.

Thanks
Antotabo
 
Posts: 54
Joined: Tue Sep 01, 2009 6:27 am

Re: Color (bounded to bad type)?

Postby Antotabo » Sat Mar 06, 2010 4:52 am

Finally I decided to change the way to do it by changing the attraction and the color at same time with the lasers.
Still It would be cool to know if there is another solution.
And I uploaded the scene I was making:
Rating: rated 5.6
Filesize: 22.96 kB
Comments: 1
Ratings: 2
download
Last edited by Antotabo on Wed Mar 10, 2010 5:25 am, edited 1 time in total.
Antotabo
 
Posts: 54
Joined: Tue Sep 01, 2009 6:27 am

Re: Color (bounded to bad type)?

Postby Mr_Stabby » Sat Mar 06, 2010 4:42 pm

if its "bound to bad type" then use
COLOR= {[1,1,1,1]; [ - attraction / 200 + 0.7, - attraction / 200 + 0.7, attraction / 200 + 0.7, 1.0]}
it should provide the default color value in case attraction variable isnt available for whatever reason
Mr_Stabby
 
Posts: 155
Joined: Wed Dec 16, 2009 12:16 am

Re: Color (bounded to bad type)?

Postby Antotabo » Mon Mar 08, 2010 6:01 am

Thanks !
Antotabo
 
Posts: 54
Joined: Tue Sep 01, 2009 6:27 am


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 16 guests