How Do You Read Variables Using Only a Hinge?

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

How Do You Read Variables Using Only a Hinge?

Postby FruitMonger » Sat Jun 16, 2012 4:15 pm

What I want to do is take a hinge, and use the controlleracc, angle, vel(0)/vel(1), etc. as the motor speed, but I can't figure out how.

The only way I knew how to script a hinge with the angle, angvel etc. was to use this code:

Code: Select all
Motor Speed = {hinge := (readable(owner));
              (readable(scene.entitybygeomid(hinge.geom0))).angle}


But now that those things are scriptable, I can't use them with that script. Anybody know how? COUGH COUGH Kilinich COUGH
Image
User avatar
FruitMonger
 
Posts: 135
Joined: Thu Dec 10, 2009 8:20 pm
Location: Some fruit stand in Indiana

Re: How Do You Read Variables Using Only a Hinge?

Postby tatt61880 » Sat Jun 16, 2012 4:40 pm

NOTE: this script is for Algodoo 2.0.2 b15
Code: Select all
motorSpeed = {
    g := Scene.entityByGeomID((readable(entity)).geom0);
    g.angle
}


FruitMonger wrote:COUGH COUGH Kilinich COUGH

COUGH COUGH I'm Tatt COUGH
NOTE: I'm not an Algoryx member.
Hi, Algodoo lovers. Have you read next topic? Featured scenes suggestions
To translators: English.cfg changelog will be useful (even for me).
User avatar
tatt61880
[Most Helpful Person 2010]
 
Posts: 1150
Joined: Mon Aug 31, 2009 5:45 pm
Location: Tokyo, Japan


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 4 guests