Syntax Needed

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

Syntax Needed

Postby Blazemann » Wed Sep 02, 2009 1:25 am

Where can I learn Thyme syntax? The post with the language is good, but useless without knowing how to use it!
User avatar
Blazemann
 
Posts: 151
Joined: Tue Sep 01, 2009 1:19 am

Re: Your an idiot..... lol jk

Postby Rhett97 » Wed Sep 02, 2009 1:26 am

by what do you mean 'Syntax??
Chronos wrote:There's nothing wrong with swearing. They're just words. People just think they have a bad meaning. What's the difference between shit and poo? Nothing. They're the same.
User avatar
Rhett97
 
Posts: 522
Joined: Mon Aug 31, 2009 10:32 pm

Re: Syntax Needed

Postby Blazemann » Wed Sep 02, 2009 1:28 am

Like in the console it is easy: app.scene.*

But how to apply code to areas in the script menus, or non-console areas.
User avatar
Blazemann
 
Posts: 151
Joined: Tue Sep 01, 2009 1:19 am

Re: Syntax Needed

Postby Rhett97 » Wed Sep 02, 2009 1:41 am

oh well... i dont know how you would do that....... ask para or grady
Chronos wrote:There's nothing wrong with swearing. They're just words. People just think they have a bad meaning. What's the difference between shit and poo? Nothing. They're the same.
User avatar
Rhett97
 
Posts: 522
Joined: Mon Aug 31, 2009 10:32 pm

Re: Syntax Needed

Postby Versieon » Wed Sep 02, 2009 1:46 am

I see, the places you can put code into are in the scipt menus in advanced mode, you can either put it into oncollide or onlasercolide. every time something is hit, it executes the script.

heres how.
you will always need {} on the ends of your script

example
(e)=>{e.other.collideSet = 2}
this is in the oncollide script

e.other says do this to the other object(e.this is for this object)
.collideSet = 2 changes the other objects collideSet to 2 or B

every time something collides with the object, it executes the script and changes the collideset
User avatar
Versieon
 
Posts: 375
Joined: Tue Sep 01, 2009 4:45 pm

Re: Syntax Needed

Postby Blazemann » Wed Sep 02, 2009 1:49 am

Thankyou, but is there a difference with lasers? I thought I saw somewhere it is.
User avatar
Blazemann
 
Posts: 151
Joined: Tue Sep 01, 2009 1:19 am

Re: Syntax Needed

Postby Versieon » Wed Sep 02, 2009 1:50 am

yes there is, a laser uses e.geom to specify the object it is hitting and e.laser to specify itself.
User avatar
Versieon
 
Posts: 375
Joined: Tue Sep 01, 2009 4:45 pm

Re: Syntax Needed

Postby Blazemann » Wed Sep 02, 2009 1:53 am

Thanks alot, didn't know it was this simple. A topic should be made.
User avatar
Blazemann
 
Posts: 151
Joined: Tue Sep 01, 2009 1:19 am

Re: Syntax Needed

Postby Versieon » Wed Sep 02, 2009 1:55 am

You can if you would want to, im not that great at making tuts
User avatar
Versieon
 
Posts: 375
Joined: Tue Sep 01, 2009 4:45 pm

Re: Syntax Needed

Postby Blazemann » Wed Sep 02, 2009 2:20 am

Maybe with more experience.
User avatar
Blazemann
 
Posts: 151
Joined: Tue Sep 01, 2009 1:19 am

Re: Syntax Needed

Postby Ian151 » Wed Sep 02, 2009 2:42 am

Don't forget you can change many different variables from strings to arrays and intergers, floats, if you can't do it directly between objects... That usually uses the console though, but it can help if you want to try that and you don't care making a phunlet.
Most user created variables start with scene.my.Variablenamehere
You usually declare these variables in the console.
String (Words and phrases) ---> "Hello world!"
array (collection of numbers, helpfull with colors) --->[0.5,0.5,0.5,1] thats gray in a color code.
integer or float (a number or decimal) ---> 123 OR 12.3 etc.

Just putting that out there if you didn't know about that.
"THE BEST 2 PLAYER SCENE EVER MADE!!!" - ianno
http://www.algodoo.com/algobox/details.php?id=24204
Image
User avatar
Ian151
 
Posts: 47
Joined: Tue Sep 01, 2009 12:02 am

Re: Syntax Needed

Postby gradyfitz » Wed Sep 02, 2009 9:41 am

[Tutorial]Thyme - With full explanations at every step

I'm not going to transfer this yet, there are a lot of changes I have to make (a lot of information is out of date), but, still, I don't think anything in it doesn't work :).
Mechanisms: 18 Mechanisms.
Thyme: Tutorial - Variables/Commands List.
Thymechanic
gradyfitz
 
Posts: 174
Joined: Tue Sep 01, 2009 8:33 am
Location: Victoria, Australia

Re: Syntax Needed

Postby Blazemann » Wed Sep 02, 2009 11:48 pm

Thanks Grady.
User avatar
Blazemann
 
Posts: 151
Joined: Tue Sep 01, 2009 1:19 am


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 1 guest

cron