Lasers

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

Lasers

Postby Jelmerholland » Mon Sep 14, 2009 10:40 pm

I have no clue how the lasers work, with all the scripts, can somebody make a small tutorial for the lasers? like what you can do with the maxrays, and stuff like that, and how you can calculate a distance with the lasers, i can't find anything to measure with inside the lasers. I tried to measure the maxrays, and fadedist, but that's a static number :(

Tnx
User avatar
Jelmerholland
 
Posts: 61
Joined: Mon Aug 31, 2009 7:51 pm
Location: NL

Re: Lasers

Postby Ian151 » Tue Sep 15, 2009 12:18 am

according to some scenes i've seen I think it's like how the app.mousepos variable works, because there are 2 positions on the imaginary grid in algodoo that are being created with lasers and/or oncollide, and then math does the rest in terms of how far the two coordinates are from each other. There's also the extremely simple way to read distance, with multiple lasers at different fadedistances, but that is not perfect and can fill up fast. Those latter choices are mostly for using simple distances with a few lengths measured.
"THE BEST 2 PLAYER SCENE EVER MADE!!!" - ianno
http://www.algodoo.com/algobox/details.php?id=24204
Image
User avatar
Ian151
 
Posts: 47
Joined: Tue Sep 01, 2009 12:02 am

Re: Lasers

Postby Jelmerholland » Tue Sep 15, 2009 8:22 pm

And how do u get the laserpos?
smth like laser.pos? app.mousepos, so app.laserpos? but that won't work, becuz you have more lasers, and what's the poscode for the touchingdistance? I can do the math myself, but i need those 2 codes
User avatar
Jelmerholland
 
Posts: 61
Joined: Mon Aug 31, 2009 7:51 pm
Location: NL

Re: Lasers

Postby standardtoaster » Tue Sep 15, 2009 8:59 pm

To get the position of the laser hit it would be e.geom.pos
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: Lasers

Postby Jelmerholland » Tue Sep 15, 2009 10:37 pm

Doesn't work, when i do this:

-Define variables
Scene.my.laser = [0,0] or Scene.my.laser = 0
Scene.my.geom = [0,0] or Scene.my.geom = 0

-Change it
Scene.my.laser = e.laser.pos;
Scene.my.geom = e.geom.pos

I putted these codes in the laser collision line.

What is wrong? Can somebody please help me? I want to learn to work with lazors... :D

Tnx
User avatar
Jelmerholland
 
Posts: 61
Joined: Mon Aug 31, 2009 7:51 pm
Location: NL

Re: Lasers

Postby standardtoaster » Tue Sep 15, 2009 10:43 pm

Sorry, it is actually e.pos not e.geom.pos
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: Lasers

Postby Jelmerholland » Wed Sep 16, 2009 1:32 pm

but thats the pos of the geom? or the laser?
And what's the pos of the laser if that's the geom? becuz you will need both i guess?
User avatar
Jelmerholland
 
Posts: 61
Joined: Mon Aug 31, 2009 7:51 pm
Location: NL


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 2 guests

cron