View unanswered posts | View active topics It is currently Fri Mar 29, 2024 7:44 am



Reply to topic  [ 2 posts ] 
 Userdata table? 
Author Message

Joined: Sat Feb 05, 2011 2:05 pm
Posts: 1
Reply with quote
Post 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 :mrgreen: , 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.


Sun Mar 18, 2012 7:55 pm
Profile
DRL Developer
DRL Developer

Joined: Tue Aug 11, 2009 5:09 am
Posts: 395
Reply with quote
Post Re: Userdata table?
AFAIK CC use LuaBind


Mon Mar 19, 2012 4:55 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.064s | 17 Queries | GZIP : Off ]