How to spawn an object with a property for the "new method"

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

How to spawn an object with a property for the "new method"

Postby savask » Sun Mar 28, 2010 11:59 am

As I know, you should declare new variable (like vel or pos) in the bottom script bar and then you can use it with the "new method" (or method-x).
But are there a way to do it through thyme?
User avatar
savask
 
Posts: 162
Joined: Mon Oct 12, 2009 2:53 pm
Location: Russia, Siberia

Re: How to spawn an object with a property for the "new method"

Postby Kilinich » Sun Mar 28, 2010 12:06 pm

bottom script bar - console.
scripts in onCollide, onLaserHit etc. is exactly the same.
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: How to spawn an object with a property for the "new method"

Postby Mr_Stabby » Sun Mar 28, 2010 12:08 pm

there is, the problem is that the object cant do it to itself nor can it be spawned with a custom var via the regular spawning function (because as any function it just disregards random var names it doesent know) so when spawning (scene.addcircle({})).newvar:=something works and after that e.geom/other/laser.newvar:=something works but not e.this
Mr_Stabby
 
Posts: 155
Joined: Wed Dec 16, 2009 12:16 am

Re: How to spawn an object with a property for the "new method"

Postby savask » Sun Mar 28, 2010 12:13 pm

2 Kilinich
You didn't understand me correctly.

2 Mr_Stabby
Thanks, your method is right :thumbup:
User avatar
savask
 
Posts: 162
Joined: Mon Oct 12, 2009 2:53 pm
Location: Russia, Siberia


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 7 guests