Readable

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

Readable

Postby Cathier » Sun Dec 25, 2016 2:20 pm

So what does readable() actually do? Like, what's the function executed when calling readable()? What is its purpose?
Cathier
 
Posts: 6
Joined: Fri Sep 11, 2015 7:56 am

Re: Readable

Postby FRA32 » Sun Dec 25, 2016 8:58 pm

As much as I know, readable() enables accessing the readonly variables of something. So if you use readable(this), you get a version of this that allows reading values like geom0, layer, surfaces etc. It could be that my knowledge about this is not 100% correct tho since I can only learn from experimenting with stuff, and this is the most logical explanation for me.
FRA32
 
Posts: 227
Joined: Wed Dec 03, 2014 9:51 pm

Re: Readable

Postby Cathier » Mon Dec 26, 2016 12:32 am

Well, actually it makes a lot of sense now that I think of it. Thanks. Gotta get rid of some global variables then.
Cathier
 
Posts: 6
Joined: Fri Sep 11, 2015 7:56 am

Re: Readable

Postby Kilinich » Mon Dec 26, 2016 9:41 am

Cathier wrote:So what does readable() actually do? Like, what's the function executed when calling readable()? What is its purpose?

It was added in early algodoo version as the only way to read pos, vel, angle and etc. After that in recent version direct read-write access to most properties was added, but some (like linked geom, impulse, surfaces) are still available only via readable() object.
Actually you could see all "readable" variables and values in entity's script menu under bottom line.
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: Readable

Postby Cathier » Wed Dec 28, 2016 8:09 pm

Kilinich wrote:
Cathier wrote:So what does readable() actually do? Like, what's the function executed when calling readable()? What is its purpose?

It was added in early algodoo version as the only way to read pos, vel, angle and etc. After that in recent version direct read-write access to most properties was added, but some (like linked geom, impulse, surfaces) are still available only via readable() object.
Actually you could see all "readable" variables and values in entity's script menu under bottom line.


Thanks! That opens a lot of possibilities for me now. I have a lot of uses for that.

Unfortunately, there doesn't seem to be an actual official documentation about algodoo's engine. It would help a lot of users including me.
Cathier
 
Posts: 6
Joined: Fri Sep 11, 2015 7:56 am


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 2 guests

cron