Laser data sending

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

Laser data sending

Postby LeeviON » Sun Nov 28, 2010 9:44 pm

So, I've noticed that a couple of scenes have a data variable in the laser, so that it can send data to the receiving object. I couldn't figure out a way to do that myself, so could you guys tell me how it works?

http://www.algodoo.com/algobox/details.php?id=41564

^ an example of scene having a data sender in laser
LeeviON
 
Posts: 4
Joined: Sun Nov 28, 2010 9:38 pm

Re: Laser data sending

Postby electronicboy » Sun Nov 28, 2010 10:27 pm

e.laser.<1> = <2>

1 = The name of the new variable
2 = The data to be contained the variable
When asking for help, READ THE STICKIES!
electronicboy
 
Posts: 1694
Joined: Mon Aug 31, 2009 6:18 pm

Re: Laser data sending

Postby LeeviON » Tue Nov 30, 2010 1:17 pm

It just puts out an error saying something like "Can't find identifier 'e' in [ROOT]"
LeeviON
 
Posts: 4
Joined: Sun Nov 28, 2010 9:38 pm

Re: Laser data sending

Postby electronicboy » Tue Nov 30, 2010 5:52 pm

electronicboy wrote:e.laser.<1> = <2>

1 = The name of the new variable
2 = The data to be contained the variable


The code has to be in the (e)=>{}

so for example, if i wanted a variable called data with a variable of 10.

The onlaserhit code would be

Code: Select all
(e)=>{e.laser.data = 10}


Hope that helps.
When asking for help, READ THE STICKIES!
electronicboy
 
Posts: 1694
Joined: Mon Aug 31, 2009 6:18 pm

Re: Laser data sending

Postby LeeviON » Fri Dec 03, 2010 9:05 pm

Thank you, so much :)
LeeviON
 
Posts: 4
Joined: Sun Nov 28, 2010 9:38 pm


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 1 guest