Encountered some issues with inheritance,
PHP Code:
//#GS3
class BaseClass {
var baseclassvar : number = 3;
function overwriteMe() : string {
return "You shouldn't see me without accessing baseclass";
}
}
class InheritanceTest extends BaseClass {
function overwriteMe() : string {
return "You should see me!";
}
}
function onCreated() : void {
//var BaseClassTest : BaseClass = new BaseClass();
//echo(BaseClassTest.baseclassvar);
var TestObj : InheritanceTest = new InheritanceTest();
echo(TestObj.baseclassvar);
echo(TestObj.overwriteMe());
}
would spit out,
PHP Code:
Weapon/GUI-script Twinny/GS3-Inheritance added/updated by Twinny
Script: Couldn't create object: type BaseClass is not existing in function onCreated in script of Twinny/GS3-Inheritance
Script: Function TestObj.overwriteMe not found in function onCreated in script of Twinny/GS3-Inheritance
0
Next, uncommenting the lines resulted in,
PHP Code:
Weapon/GUI-script Twinny/GS3-Inheritance added/updated by Twinny
Script: Couldn't create object: type BaseClass is not existing in function onCreated in script of Twinny/GS3-Inheritance
Script: Function TestObj.overwriteMe not found in function onCreated in script of Twinny/GS3-Inheritance
0
bytecode:1305: TypeError: Cannot read property 'name' of null
typeName = stub.name.extends.name;
^
Will keep running the old NPC script until server restart.
I was going to try and do a var BaseTestObj : BaseClass = TestObj; but figured it wouldn't get me too far
