Wing 2.0.1

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

Wing 2.0.1

Postby Kilinich » Sat Dec 24, 2011 9:37 pm

Since we have thrusters and "readable", time to upgrade wings.
Now it's really simple (should be but it's not :D )

Code for thruster's force:

Code: Select all
_airForceMult = 1;
force = {
    geomData := readable(Scene.entityByGeomID((readable(owner)).geom));
    v := geomData.vel;
    n := [math.sin(geomData.angle), math.cos(geomData.angle)];
    (v(0) * n(0) - v(1) * n(1)) * owner._airForceMult
}


Force scalable via _airForceMult variable (create it in thruster's script menu).

Rating: rated 6.8
Filesize: 14.56 kB
Comments: 3
Ratings: 5
download


p.s. There is a bug in 2.0.1 b15 (today version) - undo kills all scripts, so you need to reload scene. :(
Plus you can't clone wing, but can copy-paste it :?
Last edited by Kilinich on Fri Jan 06, 2012 8:29 pm, edited 2 times in total.
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: Wing 2.0.1

Postby Nxdt » Sat Dec 24, 2011 10:25 pm

Damnit kilinich. I've had this idea for ages but never been able to make it. Thanks for finally doing it. :thumbup:
User avatar
Nxdt
 
Posts: 1019
Joined: Mon Aug 31, 2009 6:32 pm
Location: Scotland!

Re: Wing 2.0.1

Postby monstertje3 » Sun Dec 25, 2011 11:24 am

nice! you should have removed the killer planes though
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: Wing 2.0.1

Postby hecta » Wed Feb 22, 2012 2:28 am

I copied the script but the trusters force was -0.00012 or something like that why ?does it have to be on your wing (truster)
hecta
 
Posts: 21
Joined: Thu Feb 02, 2012 3:39 am

Re: Wing 2.0.1

Postby Nxdt » Wed Feb 22, 2012 2:51 pm

If you download the scene and save the actual thruster as a phunlet, the script should work fine every time you use it, don't copy/paste, just drag it out your phunlet menu. I think you might have forgotten to copy the _airforcemult varible or have adjusted the thruster slider to a constant value, this overides any scripts.
User avatar
Nxdt
 
Posts: 1019
Joined: Mon Aug 31, 2009 6:32 pm
Location: Scotland!


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 2 guests

cron