I've come across this multiple times and I have no idea what the cause is.
When I create an unnamed ScriptObject with a defined class, it fails to inherit all of the default functions of ScriptObjects.. ::schedule, ::dump, ::getClassName, etc.
It seems to happen particularly while add-ons are executing, but occasionally afterward too.
%this = new ScriptObject() {
class = "Structure";
file = %file;
rotation = 0;
position = "0 0 0";
};
if(%this.getClassName() !$= "ScriptObject") { // I have no clue why this happens, but it does
error("Registered a non-scriptobject script object?");
%this.delete();
return;
}
if(!isObject(StructureGroup))
new ScriptGroup(StructureGroup);
StructureGroup.add(%this);
If I load the server first, then execute my add-on, then call the command, it works fine.
It occurs regardless of the namespace I use, I've tried others thinking that Structure may be some default engine class.