Help !

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

Help !

Postby Gear97 » Sat Mar 20, 2010 8:18 pm

I want to spawn circles with variable density, using a variable called scene.my.density and I am cannot do that anyone can help me ? :?:
Gears are my favorite mechanism. Why do you think I have this username ? ;)
Make sure to spend some time to see my work http://www.algodoo.com/algobox/profile.php?id=96, just to kill sometime ;)
PS: Gear97™ Is a trademark from me. Any unauthorized use of the term "Gear" for usernames or other naming ideas will be punished.
User avatar
Gear97
 
Posts: 146
Joined: Sat Jan 02, 2010 5:34 pm
Location: Brazil

Re: Help !

Postby RA2lover » Sat Mar 20, 2010 9:21 pm

if you want to do so statically, you can use density:= scene.my.density.

for the variable to be updated in realtime you might want to use {scene.my.density} instead, but it appears to be impossible to be done in 1.6.0(so 1.7 beta is required, but hey, you own algodoo, don't you? :yawn: )
Jrv wrote:
TC42 wrote:Quite honestly, I didn't think anyone on 4chan has that good a use of grammar, spelling, usage, mechanics, ect.
But I've never been there, so I may be wrong.


GTFO newfgt
User avatar
RA2lover
 
Posts: 607
Joined: Mon Aug 31, 2009 8:43 pm
Location: Brazil

Re: Help !

Postby Mr_Stabby » Sun Mar 21, 2010 5:32 am

do you want to spawn multiple circles with one variable density or multiple circles with individual densitys and do you need the value to be set in stone after spawn or rather linked to the one or multiple density variable(s)?

using a universal density variable goes like either scene.addcircle({density:=myvariable}) for fixed value (scene.addcircle({})).density={myvariable} for updateable value. for individual values you need another variable to keep track of values assigned, lets call it mycount and can be used like for(mycount, (c)=>{eval("(scene.addcircle({})).density={myvariable"+c+"}")}) with variables declared and their values set for myvariablemycount during or previous to the loop
Mr_Stabby
 
Posts: 155
Joined: Wed Dec 16, 2009 12:16 am


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 10 guests

cron