[Thyme][1.5.61]Thyme Command/Variables List

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

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby Prsn828 » Sun Sep 13, 2009 1:12 pm

Great work, as always, Grady.

I have one request though: Can you explain exactly what parameters are needed for each add______ command to work, and where you can get the input values from? I find it challenging to figure out what can be used where, and how to find out exactly what is needed. Also, does the addSpring method work at all, even if it only works partially? I've read on the forum in several places about how the addHinge method is almost impossible to use, but I wanted to try the addSpring method first since I thought I read about it working, and then wanted to move onto addHinge to see if I couldn't trick it into working properly (or even improperly is good enough I suppose).

Thanks in advance. I might be new to Algodoo, but you can believe me when I say I'm plenty experienced in coding. It's refreshing having you around the forums to help.
Prsn828
 
Posts: 3
Joined: Wed Sep 09, 2009 7:57 pm

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby gradyfitz » Sun Sep 13, 2009 3:10 pm

Prsn828 wrote:Great work, as always, Grady.

I have one request though: Can you explain exactly what parameters are needed for each add______ command to work, and where you can get the input values from? I find it challenging to figure out what can be used where, and how to find out exactly what is needed. Also, does the addSpring method work at all, even if it only works partially? I've read on the forum in several places about how the addHinge method is almost impossible to use, but I wanted to try the addSpring method first since I thought I read about it working, and then wanted to move onto addHinge to see if I couldn't trick it into working properly (or even improperly is good enough I suppose).

Thanks in advance. I might be new to Algodoo, but you can believe me when I say I'm plenty experienced in coding. It's refreshing having you around the forums to help.

For a spring you need world0pos and (world1pos or geom1pos (and geom1)).
So, if you are connecting an object to the background you could use the code:
Code: Select all
Scene.addSpring {    geom1 = 0;    world0pos = [-0.19999999, 0.19999999];geom1pos = [-0.1, 0.7];}

If you were connecting two geometries, you could use the code:
Code: Select all
Scene.addSpring {    world0pos = [-0.10000002, 0.90000004];     geom1pos = [-0.90000004, 0.1];}


For a hinge you need geom0 and geom1, its best to include geom0pos and geom1pos too.
Two hinged objects:
Code: Select all
Scene.addHinge {    geom0 = 6726112;    geom0pos = [-4.7683716e-007, 5.9604645e-008];    geom1 = 6726111;    geom1pos = [-4.7683716e-007, 5.9604645e-008];}

One hinged object:
Code: Select all
Scene.addHinge {    geom0 = 6726111;    geom0pos = [-4.7683716e-007, 5.9604645e-008];    geom1 = 0;    geom1pos = [6.1, 0.90000004];}


Hopefully this helped :).
Mechanisms: 18 Mechanisms.
Thyme: Tutorial - Variables/Commands List.
Thymechanic
gradyfitz
 
Posts: 174
Joined: Tue Sep 01, 2009 8:33 am
Location: Victoria, Australia

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby Sniperkasa » Mon Sep 14, 2009 2:03 pm

nobody has still replied to my question :/
scene is now here - Image
Author: Sniperkasa
Title: Calculator W.I.P V.1.1
File Size: 9.86 kB
Rating: Image
ImageImage
If you have a question, have a dollar and call somebody that cares.
No really just PM me if you have a problem :)
User avatar
Sniperkasa
 
Posts: 493
Joined: Tue Sep 01, 2009 5:34 pm
Location: The bottom of a lake.

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby gradyfitz » Tue Sep 15, 2009 11:00 am

Sniperkasa wrote:nobody has still replied to my question :/
scene is now here - http://www.algodoo.com/algobox/details/30680

Now I've seen your scene, I know the problem, I'm sorry I didn't reply to you earlier :)
http://www.algodoo.com/algobox/details/30960

The problem was that you were using integer values instead of float values, try to use float values, so, when you are declaring a variable of value 1, write:
Code: Select all
<x> = 1.0


What I seem to find is that frequently, when all elements of an operation are of one type, the ending product will be that type :D, if you want to stop this, use Math.toFloat. :)

