Newbie coordinate question

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

Newbie coordinate question

Postby izacque » Wed Feb 10, 2010 10:38 pm

so I'm new to thyme, and for my first project, I'd like to know how to set a variable to the X coordinate of an object, and to set another variable to the Y coordinate. Also, is it possible to use a matrix for the X values and another matrix for the Y values, and then have objects each write their coordinates into different matrix slots? Thanks in advance for your help :D
[/post]
Paradigm 29 wrote:I've been trying to figure out why people even buy hummers ever since I found out that they don't have machine guns.
User avatar
izacque
 
Posts: 483
Joined: Mon Sep 14, 2009 11:14 am

Re: Newbie coordinate question

Postby KarateBrot » Thu Feb 11, 2010 2:44 am

To read preexisting variables like the position you have to use "new method" / "method-x". But then it's possible. So if you used this method you can add the x and y values to a matrix. For example

Code: Select all
scene.my.posX = scene.my.posX ++ [e.pos(0)]
Scene.my.posY = scene.my.posY ++ [e.pos(1)]
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: Newbie coordinate question

Postby Versieon » Thu Feb 11, 2010 2:53 am

Are you sure you have to use the new method, i belive you can read position regularly
User avatar
Versieon
 
Posts: 375
Joined: Tue Sep 01, 2009 4:45 pm

Re: Newbie coordinate question

Postby KarateBrot » Thu Feb 11, 2010 2:56 am

Oh yeah of course, sorry. But you can't read it directly off of the object. You have to attach an object to it and also a laser / beacon to read e.pos of the collision / laser event out from the middle of the object or where you want it to be.
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: Newbie coordinate question

Postby Antotabo » Thu Feb 11, 2010 3:10 am

Download the K-probe on algobox. Really useful gadget from Killinich. It gave plenty of information like RPM, position, velocity ... 100 time per second.
Antotabo
 
Posts: 54
Joined: Tue Sep 01, 2009 6:27 am

Re: Newbie coordinate question

Postby standardtoaster » Thu Feb 11, 2010 5:02 am

Or you can save yourself a lot of variables and make one yourself.
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: Newbie coordinate question

Postby izacque » Fri Feb 12, 2010 1:16 am

thanks guys, I was actually planning to use a beacon-detector system, so that's not a problem. I won't download the K-Probe. that Would be cheating. and I know enough about algodoo and thyme to make my own beacon without instructions. :P
[/post]
Paradigm 29 wrote:I've been trying to figure out why people even buy hummers ever since I found out that they don't have machine guns.
User avatar
izacque
 
Posts: 483
Joined: Mon Sep 14, 2009 11:14 am


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 0 guests

cron