lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hello again everyone,

I don't know if the title of the email is appropriate to my problem or
not, but I couldn't think of anything else :)

In my project I have many entities all using their own lua states
spawned from a central thread with lua_newthread.  Each of these
entities may have a script loaded into them (if they are to do
anything).  

The situation is this.  If I have one entity set up via a script (let's
call it script A) to have a certain piece of functionality.  If I want
to extend/override this functionality in another script (B), what is the
best approach?

I'm trying to view script A as a base class, and script B as a derived
class.  I've tried setting up scipt A as a module and using "require" in
script B, but had problems with storing data when I have multiple
references to script A.  I then tried doing a dofile("scipt A") to see
if that would import all the functions, but that didn't work either.  At
which point I drew a blank. 

Any thoughts?

TIA,

Tom


 
Tom Miles
 creative assembly ---------------------------------------------------------------------------- 
         DISCLAIMER 
This email is sent by The Creative Assembly Limited company No. 03425917, registered in England &Wales registered office 27 Great West Road, Middlesex, TW8 9BW, England. The contents of this e-mail and any attachments are confidential to the intended recipient and may also be legally privileged. Unless you are the named addressee (or authorised to receive for the addressee) of this email you may not copy, disclose or distribute it to anyone else. If you have received this email in error, please notify us immediately by e-mail on postmaster@creative-assembly.co.uk and then delete the email and any copies. The Creative Assembly Limited have made all reasonable efforts to ensure that this e-mail and any attached documents or software are free from software viruses, but it is the recipient's responsibility to confirm this.