dynamic variable

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

dynamic variable

Postby Mr_Stabby » Mon Jan 18, 2010 5:58 am

is it possible to create a variable with a script? i need to spawn some objects with a killswitch as a global variable now while normally this wouldnt be a problem i need the variable to be different for each and every one.
Mr_Stabby
 
Posts: 155
Joined: Wed Dec 16, 2009 12:16 am

Re: dynamic variable

Postby niffirg1 » Mon Jan 18, 2010 7:39 am

Do you mean like in te oncollide menu it creates a cutom variable without you declaring I in the console?
User avatar
niffirg1
 
Posts: 376
Joined: Mon Aug 31, 2009 10:31 pm
Location: The Great American South!

Re: dynamic variable

Postby Kilinich » Mon Jan 18, 2010 8:44 am

like
Code: Select all
for(5, (i) => {eval("scene.my.var"+i+":= 0")})
?
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: dynamic variable

Postby Mr_Stabby » Tue Jan 19, 2010 7:25 am

Kilinich yes just like that, ty.
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 1 guest