Page 2 of 5

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

PostPosted: Sun Sep 13, 2009 1:12 pm
by Prsn828
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.

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

PostPosted: Sun Sep 13, 2009 3:10 pm
by gradyfitz
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 :).

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

PostPosted: Mon Sep 14, 2009 2:03 pm
by Sniperkasa
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

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

PostPosted: Tue Sep 15, 2009 11:00 am
by gradyfitz
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.

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

PostPosted: Tue Sep 15, 2009 5:49 pm
by Sniperkasa
So.. You mean.. instead of typing 1 I type 1.0.. ? Not too good at these stuffs yet :D

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

PostPosted: Sun Sep 27, 2009 8:42 pm
by Grenade1950
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 :?

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

PostPosted: Sun Sep 27, 2009 9:07 pm
by KarateBrot
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]]}

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

PostPosted: Mon Sep 28, 2009 1:50 am
by gradyfitz
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.

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

PostPosted: Mon Sep 28, 2009 2:27 am
by KarateBrot
wow thanks. i didn't know you can spawn water at different positions with one event :shock:

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

PostPosted: Sun Nov 01, 2009 10:50 pm
by DeathCon88
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

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

PostPosted: Sun Nov 01, 2009 11:09 pm
by standardtoaster
You can find out about geom0 and geom1 from this tutorial.

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

PostPosted: Mon Nov 02, 2009 5:13 pm
by Sniperkasa
Is it possible to get the sqare root.. just btw

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

PostPosted: Mon Nov 02, 2009 5:48 pm
by standardtoaster
Yes. n^0.5 or math.pow(n, 0.5)

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

PostPosted: Tue Nov 24, 2009 4:38 pm
by StephenAlverez
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.

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

PostPosted: Tue Nov 24, 2009 5:00 pm
by standardtoaster
Vel is the velocity of an object. It is in X and Y axes. [X, Y] Angvel is angular velocity.

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

PostPosted: Wed Nov 25, 2009 11:34 pm
by StephenAlverez
So if i had Vel:=[1,1] in a script for a circle, the circle would be moving when it was spawned?

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

PostPosted: Wed Nov 25, 2009 11:43 pm
by standardtoaster
Yes, it will be moving when spawned.

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

PostPosted: Thu Nov 26, 2009 8:36 pm
by shark0151
nevermind

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

PostPosted: Fri Nov 27, 2009 1:37 pm
by blahblah200
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!!!

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

PostPosted: Sun Nov 29, 2009 8:25 pm
by RA2lover
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}

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

PostPosted: Mon Nov 30, 2009 11:33 pm
by blahblah200
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:

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

PostPosted: Sat Jan 16, 2010 4:01 am
by legophunpp
what is texturematrix?

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

PostPosted: Sat Jan 16, 2010 4:21 am
by standardtoaster
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)

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

PostPosted: Sat Jan 16, 2010 5:25 am
by niffirg1
legophunpp wrote:what is texturematrix?

Basically what the texture looks like inside an object

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

PostPosted: Fri Jan 29, 2010 7:17 pm
by TimTheOne
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