following missle help.

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

following missle help.

Postby Ai Group 1 » Tue Nov 15, 2011 12:55 am

Hello everyone
i want to make a following missle
using thrusters.
i need help with the scripts to do that
i want to attach a laser to the launcher
and the missle will follow what ever the laser is colliding with
so like if the laser is on a box it will follow the box.
PLZ HELP!
Image
Ai Group 1
 
Posts: 10
Joined: Wed Oct 26, 2011 1:41 am

Re: following missle help.

Postby monstertje3 » Tue Nov 15, 2011 8:31 am

make a rectangle, put a laser on front and a thruster on the back.
tadaa, a laserfollowing missile :)
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: following missle help.

Postby Matten » Tue Nov 15, 2011 5:29 pm

For the following you could use a similar system as following hinges, but then modify the script a bit so instead of turning a motor it will activate certain thrusters.
To get the position of the object, use in the onLaserHit of the laser the script:
Code: Select all
e.geom.controllerAcc = {scene.my.objectPos = (readable(owner)).pos; 11}

e.geom.controllerAcc could be another variable of the object, and then you also need to change the 11 (since that's the actual value the controllerAcc (in this case) will get.
Cave Johnson wrote:Do you know who I am? I'm the man who's gonna burn your house down! With the lemons! I'm gonna get my engineers to invent a combustible lemon that burns your house down!
User avatar
Matten
 
Posts: 435
Joined: Mon Apr 05, 2010 2:03 pm
Location: The Netherlands


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 1 guest