Data Realms Fan Forums http://45.55.195.193/ |
|
Userdata table? http://45.55.195.193/viewtopic.php?f=73&t=30738 |
Page 1 of 1 |
Author: | Ymte [ Sun Mar 18, 2012 7:55 pm ] |
Post subject: | Userdata table? |
Hello I was messing around with the cc console and noticed something: the actor, the vectors, and the managers are of type "Userdata". However, it is possible to index them like a table. For example, MyActor.Pos is of type userdata, but it is valid to index MyActor.Pos as a table (MyActor.Pos.x, MyActor.Pos["x"]). In standard Lua, this is not possible. How is this done? I'm also programming a game in C++ with Lua scripting , and I'd like to implement this behaviour, because it lets you bind variables directly without the need for set/get functions. Thanks in advance! BTW I got access to the Lua source, so it's okay if I have to modificate it. |
Author: | Abdul Alhazred [ Mon Mar 19, 2012 4:55 pm ] |
Post subject: | Re: Userdata table? |
AFAIK CC use LuaBind |
Page 1 of 1 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |