Another random?

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

Another random?

Postby TC42 » Mon Apr 18, 2011 10:13 pm

Code: Select all
geval("(cos(sim.time))")

Or is this bad for algodoo?
Image
Spambot wrote:Nowadays, memes usually are studied less in the field of biology, but more with the arena of psychology along with sociology. But, the major area of a meme, getting embraced and imitated all the time is what’s at any core connected with any meme.
User avatar
TC42
 
Posts: 984
Joined: Sun Jan 09, 2011 1:53 pm
Location: $ sudo apt get-install sandwich_

Re: Another random?

Postby Someone Else » Tue Apr 19, 2011 2:44 pm

What does geval do?
And did you try simultaneously spawning several circles with that set to vel? Methinks it would repeatedly spawn multiple circles with the exact same velocity.
And how do you turn that into a scene.my thingymabobber? I'm OK with this, because it can be used multiple times in a scene without failing.
And if I stick it into my config, will it automatically appear in every scene that I open?

And I suggest they add a math.random function!
Matthias Wandel is epic, in my humble opinion.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.

ARE YA HAPPY NOW?????

Thymechanic/Phundamentalist

Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
User avatar
Someone Else
 
Posts: 1147
Joined: Sun Nov 21, 2010 10:53 pm
Location: The Milky Way Galaxy

Re: Another random?

Postby bozbez » Tue Apr 19, 2011 5:30 pm

Someone Else wrote:What does geval do?

geval is the same as eval, but in the global scope.

Someone Else wrote:And did you try simultaneously spawning several circles with that set to vel? Methinks it would repeatedly spawn multiple circles with the exact same velocity.

Yep :)

Someone Else wrote:And how do you turn that into a scene.my thingymabobber?

Code: Select all
scene.my.bla = {geval("(cos(sim.time))")}
Image

Go here. Now. That's Now. Not in 5 minutes. Now.
User avatar
bozbez
 
Posts: 149
Joined: Tue Apr 12, 2011 7:01 pm

Re: Another random?

Postby Someone Else » Tue Apr 19, 2011 6:36 pm

bozbez wrote:
Someone Else wrote:What does geval do?

geval is the same as eval, but in the global scope.


What's eval?
What's global scope?
Slightly off-topic, but what's the math.floor thing? TC42, you know what I'm talking about.
Matthias Wandel is epic, in my humble opinion.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.

ARE YA HAPPY NOW?????

Thymechanic/Phundamentalist

Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
User avatar
Someone Else
 
Posts: 1147
Joined: Sun Nov 21, 2010 10:53 pm
Location: The Milky Way Galaxy

Re: Another random?

Postby bozbez » Tue Apr 19, 2011 8:15 pm

Someone Else wrote:
bozbez wrote:
Someone Else wrote:What does geval do?

geval is the same as eval, but in the global scope.


What's eval?
What's global scope?
Slightly off-topic, but what's the math.floor thing? TC42, you know what I'm talking about.

eval - evaluates the function in the current scope.
geval - evaluates the function from the root (root scope).
math.floor - same as in javascript, if you have a number like 45.678, if you do math.floor(45.678), (im guessing the syntax here) you will get 45, if you do math.floor(10.2) you will get 10. Basically it removes the decimal.
Image

Go here. Now. That's Now. Not in 5 minutes. Now.
User avatar
bozbez
 
Posts: 149
Joined: Tue Apr 12, 2011 7:01 pm

Re: Another random?

Postby mold999 » Wed Apr 20, 2011 1:51 am

Define "evaluates the function in the current scope" and everything else you just said.
Phundementalism?

Ain't nobody got
thyme fo dat.
User avatar
mold999
 
Posts: 225
Joined: Sun Jan 02, 2011 1:35 am
Location: [176436, 3763234]

Re: Another random?

Postby bozbez » Wed Apr 20, 2011 10:24 am

evaluates the function in the current scope - does the function where it is (its country, or branch (of a tree) :))
evaluates the function from the root (root scope) - does the function from the globe or root (of that tree).
Image

Go here. Now. That's Now. Not in 5 minutes. Now.
User avatar
bozbez
 
Posts: 149
Joined: Tue Apr 12, 2011 7:01 pm

Re: Another random?

Postby mold999 » Wed Apr 20, 2011 5:47 pm

I still have no idea what you are talking about.
Phundementalism?

Ain't nobody got
thyme fo dat.
User avatar
mold999
 
Posts: 225
Joined: Sun Jan 02, 2011 1:35 am
Location: [176436, 3763234]

Re: Another random?

Postby bozbez » Wed Apr 20, 2011 6:12 pm

oh...
Image

Go here. Now. That's Now. Not in 5 minutes. Now.
User avatar
bozbez
 
Posts: 149
Joined: Tue Apr 12, 2011 7:01 pm

Re: Another random?

Postby Kilinich » Thu Apr 21, 2011 11:41 am

There is no point to use geval or eval here. Just search "random" in script forum. There was a lot of examples.
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


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 3 guests

cron