How to spawn thrusters and lasers

If you have problems installing or running Algodoo, have found a bug or need in-game help - this is it!

How to spawn thrusters and lasers

Postby racergonemad » Fri Jun 07, 2013 3:36 am

Im familiar with spawning things like hinges, springs, fixes, and tracers onto geometries with known geomID's but I have no clue how to spawn thrusters or lasers. I imagine something like:
Code: Select all
(e)=>{scene.addThruster({geom0 := 1; pos := app.mousePos; ____some_more_thruster_properties___})}
My signature is worth a lot of money, So I'm gonna put this stamp instead:
[$20 PER AUTOGRAPH]
racergonemad
 
Posts: 26
Joined: Tue Aug 17, 2010 7:37 am

Re: How to spawn thrusters and lasers

Postby Someone Else » Fri Jun 07, 2013 6:07 am

If you check the bottom of the script menu of a thruster or laser, you'll see the names of the variables attaching it to a particular geom- I believe that it's called "geom", not "geom0".

If you open the console, type "scene.", then press the "TAB" key on your keyboard, you'll see all the different variables, functions, and directories within the "Scene" directory- i.e. everything that starts with "Scene", such as scene.addBox and scene.my.

If I remember correctly, you'll see "Scene.addLaserPen", and probably "scene.addThruster" as you guessed.

So, try these scripts:
Code: Select all
scene.addLaserPen({geom := 1; pos := app.mousePos})
scene.addThruster({geom := 1; relPoint := [0, 0]; force := 5})

Disclaimer: The above codes are untested and may not work. I did not bother with starting up Algodoo in Linux to test these scripts at this time. However, in the event that this code doesn't work, I feel that I have given you the resources necessary to fix the code yourself.
Matthias Wandel is epic, in my humble opinion.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.

ARE YA HAPPY NOW?????

Thymechanic/Phundamentalist

Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
User avatar
Someone Else
 
Posts: 1147
Joined: Sun Nov 21, 2010 10:53 pm
Location: The Milky Way Galaxy

Re: How to spawn thrusters and lasers

Postby racergonemad » Sun Jun 09, 2013 2:30 am

Thank you, That did the trick! I realized my mistake was using "geom0" instead of "geom", which is only used for objects that can attach to 2 geometries like hinges and fixates, unlike lasers or thrusters which attach to only 1. :thumbup:
My signature is worth a lot of money, So I'm gonna put this stamp instead:
[$20 PER AUTOGRAPH]
racergonemad
 
Posts: 26
Joined: Tue Aug 17, 2010 7:37 am


Return to Help / Bug reports

Who is online

Users browsing this forum: No registered users and 2 guests

cron