Fractal Softworks Forum
Starsector => Mods => Modding => Topic started by: Histidine on December 23, 2015, 03:57:12 AM
-
So, I want to be able to control the following behaviors for NPC fleets:
- Don't pursue enemies
- Pursue enemies if provoked (get too close or are fighting fleets not hostile to us), break off if they're outrunning us
- Pursue any enemy entering sensor range doggedly until we lose them or they die
And separately controllable:
- Don't assist ally fleets in battle
- Assist ally fleets in battle
And separately controllable:
- Don't attack enemies (particularly player) if they have transponder off and are of unknown identity
- Do attack such fleets
(#3 can be done with the pirate fleet memory key, but this has potentially unwanted side effects like making the affected fleet turn its transponder off. #2 requires the trade fleet memory flag, which seems even worse.)
Can this be done? If not, could it be implemented for 0.7.2?
Specific use cases where I've encountered issues:
Spoiler
- The "Follow Me" ability in Nexerelin currently gives nearby fleets an ORBIT_AGGRESSIVE assignment targeted on the player. This makes them basically ignore the order if there's a nearby enemy fleet they can chase all day. This can be solved with the ORBIT_PASSIVE assignment, but now said fleets won't come to the player's aid (ally battle) if player is attacked, which can be a huge noob trap.
- Templars should opportunistically attack the player fleet if the player is the enemy, even if player's transponder is off, like pirates and Pathers do. (Else it becomes too easy to avoid a fight simply by keeping transponder off) But they should not do so too aggressively, as being constantly hunted down would get annoying very quickly given how powerful and far-seeing Templar fleets are.
-
I would suggest having a script change it from ORBIT_AGGRESSIVE to ORBIT_PASSIVE to INTERCEPT or whatever other assignments make sense. With INTERCEPT you should have fine-enough-grained control over what they attack so you wouldn't, hopefully, need to write the whole AI from scratch.
-
If a fleet normally wouldn't assist the player in combat, is there a way to make it do so when the fleet encounter dialog starts?
(i.e. without having to check the fleet's surroundings constantly and give it an aggressive assignment if it looks like anyone is about to fight the player)
-
Setting its $isPatrol to true should do it, I believe.
Another very sure-fire way to do that would be to provide a FIDPI implementation that overrides the pullInNearbyFleets() method, though that's somewhat less future-proof.