2.0.2b15 radius and size is now scriptable!

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

2.0.2b15 radius and size is now scriptable!

Postby tatt61880 » Sat May 19, 2012 5:57 pm

Circle's radius and box's size is now scriptable.
Thanks, emilk for the feature.
It's very interesting. This can be used for gaming purpose. :thumbup:

Example:
Rating: rated 5
Filesize: 9.09 kB
Comments: 0
Ratings: 1
download

This scene is created by next code.
NOTE: This code requires Algodoo 2.0.2 b15.
Code: Select all
Sim.running = false;
Scene.Clear;
Scene.addCircle {
    radius := {1 + 0.25 * math.sin(Sim.time)};
    pos := [-1, 0];
    color := [1, 0, 0, 1];
    restitution := 0.0;
};
Scene.addBox {
    size :=  {[1, 1] + 0.25 * [math.cos(Sim.time), math.sin(Sim.time)]};
    pos := [1, 0];
    color := [0, 0, 1, 1];
};
Scene.addPlane {
    angle := math.pi / 2;
    pos := [0, -1];
    color = [0, 0, 0, 1];
};
Scene.addPlane {
    angle := {math.pi / 2 + 0.1 * math.sin(Sim.time)};
    pos := [0, -1.5];
    color := [0, 0.5, 0, 1];
};


I used Sim.time above, but it's not good to use it because reopening scene reset Sim.time into 0, even if Sim.time wasn't 0 when you saved the scene.
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

Re: 2.0.2b15 radius and size is now scriptable!

Postby monstertje3 » Sun May 20, 2012 10:56 am

you can also modify everything directly in the script menu, this is one of the best things that happened to algodoo =)
Basically, there are only 10 types of people in the world. Those who know binary, and those who don't.
Light travels faster than sound. That's why some people appear bright until they open their mouths.
User avatar
monstertje3
 
Posts: 343
Joined: Sat Sep 05, 2009 4:29 pm
Location: N-H, NL

Re: 2.0.2b15 radius and size is now scriptable!

Postby silversmart » Sat May 26, 2012 8:55 pm

hey, i have a question about that...

why do the rotation axis stay in point and dont move with the blocks when i press "A" and "S" the left goes up an down but the tires stay in position. the same is on the right side (steer with "D" and "F")
hope you know what i mean. if not... ask again ^^

best regards bluebravo aka silversmart

Rating: rated 5
Filesize: 21 kB
Comments: 1
Ratings: 1
download



best regards bluebravo / silversmart
silversmart
 
Posts: 27
Joined: Tue Jul 05, 2011 7:48 pm

Re: 2.0.2b15 radius and size is now scriptable!

Postby monstertje3 » Sun May 27, 2012 10:33 am

the axles and fixjoints have a specific snap point on the object
the middle of the object is taken and then the relpoint gets added and defines its place.
if you resize the box the relpoints of the axles don't change and keep the same distance to the center of the object.
(resizing hapens from the center outwards)
Basically, there are only 10 types of people in the world. Those who know binary, and those who don't.
Light travels faster than sound. That's why some people appear bright until they open their mouths.
User avatar
monstertje3
 
Posts: 343
Joined: Sat Sep 05, 2009 4:29 pm
Location: N-H, NL

Re: 2.0.2b15 radius and size is now scriptable!

Postby silversmart » Sun May 27, 2012 2:14 pm

but if we could change the "geom1pos" of the axles this schould work.
but i think its not possible or is it?

best regards
silversmart
 
Posts: 27
Joined: Tue Jul 05, 2011 7:48 pm

Re: 2.0.2b15 radius and size is now scriptable!

Postby tatt61880 » Sun May 27, 2012 4:35 pm

silversmart wrote:but if we could change the "geom1pos" of the axles this schould work.
but i think its not possible or is it?

best regards


It's not possible to script geom0pos, geom1pos with Algodoo 2.0.2 b15.
I may found a good way to solve this issue. ;)
Rating: rated 5
Filesize: 27.06 kB
Comments: 1
Ratings: 1
download
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

Re: 2.0.2b15 radius and size is now scriptable!

Postby silversmart » Sat Jun 02, 2012 8:19 pm

here is my final scene.
hope you like it

Rating: rated 5.4
Filesize: 50.55 kB
Comments: 10
Ratings: 2
download
silversmart
 
Posts: 27
Joined: Tue Jul 05, 2011 7:48 pm


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 1 guest