Spanw engine help

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

Spanw engine help

Postby Rideg » Wed Apr 21, 2010 9:16 pm

Hello, I'm trying to build a spawn engine that uses three spawners (left, right, middle). the density varies in the difference to the wanted height(scene.my.posdif = e.pos(1) - 10). It doesn't work as it should. I'm thinking that it should go pretty softly but instead it starts to jump on the cords [x, 10] until it falls down so a stabilizer function on the left and right spawners(I've tried a density changing method but it didn't work out properly). If someone could teach me how to do this I would be very thankfull. :P
Image
make sure to check out my work.
User avatar
Rideg
 
Posts: 948
Joined: Tue Dec 15, 2009 5:17 pm
Location: Östersund, Sweden

Re: Spanw engine help

Postby Mystery » Thu Apr 22, 2010 8:55 am

Try
Code: Select all
scene.my.posdif = (e.pos(1) - 10)


I'm not actually understanding what your trying to do though.
User avatar
Mystery
 
Posts: 2802
Joined: Thu Sep 03, 2009 1:16 pm
Location: Southern Australia

Re: Spanw engine help

Postby Mr_Stabby » Thu Apr 22, 2010 3:00 pm

if i understand u correctly you want to produce a variable that controls your thrust depending on your current altitude rite?

try something along the lines of

Code: Select all
desiredAltitude=<desired y location>; thrustConst=<the exact density you need to spawn in order to stay still along y axis>; spawndensity=((desiredaltitude-e.pos(1))/desiredAltitude+1)*thrustConst; spawndensity<0.01?{spawndensity=0.01}:{}


that one should ease into whatever desired pos its looking for but might be a bit slow to get there so you can also implement a speedup system by adding

Code: Select all
desiredAltitude-e.pos(1) > 1(change to whatever scale your on)?{spawndensity=spawndensity*10}:{}


as for moving a hovering spawnengine left and right ive found that rotating the original spawner and compensating the thrust is much more stable/effective/cpu efficient, i used such system in one of my scenes

Rating: rated 6.5
Filesize: 102.9 kB
Comments: 4
Ratings: 4
download


even tho the system is rather spread out all the thrust control script is in the box with "flight control" letters on it, the rest is just wiring to get the info where it needs to go and to get it applied.
Mr_Stabby
 
Posts: 155
Joined: Wed Dec 16, 2009 12:16 am

Re: Spanw engine help

Postby Rideg » Sun Apr 25, 2010 12:20 pm

it hovers at [x, 10] and to make it not tip over I need something that could stabilize it.
Image
make sure to check out my work.
User avatar
Rideg
 
Posts: 948
Joined: Tue Dec 15, 2009 5:17 pm
Location: Östersund, Sweden


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 5 guests