Code: Select all
ATTACKED = ("setStateTo: FLEE");
FIGHTING = ("setStateTo: FLEE");
FLEEING = ("setStateTo: FLEE");
Moderators: winston, another_commander
Code: Select all
ATTACKED = ("setStateTo: FLEE");
FIGHTING = ("setStateTo: FLEE");
FLEEING = ("setStateTo: FLEE");
This may be distantly related to:zsozso wrote:I tried with all setAI replaced by switchAI in feudal-target.js, but the stackOverflow errors still occur. The only difference is that now the log does not mention the script feudal-target.js, only feudal-challengerhomeAI.plist such as :Then this keeps repeating several times. So there seems to be some internal problem in the AI plist state-machine itself.Code: Select all
[ai.error.stackOverflow]: ***** ERROR: AI stack overflow for <ShipEntity 0xe80eed0>{"Prinz-Class Zerstoerer (Erinain)"} in feudal-challengerhomeAI.plist: FLEE -- stack: [ai.error.stackOverflow.dump]: 31: feudal-challenger2AI.plist: ATTACK_SHIP [ai.error.stackOverflow.dump]: 30: feudal-challengerhomeAI.plist: FLEE [ai.error.stackOverflow.dump]: 29: feudal-challengerhomeAI.plist: FLEE
This worked! I see no more error messages after removing those, and the defeated ship now turns around and heads back to the base (Hunting Lodge) while before it kept going away (fleeing) indefinitely.Ramirez wrote:The feudal-challengerhomeAI is only there to return the NPC to the station once the challenge has been completed, so really there's no need to trigger more flee actions. Try removing the following lines from the GO_TO_STATION state:Code: Select all
ATTACKED = ("setStateTo: FLEE"); FIGHTING = ("setStateTo: FLEE"); FLEEING = ("setStateTo: FLEE");
Code: Select all
this.disableSystems = function()
{
if(player.ship.equipmentStatus("EQ_CLOAKING_DEVICE") == "EQUIPMENT_OK")
{ player.ship.setEquipmentStatus("EQ_CLOAKING_DEVICE", "EQUIPMENT_DAMAGED")
player.consoleMessage("Cloaking Device disabled")
}
if(player.ship.equipmentStatus("EQ_ENERGY_BOMB") == "EQUIPMENT_OK")
{ player.ship.setEquipmentStatus("EQ_ENERGY_BOMB", "EQUIPMENT_DAMAGED")
player.consoleMessage("Energy Bomb disabled")
}
this.storeMissileArray = player.ship.missiles;
player.ship.awardEquipment("EQ_MISSILE_REMOVAL")
player.ship.awardEquipment("EQ_FEUDAL_FLARE_MINE")
}
this.restoreSystems = function()
{ if(player.ship.equipmentStatus("EQ_CLOAKING_DEVICE") == "EQUIPMENT_DAMAGED")
{ player.ship.setEquipmentStatus("EQ_CLOAKING_DEVICE", "EQUIPMENT_OK")
player.consoleMessage("Cloaking Device re-enabled")
}
if(player.ship.equipmentStatus("EQ_ENERGY_BOMB") == "EQUIPMENT_DAMAGED")
{ player.ship.setEquipmentStatus("EQ_ENERGY_BOMB", "EQUIPMENT_OK")
player.consoleMessage("Energy Bomb re-enabled")
}
player.ship.awardEquipment("EQ_MISSILE_REMOVAL")
for(restoreCounter = 0;restoreCounter<this.storeMissileArray.length;restoreCounter++)
{
player.ship.awardEquipment(this.storeMissileArray[restoreCounter].equipmentKey);
}
}
this.$disableSystems
and this.$restoreSystems
, and generally putting a '$' in front of all self-defined functions (as opposed to event handlers). Don't forget to put it in also in the places where the functions are called.Which is fine, as long as the player cannot save and reload his game between the switches. If he could and would, all local variables would be gone.zsozso wrote:But I did make a simplification by skipping the stringification and stored in local variable instead of mission variable.
That sounds like a small change in the challenge duel code is due, since it now states that returning to the lodge (without winning ..) or jumping out of system forfeits the challenge.Commander McLane wrote:Which is fine, as long as the player cannot save and reload his game between the switches. If he could and would, all local variables would be gone.zsozso wrote:But I did make a simplification by skipping the stringification and stored in local variable instead of mission variable.
Actually it is, as even save anywhere does save at the main station. It just cleverly moves you to it, enables the save and then moves you back to where you originally were. So you will be docked at the main station when you do save.Lone_Wolf wrote:(main station alone is not enough, as with save anywhere you can save from other stations also)