I hope it helps :D.
Mechanisms: 18 Mechanisms.
Thyme: Tutorial - Variables/Commands List.
Thymechanic
gradyfitz
 
Posts: 174
Joined: Tue Sep 01, 2009 8:33 am
Location: Victoria, Australia

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby Sniperkasa » Tue Sep 15, 2009 5:49 pm

So.. You mean.. instead of typing 1 I type 1.0.. ? Not too good at these stuffs yet :D
If you have a question, have a dollar and call somebody that cares.
No really just PM me if you have a problem :)
User avatar
Sniperkasa
 
Posts: 493
Joined: Tue Sep 01, 2009 5:34 pm
Location: The bottom of a lake.

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby Grenade1950 » Sun Sep 27, 2009 8:42 pm

I have a problem. It keeps saying "Not a list" for this:

Scene.addWater{vecs = [5,10]}

And I don't know why... I'm still new to this language :?
Grenade1950
 
Posts: 9
Joined: Sat Sep 26, 2009 2:40 pm

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby KarateBrot » Sun Sep 27, 2009 9:07 pm

Grenade1950 wrote:I have a problem. It keeps saying "Not a list" for this:

Scene.addWater{vecs = [5,10]}

And I don't know why... I'm still new to this language :?


You need another two [] brackets... don't ask me why...
Code: Select all
Scene.addWater{vecs = [[5,10]]}
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby gradyfitz » Mon Sep 28, 2009 1:50 am

KarateBrot wrote:
Grenade1950 wrote:I have a problem. It keeps saying "Not a list" for this:

Scene.addWater{vecs = [5,10]}

And I don't know why... I'm still new to this language :?


You need another two [] brackets... don't ask me why...
Code: Select all
Scene.addWater{vecs = [[5,10]]}

I can explain this, you need two square brackets because it's an array of arrays, like for example, if I wanted to make 5 water particles at [1,1],[1,2],[1,3],[1,4] and[1,5] I'd write: Scene.addWater{vecs = [[1,1],[1,2],[1,3],[1,4],[1,5]]}, which is basically: [p0,p1,p2,p3,p4], p0-p4 being the positions of the particles.

Hopefully this explained it well enough :D.
Mechanisms: 18 Mechanisms.
Thyme: Tutorial - Variables/Commands List.
Thymechanic
gradyfitz
 
Posts: 174
Joined: Tue Sep 01, 2009 8:33 am
Location: Victoria, Australia

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby KarateBrot » Mon Sep 28, 2009 2:27 am

wow thanks. i didn't know you can spawn water at different positions with one event :shock:
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby DeathCon88 » Sun Nov 01, 2009 10:50 pm

Could you add some sort of indication that shows whitch factors are reqired. Like this...

scene.addCircle

>pos

>radius

Could you also give examples of what to put after the factor eg:

pos- e.pos

that would be awsome if not can you tell me how to set geom0 and geom1 with springs
thanks in advance
DeathCon88
 
Posts: 2
Joined: Fri Sep 04, 2009 1:31 pm

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby standardtoaster » Sun Nov 01, 2009 11:09 pm

You can find out about geom0 and geom1 from this tutorial.
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby Sniperkasa » Mon Nov 02, 2009 5:13 pm

Is it possible to get the sqare root.. just btw
If you have a question, have a dollar and call somebody that cares.
No really just PM me if you have a problem :)
User avatar
Sniperkasa
 
Posts: 493
Joined: Tue Sep 01, 2009 5:34 pm
Location: The bottom of a lake.

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby standardtoaster » Mon Nov 02, 2009 5:48 pm

Yes. n^0.5 or math.pow(n, 0.5)
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby StephenAlverez » Tue Nov 24, 2009 4:38 pm

Could some one elaberate on what the "vel" and the "angvel" functions do. I am sort of getting into scripting and I would like to understand things I see in other scenes.
I am Alpha and Omega, the beggining and the end.

Image
User avatar
StephenAlverez
 
Posts: 164
Joined: Wed Sep 30, 2009 2:46 am
Location: Vermont

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby standardtoaster » Tue Nov 24, 2009 5:00 pm

