laser ID

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

laser ID

Postby HavingPhun » Sun Apr 17, 2011 4:48 pm

When each laser is created does it have an ID like laser #1,#2,#3 and is there a way to find out what there ID is. Also can you use that ID when scripting like laser1.color = [2,5,6,4] ? Thanks!
I won't be on the forums much for a while. But maybe once in a while.
User avatar
HavingPhun
 
Posts: 178
Joined: Sun Feb 06, 2011 10:42 pm

Re: laser ID

Postby bozbez » Sun Apr 17, 2011 5:01 pm

Lasers do have EntityIDs, you can find it out by selecting the laser and ctrl-c, and pasting it into somwhere and looking through until you find entityID=45, or similar, and, as far as i know, i don't think you can use the ID when scripting though.
Image

Go here. Now. That's Now. Not in 5 minutes. Now.
User avatar
bozbez
 
Posts: 149
Joined: Tue Apr 12, 2011 7:01 pm

Re: laser ID

Postby Someone Else » Sun Apr 17, 2011 7:05 pm

You can't use entityIDs in Thyme. It would make things so much easier though...
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: laser ID

Postby TC42 » Sun Apr 17, 2011 7:18 pm

You do use geomIDs though, they're used in spawning.
Image
Spambot wrote:Nowadays, memes usually are studied less in the field of biology, but more with the arena of psychology along with sociology. But, the major area of a meme, getting embraced and imitated all the time is what’s at any core connected with any meme.
User avatar
TC42
 
Posts: 984
Joined: Sun Jan 09, 2011 1:53 pm
Location: $ sudo apt get-install sandwich_

Re: laser ID

Postby HavingPhun » Sun Apr 17, 2011 9:40 pm

Im gonna suggest that. Also do lasers have a geom ID
I won't be on the forums much for a while. But maybe once in a while.
User avatar
HavingPhun
 
Posts: 178
Joined: Sun Feb 06, 2011 10:42 pm

Re: laser ID

Postby bozbez » Mon Apr 18, 2011 9:44 am

Lasers dont have geomIDs as soon as you put them into the scene, but you can give them geomIDs by, in the script menu, typing down at the bottom, geomID = 27 (obviously the number can be changed). This destroys the entityID though (does it matter?).
Image

Go here. Now. That's Now. Not in 5 minutes. Now.
User avatar
bozbez
 
Posts: 149
Joined: Tue Apr 12, 2011 7:01 pm

Re: laser ID

Postby Kilinich » Mon Apr 18, 2011 12:17 pm

bozbez wrote:Lasers dont have geomIDs as soon as you put them into the scene, but you can give them geomIDs by, in the script menu, typing down at the bottom, geomID = 27 (obviously the number can be changed). This destroys the entityID though (does it matter?).


Changing geomID, entityID (as any other hidden property) via script window don't affect anything at all.
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: laser ID

Postby HavingPhun » Mon Apr 18, 2011 12:39 pm

Can i use geomID in scripting? like
Code: Select all
geomID27.color = [4,56,78,44]
? Also is that how you spell it because arent they case sensitive. And is that how you would code it?
I won't be on the forums much for a while. But maybe once in a while.
User avatar
HavingPhun
 
Posts: 178
Joined: Sun Feb 06, 2011 10:42 pm

Re: laser ID

Postby Someone Else » Mon Apr 18, 2011 2:45 pm

I really wish you could do that, though. The only way you really can use geomID is in spawning, as TC42 said.
Code: Select all
scene.addCircle({
   pos := e.pos;
   geomID = 142
   });
scene.addLaserPen({
   pos := e.pos;
   geom := 142
   })
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: laser ID

Postby Kilinich » Mon Apr 18, 2011 3:53 pm

HavingPhun wrote:Can i use geomID in scripting? like
Code: Select all
geomID27.color = [4,56,78,44]
? Also is that how you spell it because arent they case sensitive. And is that how you would code it?


There is a way to do such things but you need to get target object somehow (collide or hit with laser) and it will work only in runtime (can't save it).
For example you can use onCollide = (e) => {scene.my.obj1 = e.this} and after that scene.my.obj1.color is valid variable.

geomID is dynamic and can be changed even on undo.
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: laser ID

Postby Someone Else » Mon Apr 18, 2011 5:35 pm

Kilinich wrote:geomID is dynamic and can be changed even on undo.

Now why would they do that? :wtf:
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: laser ID

Postby bozbez » Mon Apr 18, 2011 8:31 pm

Kilinich wrote:
bozbez wrote:Lasers dont have geomIDs as soon as you put them into the scene, but you can give them geomIDs by, in the script menu, typing down at the bottom, geomID = 27 (obviously the number can be changed). This destroys the entityID though (does it matter?).


Changing geomID, entityID (as any other hidden property) via script window don't affect anything at all.


It does with me? :crazy:
Image

Go here. Now. That's Now. Not in 5 minutes. Now.
User avatar
bozbez
 
Posts: 149
Joined: Tue Apr 12, 2011 7:01 pm


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 7 guests