Overriding engine lua files
Posted: Sun Jun 26, 2011 9:33 pm
If I want to fool around with basic engine changes in a module, such as a modifying the energy and turn system, what would be the best way to override the default engine lua files (things living in /games/engines/default/engine/ directory).
Looking at the require statements, in /game/modules/tome/load.lua for example, I see things like:
require engine.KeyBind
require mod.class.Store
mod clearly has been set to represent the module's given top directory (i.e. /game/modules/mymod/) and is going to the class directory and loading the Store.lua file.
And engine somehow knows to go to /games/engines/default/engine/ directory to grab KeyBind.lua.
Is it best to just create an engine directory under the module and redirect any engine loads you want to overload to mod.engine.MyNewEngineFile ? Or is there an alternative method that is prefered? I notice the /game/engines/default directory and wonder if the /games/engines/ was intended to contain multiple engines. Is there a method of getting engine.whatever to point at such a different directory?
Thanks.
Looking at the require statements, in /game/modules/tome/load.lua for example, I see things like:
require engine.KeyBind
require mod.class.Store
mod clearly has been set to represent the module's given top directory (i.e. /game/modules/mymod/) and is going to the class directory and loading the Store.lua file.
And engine somehow knows to go to /games/engines/default/engine/ directory to grab KeyBind.lua.
Is it best to just create an engine directory under the module and redirect any engine loads you want to overload to mod.engine.MyNewEngineFile ? Or is there an alternative method that is prefered? I notice the /game/engines/default directory and wonder if the /games/engines/ was intended to contain multiple engines. Is there a method of getting engine.whatever to point at such a different directory?
Thanks.