Screet wrote:I don't see any code to handle the following cases:
1) The ship becomes attacked
2) The wormhole closes
No wonder that they did not return fire...
You are right, therefor I had a proposal for changing the 1.73 pirateAI to:
Code: Select all
"ENTER_WORMHOLE" = {
ENTER = (setDestinationToTarget,
"setDesiredRangeTo: 1.0",
"setSpeedFactorTo: 1.0",
performFlyToRangeFromDestination
);
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: LURK");
"PLAYER WITCHSPACE" = (enterTargetWormhole);
};
This was tested to work. When arriving at the location of a collapsed wormhole it starts with the lurk code. Reaction on attacks on its way to the hole seems bad as it has an flee option by entering the wormhole.
It is in the newAI file you have. (but only will work with 1.72 in its current form)
---
btw. I never saw this bug with pirates but regularly with escorts of leaving traders near the station. (However they use the same code here, so a bug in one means also a bug in the other code)
Around the station the problem is that escorts sometimes start escorting a ship that never was defined to have escorts. e.g. an adder or a moray. When such a small trader ship leaves the system its wormhole often collapses before its escorts reach the wormhole. This way it often leaves behind the escorts in a state you mention. This situation was reproducible enough for me to do actual tests with different AI codes.
Pirates jumping out is rare, and only one it defined by the system as group leader. And only when the leader has its hold full and jumps out, the other pirates start following. With the new code I noticed pirates jumping out sometimes, but never the leader himself. (quite rare event)