Wormhole followers
Posted: Sun Mar 21, 2010 12:07 pm
Now that we have the ability to follow ships through a wormhole, would it be nice to have a chance (10%?) that a hostile would follow a player?
For information and discussion about Oolite.
https://bb.oolite.space/
I'm not sure nice is the term I'd use.. but it makes sense, and even has precedent, in The Dark Wheel.Cmdr James wrote:Now that we have the ability to follow ships through a wormhole, would it be nice to have a chance (10%?) that a hostile would follow a player?
Code: Select all
"ENTER_WORMHOLE" = {
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: LURK");
ENTER = (
setDestinationToTarget,
"setDesiredRangeTo: 1.0",
"setSpeedFactorTo: 1.0",
performFlyToRangeFromDestination
);
"PLAYER WITCHSPACE" = (enterTargetWormhole);
"TARGET_LOST" = ("setStateTo: LURK");
};
Code: Select all
"ATTACK_SHIP" = {
ATTACKED = (setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP");
"ATTACKED_BY_CLOAKED" = ("setStateTo: FLEE_FOR_CLOAKED");
"ENERGY_LOW" = ("setStateTo: FLEE");
ENTER = (performAttack);
"ENTER WORMHOLE" = ("setStateTo: ENTER_WORMHOLE");
"INCOMING_MISSILE" = (fightOrFleeMissile, "setStateTo: FLEE");
"PLAYER WITCHSPACE" = (enterTargetWormhole);
"TARGET_DESTROYED" = ("setStateTo: COLLECT_LOOT");
"TARGET_LOST" = ("setStateTo: COLLECT_LOOT");
};
Code: Select all
[ai.message.receive]: AI pirateAI.plist for Tiger Mark I 265 in state 'TRAVEL_TO_LURK_AREA' receives message 'DESIRED_RANGE_ACHIEVED'
[ai.takeAction]: Tiger Mark I 265 to take action setStateTo: LURK
[ai.message.receive]: AI pirateAI.plist for Tiger Mark I 265 in state 'TRAVEL_TO_LURK_AREA' receives message 'EXIT'
[ai.message.receive]: AI pirateAI.plist for Tiger Mark I 265 in state 'LURK' receives message 'ENTER'
[ai.takeAction]: Tiger Mark I 265 to take action setSpeedTo: 0.0
[ai.takeAction]: Tiger Mark I 265 to take action performIdle
[ai.takeAction]: Tiger Mark I 265 to take action scanForRandomMerchantmen
[ai.takeAction]: Tiger Mark I 265 to take action pauseAI: 5.0
[ai.message.receive]: AI pirateAI.plist for Tiger Mark I 265 in state 'LURK' receives message 'TARGET_FOUND'
[ai.takeAction]: Tiger Mark I 265 to take action setTargetToFoundTarget
[ai.takeAction]: Tiger Mark I 265 to take action checkGroupOddsVersusTarget
[ai.takeAction]: Tiger Mark I 265 to take action scanForRandomMerchantmen
[ai.takeAction]: Tiger Mark I 265 to take action pauseAI: 5.0
[ai.message.receive]: AI pirateAI.plist for Tiger Mark I 265 in state 'LURK' receives message 'TARGET_FOUND'
[ai.takeAction]: Tiger Mark I 265 to take action setTargetToFoundTarget
[ai.takeAction]: Tiger Mark I 265 to take action checkGroupOddsVersusTarget
[ai.message.receive]: AI pirateAI.plist for Tiger Mark I 265 in state 'LURK' receives message 'ODDS_BAD'
[ai.message.receive]: AI pirateAI.plist for Tiger Mark I 265 in state 'LURK' receives message 'ATTACKED'
[ai.takeAction]: Tiger Mark I 265 to take action setTargetToPrimaryAggressor
[ai.takeAction]: Tiger Mark I 265 to take action setStateTo: ATTACK_SHIP
[ai.message.receive]: AI pirateAI.plist for Tiger Mark I 265 in state 'LURK' receives message 'EXIT'
[ai.message.receive]: AI pirateAI.plist for Tiger Mark I 265 in state 'ATTACK_SHIP' receives message 'ENTER'
[ai.takeAction]: Tiger Mark I 265 to take action performAttack
[ai.message.receive]: AI pirateAI.plist for Tiger Mark I 265 in state 'ATTACK_SHIP' receives message 'ATTACKED'
[ai.takeAction]: Tiger Mark I 265 to take action setTargetToPrimaryAggressor
[ai.takeAction]: Tiger Mark I 265 to take action setStateTo: ATTACK_SHIP
[ai.message.receive]: AI pirateAI.plist for Tiger Mark I 265 in state 'ATTACK_SHIP' receives message 'EXIT'
[ai.message.receive]: AI pirateAI.plist for Tiger Mark I 265 in state 'ATTACK_SHIP' receives message 'ENTER'
[ai.takeAction]: Tiger Mark I 265 to take action performAttack
[ai.message.receive]: AI pirateAI.plist for Tiger Mark I 265 in state 'ATTACK_SHIP' receives message 'ATTACKED'
[ai.takeAction]: Tiger Mark I 265 to take action setTargetToPrimaryAggressor
[ai.takeAction]: Tiger Mark I 265 to take action setStateTo: ATTACK_SHIP
[ai.message.receive]: AI pirateAI.plist for Tiger Mark I 265 in state 'ATTACK_SHIP' receives message 'EXIT'
[ai.message.receive]: AI pirateAI.plist for Tiger Mark I 265 in state 'ATTACK_SHIP' receives message 'ENTER'
[ai.takeAction]: Tiger Mark I 265 to take action performAttack
[ai.message.receive]: AI pirateAI.plist for Tiger Mark I 265 in state 'ATTACK_SHIP' receives message 'ODDS_LEVEL'
[ai.message.receive]: AI pirateAI.plist for Tiger Mark I 265 in state 'ATTACK_SHIP' receives message 'ATTACKED'
[ai.takeAction]: Tiger Mark I 265 to take action setTargetToPrimaryAggressor
[ai.takeAction]: Tiger Mark I 265 to take action setStateTo: ATTACK_SHIP
[ai.message.receive]: AI pirateAI.plist for Tiger Mark I 265 in state 'ATTACK_SHIP' receives message 'EXIT'
[ai.message.receive]: AI pirateAI.plist for Tiger Mark I 265 in state 'ATTACK_SHIP' receives message 'ENTER'
[ai.takeAction]: Tiger Mark I 265 to take action performAttack
[ai.message.receive]: AI pirateAI.plist for Tiger Mark I 265 in state 'ATTACK_SHIP' receives message 'ATTACKED'
[ai.takeAction]: Tiger Mark I 265 to take action setTargetToPrimaryAggressor
[ai.takeAction]: Tiger Mark I 265 to take action setStateTo: ATTACK_SHIP
[ai.message.receive]: AI pirateAI.plist for Tiger Mark I 265 in state 'ATTACK_SHIP' receives message 'EXIT'
[ai.message.receive]: AI pirateAI.plist for Tiger Mark I 265 in state 'ATTACK_SHIP' receives message 'ENTER'
[ai.takeAction]: Tiger Mark I 265 to take action performAttack
[ai.message.receive]: AI pirateAI.plist for Tiger Mark I 265 in state 'ATTACK_SHIP' receives message 'ATTACKED'
[ai.takeAction]: Tiger Mark I 265 to take action setTargetToPrimaryAggressor
[ai.takeAction]: Tiger Mark I 265 to take action setStateTo: ATTACK_SHIP
[ai.message.receive]: AI pirateAI.plist for Tiger Mark I 265 in state 'ATTACK_SHIP' receives message 'EXIT'
[ai.message.receive]: AI pirateAI.plist for Tiger Mark I 265 in state 'ATTACK_SHIP' receives message 'ENTER'
[ai.takeAction]: Tiger Mark I 265 to take action performAttack
[ai.message.receive]: AI pirateAI.plist for Tiger Mark I 265 in state 'ATTACK_SHIP' receives message 'PLAYER WITCHSPACE'
[ai.takeAction]: Tiger Mark I 265 to take action enterTargetWormhole
It is the command "wormholeEscorts" or "wormholeGroup" that sends a "ENTER WORMHOLE" to all group members. Only than they are in a state to react on a player leaving the system.Commander McLane wrote:What I don't know is under which circumstances the ENTER WORMHOLE message is sent to NPCs. I would have to do some testing to find that out.
Code: Select all
this.shipWillEnterWitchspace = function(cause)
{
if (cause === "standard jump")
{
var allPirates = system.shipsWithPrimaryRole("pirate", player.ship, 25E3);
if (allPirates.length > 0)
{
allPirates[0].AIState = "EXIT_SYSTEM";
allPirates[0].reactToAIMessage("UPDATE");
}
}
}
So this is the culprit. Is it possible to change/circumvent this? As it is now, theEric Walch wrote:The only real problem is that the player himself does not generate a wormhole (in scripting terms) when normal hyperspacing.
Code: Select all
"PLAYER WITCHSPACE" = (enterTargetWormhole);
True ... I hadn't thought about the delay. In which case there's not much point in bothering to implement any routine for traders following you, as you'd never see them! Unfortunately the same would apply for pirates following the player with a view to ambushing them. The only way a hostile ship could feasibly follow a player through a wormhole would be if the player is fleeing from combat via witchspace.Commander McLane wrote:Good point concerning the traders. My last suggestion was centred around pirateAI, so it wouldn't apply for traders.
On the other hand, as far as following traders are concerned, it would be logical to implement a certain delay. If we're talking about jumping out from a station, the wormhole would be located at least 10 km away from it, and any trader would have to reach it first. So they would only jump in about 10 to 15 seconds after the player, which normally gives you enough time to fire up your torus drive and be gone. And if there happens to be another ship at the witchpoint as you arrive, you would be mass-locked anyway.