Scripting

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

Scripting

Postby tallman1996 » Sun Jun 05, 2011 4:40 am

I have figured out a lot of the basic scripting, but where is a good place to learn more of the advanced scripting?

Also, could someone explain the "e." you sometimes have to put in front of a code?
User avatar
tallman1996
 
Posts: 13
Joined: Mon Mar 22, 2010 10:16 pm

Re: Scripting

Postby Someone Else » Sun Jun 05, 2011 6:35 am

Search the Thyme Scripting Forum. You'll find info there.
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: Scripting

Postby TC42 » Sun Jun 05, 2011 11:11 pm

Or if you don't want to search, I'm pretty sure that either Para/Kilinich/Grady said that "e" stands for event. Actually, I think Para said it stands for Emil. But "event" is probably more likely. This would make sense, as some code such as oncollide=(e)=>{e.geom.density=5} would translate to "On an oncollide event, the density of the geom in the event will be changed to 5". So you could thing of "geom" as being an attribute of the event (the event being represented by "e", the geom by "geom"), and "density" as being an attribute of the geom, so you would get "e.geom.density".

This is my theory, based off Para/Kilinich/Grady's info.

As for learning about thyme, I suggest that you download scenes, reverse-engineer them, and read all the thyme tutorials that you can. This includes Grady's thyme commands/variables list (possibly the most insanely useful post ever made), as well as some of the tutorials at the old forums.

Before you do too much messing around in thyme, learn how to reset your config. Because every thyme user will screw it up at some point...
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: Scripting

Postby tallman1996 » Sun Jun 05, 2011 11:54 pm

Thank you! Your post also reminds me of another question I had. In the code, how do you know we're to use "other" or "geom"? The only time I've seen geom is in lasers.
User avatar
tallman1996
 
Posts: 13
Joined: Mon Mar 22, 2010 10:16 pm

Re: Scripting

Postby TC42 » Mon Jun 06, 2011 12:59 am

e.other.........................................collisions (used only in oncollide)
e.geom.........................................object a laser hits (used only in onlaserhit)
e.laser..........................................laser that hits an object (used only in onhitbylaser)
[No prefix]....................................(used only when referring to the modifying object, ie., color=[0,0,0,0.5] instead of e.this.color=[0,0,0,0.5])
e.this...........................................referring to modifying object (sometimes used in place of [No Prefix])

I'm starting to sound like my Latin teacher teaching us about the uses of ablatives & accusatives. :roll:
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: Scripting

Postby daniels220 » Mon Jun 06, 2011 1:37 am

e.geom and e.laser are both available in both onLaserHit and onHitByLaser.
daniels220
 
Posts: 95
Joined: Mon Aug 31, 2009 11:30 pm

Re: Scripting

Postby bozbez » Wed Jun 08, 2011 2:24 pm

'e' does stand for event, but it could be anything:
Code: Select all
(fds)=>{fds.other.color = [1, 0, 0, 1]}

Still works.
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: Scripting

Postby TC42 » Wed Jun 08, 2011 3:48 pm

Yes, you can even have scene.my.geom.density=scene.my.othergeom.density

I just noticed something... the oncollide/onlaserhit is a function. Is it just me, or did everyone else already know that?
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: Scripting

Postby Someone Else » Thu Jun 09, 2011 7:15 am

I just figured out that key binds, spawning, and FOR loops are all function calls.
TC42 wrote:Is it just me, or did everyone else already know that?

This does help one remember the syntax.

But this is off-topic. Ish.
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


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 5 guests