Vel is the velocity of an object. It is in X and Y axes. [X, Y] Angvel is angular velocity.
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby StephenAlverez » Wed Nov 25, 2009 11:34 pm

So if i had Vel:=[1,1] in a script for a circle, the circle would be moving when it was spawned?
I am Alpha and Omega, the beggining and the end.

Image
User avatar
StephenAlverez
 
Posts: 164
Joined: Wed Sep 30, 2009 2:46 am
Location: Vermont

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby standardtoaster » Wed Nov 25, 2009 11:43 pm

Yes, it will be moving when spawned.
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby shark0151 » Thu Nov 26, 2009 8:36 pm

nevermind
Last edited by shark0151 on Wed Mar 16, 2011 8:21 pm, edited 2 times in total.
Toto, I don't think we're in Kansas anymore!
User avatar
shark0151
 
Posts: 3
Joined: Wed Nov 11, 2009 4:34 pm
Location: Romania

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby blahblah200 » Fri Nov 27, 2009 1:37 pm

What is the point of this:
Gradyfitz wrote:posivate - Multiply by 1 (* 1)

?????

Because it doesn't do anything to a number - if you times by one, it will not change!!!
Image<-- Made with GIMP
User avatar
blahblah200
 
Posts: 61
Joined: Tue Sep 01, 2009 11:33 am
Location: Somewhere over the rainbow...

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby RA2lover » Sun Nov 29, 2009 8:25 pm

maybe that was a failure Emil did(that function was there even before he got employed by algoryx.

I think that he wanted to write this function
math.posivate:= (x)=>{(x^2)^0.5}
Jrv wrote:
TC42 wrote:Quite honestly, I didn't think anyone on 4chan has that good a use of grammar, spelling, usage, mechanics, ect.
But I've never been there, so I may be wrong.


GTFO newfgt
User avatar
RA2lover
 
Posts: 607
Joined: Mon Aug 31, 2009 8:43 pm
Location: Brazil

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby blahblah200 » Mon Nov 30, 2009 11:33 pm

RA2lover wrote:maybe that was a failure Emil did(that function was there even before he got employed by algoryx.

I think that he wanted to write this function
math.posivate:= (x)=>{(x^2)^0.5}


I didn't know Emil could FAIL :shock: :shock: :shock: :shock:
Image<-- Made with GIMP
User avatar
blahblah200
 
Posts: 61
Joined: Tue Sep 01, 2009 11:33 am
Location: Somewhere over the rainbow...

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby legophunpp » Sat Jan 16, 2010 4:01 am

what is texturematrix?
legophunpp
 
Posts: 12
Joined: Tue Jan 12, 2010 1:26 am

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby standardtoaster » Sat Jan 16, 2010 4:21 am

The textureMatrix is what manipulates the texture on an object. There are nine parts to the textureMatrix.
textureMatrix = [0, 1, 2, 3, 4, 5, 6, 7, 8]

textureMatrix(0) = width of the texture
textureMatrix(1) = how much the top of the texture moves to the left and the bottom of the texture moves to the right
textureMatrix(2) = X position of the texture
textureMatrix(3) = how much the right side moves up and how much the left side moves down
textureMatrix(4) = Pinches the texture up and down
textureMatrix(5) = Y position of the texture
textureMatrix(6) = X position of the texture(applies only to polygons)
textureMatrix(7) = Pinches the texture to the top right(applies only to polygons)
textureMatrix(8) = Scale of the texture(applies only to polygons)
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby niffirg1 » Sat Jan 16, 2010 5:25 am

legophunpp wrote:what is texturematrix?

Basically what the texture looks like inside an object
User avatar
niffirg1
 
Posts: 376
Joined: Mon Aug 31, 2009 10:31 pm
Location: The Great American South!

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby TimTheOne » Fri Jan 29, 2010 7:17 pm

Is there , and if yes , what is , a possibility to get the mass of something , using a e.other script?

as anything like e.other.mass ( or e.geom.mass with lasers ) doesnt work.

thanks in advance , me
TimTheOne
 
Posts: 40
Joined: Tue Jan 12, 2010 9:22 pm

PreviousNext

Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 1 guest

cron