I am trying to define the functions for a ScriptObject in multiple files. Take, for instance, the following three files.
new ScriptObject(MyObject);
exec("./log.cs");
exec("./example.cs");
function MyObject::log(%m) {
echo("Logged Message:" SPC %m);
}
function MyObject::exampleFunction() {
%this.log("The example function was called.");
}
If I run
MyObject.exampleFunction(); in the console, I get the error:
Add-Ons/Script_MyScriptName/example.cs (0): Unable to find object: '' attempting to call function 'log'Is this just impossible? Should I just use a different ScriptObject in each TorqueScript file?