Shard Posted December 5, 2009 Share Posted December 5, 2009 I would like to pack away the basic Lua classes like base, properties, etc so that the user doesn't have access to them. I've found that when I do dofile("abstract::base.lua") in the windmill object, it works and loads fine but when I did it in the waterplane entity it didn't work and I received the following error in the Engine.log: Loading model "d:/source code control/appiled project/current version/models/entities/environment/waterplane/environment_waterplane.gmf"... Loading mesh "d:/source code control/appiled project/current version/models/entities/environment/waterplane/environment_waterplane.gmf"... Lua error: cannot open abstract::base.lua: Invalid argument Is there some way I can make all these dofiles abstract so that I can hide away all the basic Lua files? Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
Nilium Posted December 5, 2009 Share Posted December 5, 2009 dofile(...) is part of the Lua base package. It's not going to recognize any sort of abstract:: protocol. You need to write your own dofile/require/import/etc. routine if you want it to. E.g., do local p_dofile = dofile dofile = function(filename) local cap = string.match(filename, "^abstract:.+)") return p_dofile((cap and AbstractPath(cap)) or filename) end end Quote MacBook Pro 15.4", Intel Core 2 Duo T9600 2.80GHz, 4GB 1066MHz DDR3, GeForce 9400M 256MB, GeForce 9600M GT 512MB - Mac OS 10.6.2, Vista32 Link to comment Share on other sites More sharing options...
Josh Posted December 5, 2009 Share Posted December 5, 2009 The Lua command dofile is used so that compiled script files can be run. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.