this.shipDied
in shipScript? Shouldn't it only fire once when it's the script's this.ship that dies?the code looks like this...
Code: Select all
this.shipDied = function()
{
worldScripts["nullgate_main.js"].removeNullgateLocation(galaxyNumber,system.ID,this.ship.primaryRole,this.nullgateState); // remove entry from array
worldScripts["nullgate_main.js"].addNullgateLocation(galaxyNumber,system.ID,"no-nullgate","destroyed"); // add destroyed entry from array
this.ship.switchAI("nullgate_detonateAI.plist"); // this will result in an energy cascade...
this.stopTimer();
}
Code: Select all
{
GLOBAL =
{
ENTER = (becomeEnergyBlast);
};
}
06:31:48.500 [nullgate_main.js]: this.removeNullgateLocation called with parameters galaxy:0, system:7, roleString:working-nullgate, stateString:angry
06:31:48.500 [nullgate_main.js]: Nullgate location record: [0,7,working-nullgate,angry] cannot be removed as does not exist.
06:31:48.500 [nullgate_main.js]: this.addNullgateLocation called with parameters galaxy:0, system:7, roleString:no-nullgate, stateString:destroyed
06:31:48.500 [nullgate_main.js]: One nullgate location record updated: [0,7,no-nullgate,destroyed] added to array.
06:31:48.500 [nullgate_main.js]: this.removeNullgateLocation called with parameters galaxy:0, system:7, roleString:working-nullgate, stateString:angry
06:31:48.500 [nullgate_main.js]: Nullgate location record: [0,7,working-nullgate,angry] cannot be removed as does not exist.
06:31:48.500 [nullgate_main.js]: this.addNullgateLocation called with parameters galaxy:0, system:7, roleString:no-nullgate, stateString:destroyed
06:31:48.500 [nullgate_main.js]: One nullgate location record updated: [0,7,no-nullgate,destroyed] added to array.
06:31:48.501 [ai.error.stackOverflow]: ***** ERROR: AI stack overflow for <ShipEntity 0xc386120>{"Null Gate"} in nullgate_detonateAI.plist: GLOBAL -- stack:
06:31:48.501 [ai.error.stackOverflow.dump]: 31: NullGateAI.plist: IDLE
06:31:48.501 [ai.error.stackOverflow.dump]: 30: nullgate_detonateAI.plist: GLOBAL
06:31:48.501 [ai.error.stackOverflow.dump]: 29: nullgate_detonateAI.plist: GLOBAL
06:31:48.501 [ai.error.stackOverflow.dump]: 28: nullgate_detonateAI.plist: GLOBAL
06:31:48.501 [ai.error.stackOverflow.dump]: 27: nullgate_detonateAI.plist: GLOBAL
06:31:48.501 [ai.error.stackOverflow.dump]: 26: nullgate_detonateAI.plist: GLOBAL
06:31:48.501 [ai.error.stackOverflow.dump]: 25: nullgate_detonateAI.plist: GLOBAL
06:31:48.501 [ai.error.stackOverflow.dump]: 24: nullgate_detonateAI.plist: GLOBAL
06:31:48.501 [ai.error.stackOverflow.dump]: 23: nullgate_detonateAI.plist: GLOBAL
06:31:48.501 [ai.error.stackOverflow.dump]: 22: nullgate_detonateAI.plist: GLOBAL
06:31:48.501 [ai.error.stackOverflow.dump]: 21: nullgate_detonateAI.plist: GLOBAL
06:31:48.501 [ai.error.stackOverflow.dump]: 20: nullgate_detonateAI.plist: GLOBAL
06:31:48.501 [ai.error.stackOverflow.dump]: 19: nullgate_detonateAI.plist: GLOBAL
06:31:48.501 [ai.error.stackOverflow.dump]: 18: nullgate_detonateAI.plist: GLOBAL
06:31:48.501 [ai.error.stackOverflow.dump]: 17: nullgate_detonateAI.plist: GLOBAL
06:31:48.501 [ai.error.stackOverflow.dump]: 16: nullgate_detonateAI.plist: GLOBAL
06:31:48.501 [ai.error.stackOverflow.dump]: 15: nullgate_detonateAI.plist: GLOBAL
06:31:48.501 [ai.error.stackOverflow.dump]: 14: nullgate_detonateAI.plist: GLOBAL
06:31:48.501 [ai.error.stackOverflow.dump]: 13: nullgate_detonateAI.plist: GLOBAL
06:31:48.501 [ai.error.stackOverflow.dump]: 12: nullgate_detonateAI.plist: GLOBAL
06:31:48.501 [ai.error.stackOverflow.dump]: 11: nullgate_detonateAI.plist: GLOBAL
06:31:48.501 [ai.error.stackOverflow.dump]: 10: nullgate_detonateAI.plist: GLOBAL
06:31:48.501 [ai.error.stackOverflow.dump]: 9: nullgate_detonateAI.plist: GLOBAL
06:31:48.501 [ai.error.stackOverflow.dump]: 8: nullgate_detonateAI.plist: GLOBAL
06:31:48.501 [ai.error.stackOverflow.dump]: 7: nullgate_detonateAI.plist: GLOBAL
06:31:48.501 [ai.error.stackOverflow.dump]: 6: nullgate_detonateAI.plist: GLOBAL
06:31:48.501 [ai.error.stackOverflow.dump]: 5: nullgate_detonateAI.plist: GLOBAL
06:31:48.501 [ai.error.stackOverflow.dump]: 4: nullgate_detonateAI.plist: GLOBAL
06:31:48.501 [ai.error.stackOverflow.dump]: 3: nullgate_detonateAI.plist: GLOBAL
06:31:48.501 [ai.error.stackOverflow.dump]: 2: nullgate_detonateAI.plist: GLOBAL
06:31:48.501 [ai.error.stackOverflow.dump]: 1: nullgate_detonateAI.plist: GLOBAL
06:31:48.501 [ai.error.stackOverflow.dump]: 0: nullgate_detonateAI.plist: GLOBAL
06:31:48.503 [script.javaScript.exception.ooliteDefinedError]: ***** JavaScript exception (nullgate_shipscript.js 0.9 - for Oolite 1.75 and later): Error: Native exception: AI stack overflow for <ShipEntity 0xc386120>{"Null Gate" position: (-490424, -371947, 484524) scanClass: CLASS_STATION status: STATUS_DEAD}
06:31:48.503 [script.javaScript.stackTrace]: 0 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.503 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
06:31:48.503 [script.javaScript.stackTrace]: 1 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.503 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
06:31:48.503 [script.javaScript.stackTrace]: 2 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.503 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
06:31:48.503 [script.javaScript.stackTrace]: 3 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.503 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
06:31:48.503 [script.javaScript.stackTrace]: 4 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.503 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
06:31:48.503 [script.javaScript.stackTrace]: 5 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.503 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
06:31:48.503 [script.javaScript.stackTrace]: 6 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.503 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
06:31:48.503 [script.javaScript.stackTrace]: 7 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.503 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
06:31:48.503 [script.javaScript.stackTrace]: 8 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.503 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
06:31:48.503 [script.javaScript.stackTrace]: 9 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.503 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
06:31:48.504 [script.javaScript.stackTrace]: 10 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.504 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
06:31:48.504 [script.javaScript.stackTrace]: 11 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.504 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
06:31:48.504 [script.javaScript.stackTrace]: 12 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.504 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
06:31:48.504 [script.javaScript.stackTrace]: 13 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.504 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
06:31:48.504 [script.javaScript.stackTrace]: 14 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.504 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
06:31:48.504 [script.javaScript.stackTrace]: 15 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.504 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
06:31:48.504 [script.javaScript.stackTrace]: 16 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.504 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
06:31:48.504 [script.javaScript.stackTrace]: 17 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.504 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
06:31:48.504 [script.javaScript.stackTrace]: 18 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.504 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
06:31:48.504 [script.javaScript.stackTrace]: 19 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.504 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
06:31:48.504 [script.javaScript.stackTrace]: 20 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.504 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
06:31:48.504 [script.javaScript.stackTrace]: 21 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.504 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
06:31:48.504 [script.javaScript.stackTrace]: 22 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.504 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
06:31:48.504 [script.javaScript.stackTrace]: 23 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.504 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
06:31:48.504 [script.javaScript.stackTrace]: 24 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.504 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
06:31:48.504 [script.javaScript.stackTrace]: 25 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.504 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
06:31:48.504 [script.javaScript.stackTrace]: 26 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.504 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
06:31:48.505 [script.javaScript.stackTrace]: 27 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.505 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
06:31:48.505 [script.javaScript.stackTrace]: 28 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.505 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
06:31:48.505 [script.javaScript.stackTrace]: 29 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.505 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
06:31:48.505 [script.javaScript.stackTrace]: 30 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.505 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
06:31:48.505 [script.javaScript.stackTrace]: 31 (nullgate_shipscript.js:161) <anonymous function>
06:31:48.505 [script.javaScript.stackTrace]: this: [Script "nullgate_shipscript.js" version 0.9 - for Oolite 1.75 and later]
I can work around easily by deleting this.shipDied after it has run once, but this seems a bit buggy....