[Mod] Aggressive AI 2.5 (2019.01.18) - Support Ended.

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Checha
Posts: 11
Joined: Tue, 5. Apr 05, 23:25
x4

Re: [Mod] Aggressive AI 2.0 - Modular AI Update

Post by Checha » Fri, 11. Jan 19, 20:18

I have a little issue between the turret's "attack my target" mode and this mod.

With the reduced target adquisition time the turrets on that mode shut down in about 5 seconds, which mean that when you arrive to the shoot range they are almost always closed and you need to retarget or get hit for them to go alive.

Is there any way they can stay up while there is a target or that they work like the "attack enemies" mode and they automatically turn up when there are targets on range?

StonedMajorTom
Posts: 27
Joined: Fri, 21. Dec 18, 14:43
x4

Re: [Mod] Aggressive AI 2.0 - Modular AI Update

Post by StonedMajorTom » Fri, 11. Jan 19, 22:17

7ate9tin11s wrote:
Fri, 11. Jan 19, 19:11
StonedMajorTom wrote:
Fri, 11. Jan 19, 18:55
I give the fleet the command to attack a station. ALL s/m ships fly on zero to the station and stop moving there.
Nice! If it is just s/m ships then the problem is in the fight.attack.object.fighter.xml attack script only. Will be easier to find now.

As a hotfix before I get a patch out, you can delete all instances of fight.attack.object.fighter.xml from the AAI modules to revert that file to vanilla for now.
ok the "fight.attack.object.fighter.xml" isnt the problem for not moving s/m and drones with a "attack station" command. (saw it in my test)

BUT
after i tried this i moved out file by file in the main module (aai core). i found out that the problematic file is -> "fight.attack.object.bigtarget.xml" in the main module! (AAI Core)
removing this file solved the problem with not moving s/m/drones ships.

My aktive modules are:
AAI Core
Targeting
Station
Escort
Minesweeping

also i saw in my test that the fighters come back before the station is fully destroyed. i have to give the attack command multiple times. same for destroyers.

7ate9tin11s
Posts: 813
Joined: Fri, 11. Nov 05, 23:18
x4

Re: [Mod] Aggressive AI 2.0 - Modular AI Update

Post by 7ate9tin11s » Fri, 11. Jan 19, 22:40

StonedMajorTom wrote:
Fri, 11. Jan 19, 22:17
BUT
after i tried this i moved out file by file in the main module (aai core). i found out that the problematic file is -> "fight.attack.object.bigtarget.xml" in the main module! (AAI Core)
removing this file solved the problem with not moving s/m/drones ships.
Correct, bigtarget is used for stations/capship attacks by smaller ships. My bad there, posting without the files in front of me does that.

7ate9tin11s
Posts: 813
Joined: Fri, 11. Nov 05, 23:18
x4

Re: [Mod] Aggressive AI 2.0 - Modular AI Update

Post by 7ate9tin11s » Fri, 11. Jan 19, 23:42

Bigtarget issue verified. Current author status: :?

Hmmm...looks like vanilla is set to exit attacking if a component is killed while you are supposed to be targeting it and not when the station/ship hosting the component is killed. tricky.

Think I have figured out a fix for the exiting issue, now tracing the sit still and die...

Ok, sit and die found...need to fix in a couple places. Forgot to add in the player age for some times :oops:

Having to backport some fixes into medium so it recognizes and reacts to big targets appropriately as the underlying combat script may be for big versus little targets
Last edited by 7ate9tin11s on Sat, 12. Jan 19, 02:16, edited 1 time in total.

User avatar
alexalsp
Posts: 1823
Joined: Fri, 18. Jul 14, 05:28
x4

Re: [Mod] Aggressive AI 2.0 - Modular AI Update

Post by alexalsp » Sat, 12. Jan 19, 01:32

1.51 beta 1

Code: Select all

[General] 0.00 ======================================
[=ERROR=] 0.00 No matching node for path '//aiscript/attention[@min='unknown']/actions/do_while[@value='$target.isoperational and this.ship.defencenpc.exists']/do_if[@value='not $issmall']/do_if[@value='@$frontweapon gt 0']/set_value[@name='$movethreshold_min']' in patch file 'extensions\AAI - Core\aiscripts\move.attack.object.capital.xml'. Skipping node.
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 No matching node for path '//aiscript/attention[@min='unknown']/actions/do_while[@value='$target.isoperational and this.ship.defencenpc.exists']/do_if[@value='not $issmall']/do_if[@value='@$frontweapon gt 0']/set_value[@name='$movethreshold_max']' in patch file 'extensions\AAI - Core\aiscripts\move.attack.object.capital.xml'. Skipping node.
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 No matching node for path '//aiscript/attention[@min='unknown']/actions/do_while[@value='$target.isoperational and this.ship.defencenpc.exists']/do_if[@value='not $issmall']/do_if[@value='@$frontweapon gt 0']/do_if[@value='$distance gt $movethreshold_max or $distance lt $movethreshold_min']/get_safe_pos/@allowyaxis' in patch file 'extensions\AAI - Core\aiscripts\move.attack.object.capital.xml'. Skipping node.
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 No matching node for path '//aiscript/attention[@min='unknown']/actions/do_while[@value='$target.isoperational and this.ship.defencenpc.exists']/do_if[@value='not $issmall']/do_if[@value='@$frontweapon gt 0']/do_if[@value='$distance gt $movethreshold_max or $distance lt $movethreshold_min']/do_if[@value='$target.distanceto.[$target.sector, $pos] gt $movethreshold_max or $target.distanceto.[$target.sector, $pos] lt $movethreshold_min']/get_safe_pos/@allowyaxis' in patch file 'extensions\AAI - Core\aiscripts\move.attack.object.capital.xml'. Skipping node.
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 No matching node for path '//aiscript/attention[@min='unknown']/actions/do_while[@value='$target.isoperational and this.ship.defencenpc.exists']/do_if[@value='not $issmall']/do_if[@value='@$frontweapon gt 0']/do_elseif[@value='$distance le $movethreshold_max and $distance ge $movethreshold_min']/do_if[@value='not ($isstation or $frontweapon == 2)']/get_safe_pos/@allowyaxis' in patch file 'extensions\AAI - Core\aiscripts\move.attack.object.capital.xml'. Skipping node.
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 No matching node for path '//aiscript/attention[@min='unknown']/actions/do_while[@value='$target.isoperational and this.ship.defencenpc.exists']/do_if[@value='not $issmall']/do_if[@value='@$frontweapon gt 0']/do_elseif[@value='$distance le $movethreshold_max and $distance ge $movethreshold_min']/do_else[2]/get_safe_pos/@allowyaxis' in patch file 'extensions\AAI - Core\aiscripts\move.attack.object.capital.xml'. Skipping node.
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 No matching node for path '//aiscript/attention[@min='unknown']/actions/do_while[@value='$target.isoperational and this.ship.defencenpc.exists']/do_if[@value='not $issmall']/do_if[@value='@$frontweapon gt 0']/do_if[@value='$distance gt $movethreshold_max or $distance lt $movethreshold_min']/do_else/set_value[@name='$boost']' in patch file 'extensions\AAI - Core\aiscripts\move.attack.object.capital.xml'. Skipping node.
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 No matching node for path '//aiscript/attention[@min='unknown']/actions/do_while[@value='$target.isoperational and this.ship.defencenpc.exists']/do_if[@value='not $issmall']/do_if[@value='@$frontweapon gt 0']/do_elseif[@value='$distance le $movethreshold_max and $distance ge $movethreshold_min']/do_if[@value='not ($isstation or $frontweapon == 2)']/@chance' in patch file 'extensions\AAI - Core\aiscripts\move.attack.object.capital.xml'. Skipping node.
[General] 0.00 ======================================
[General] 0.00 ======================================


7ate9tin11s
Posts: 813
Joined: Fri, 11. Nov 05, 23:18
x4

Re: [Mod] Aggressive AI 2.0 - Modular AI Update

Post by 7ate9tin11s » Sat, 12. Jan 19, 02:08

alexalsp wrote:
Sat, 12. Jan 19, 01:32
1.51 beta 1

Code: Select all

[General] 0.00 ======================================
[=ERROR=] 0.00 No matching node for path '//aiscript/attention[@min='unknown']/actions/do_while[@value='$target.isoperational and this.ship.defencenpc.exists']/do_if[@value='not $issmall']/do_if[@value='@$frontweapon gt 0']/set_value[@name='$movethreshold_min']' in patch file 'extensions\AAI - Core\aiscripts\move.attack.object.capital.xml'. Skipping node.
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 No matching node for path '//aiscript/attention[@min='unknown']/actions/do_while[@value='$target.isoperational and this.ship.defencenpc.exists']/do_if[@value='not $issmall']/do_if[@value='@$frontweapon gt 0']/set_value[@name='$movethreshold_max']' in patch file 'extensions\AAI - Core\aiscripts\move.attack.object.capital.xml'. Skipping node.
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 No matching node for path '//aiscript/attention[@min='unknown']/actions/do_while[@value='$target.isoperational and this.ship.defencenpc.exists']/do_if[@value='not $issmall']/do_if[@value='@$frontweapon gt 0']/do_if[@value='$distance gt $movethreshold_max or $distance lt $movethreshold_min']/get_safe_pos/@allowyaxis' in patch file 'extensions\AAI - Core\aiscripts\move.attack.object.capital.xml'. Skipping node.
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 No matching node for path '//aiscript/attention[@min='unknown']/actions/do_while[@value='$target.isoperational and this.ship.defencenpc.exists']/do_if[@value='not $issmall']/do_if[@value='@$frontweapon gt 0']/do_if[@value='$distance gt $movethreshold_max or $distance lt $movethreshold_min']/do_if[@value='$target.distanceto.[$target.sector, $pos] gt $movethreshold_max or $target.distanceto.[$target.sector, $pos] lt $movethreshold_min']/get_safe_pos/@allowyaxis' in patch file 'extensions\AAI - Core\aiscripts\move.attack.object.capital.xml'. Skipping node.
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 No matching node for path '//aiscript/attention[@min='unknown']/actions/do_while[@value='$target.isoperational and this.ship.defencenpc.exists']/do_if[@value='not $issmall']/do_if[@value='@$frontweapon gt 0']/do_elseif[@value='$distance le $movethreshold_max and $distance ge $movethreshold_min']/do_if[@value='not ($isstation or $frontweapon == 2)']/get_safe_pos/@allowyaxis' in patch file 'extensions\AAI - Core\aiscripts\move.attack.object.capital.xml'. Skipping node.
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 No matching node for path '//aiscript/attention[@min='unknown']/actions/do_while[@value='$target.isoperational and this.ship.defencenpc.exists']/do_if[@value='not $issmall']/do_if[@value='@$frontweapon gt 0']/do_elseif[@value='$distance le $movethreshold_max and $distance ge $movethreshold_min']/do_else[2]/get_safe_pos/@allowyaxis' in patch file 'extensions\AAI - Core\aiscripts\move.attack.object.capital.xml'. Skipping node.
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 No matching node for path '//aiscript/attention[@min='unknown']/actions/do_while[@value='$target.isoperational and this.ship.defencenpc.exists']/do_if[@value='not $issmall']/do_if[@value='@$frontweapon gt 0']/do_if[@value='$distance gt $movethreshold_max or $distance lt $movethreshold_min']/do_else/set_value[@name='$boost']' in patch file 'extensions\AAI - Core\aiscripts\move.attack.object.capital.xml'. Skipping node.
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 No matching node for path '//aiscript/attention[@min='unknown']/actions/do_while[@value='$target.isoperational and this.ship.defencenpc.exists']/do_if[@value='not $issmall']/do_if[@value='@$frontweapon gt 0']/do_elseif[@value='$distance le $movethreshold_max and $distance ge $movethreshold_min']/do_if[@value='not ($isstation or $frontweapon == 2)']/@chance' in patch file 'extensions\AAI - Core\aiscripts\move.attack.object.capital.xml'. Skipping node.
[General] 0.00 ======================================
[General] 0.00 ======================================

Not running nor supporting beta. Nor will I ever be. I will make fixes when it goes live.

User avatar
alexalsp
Posts: 1823
Joined: Fri, 18. Jul 14, 05:28
x4

Re: [Mod] Aggressive AI 2.0 - Modular AI Update

Post by alexalsp » Sat, 12. Jan 19, 02:28

I do not care. I just informed you.
When you fix it, it's your own business. :)

Warnoise
Posts: 674
Joined: Mon, 7. Mar 16, 23:47

Re: [Mod] Aggressive AI 2.0 - Modular AI Update

Post by Warnoise » Sat, 12. Jan 19, 03:58

7ate9tin11s wrote:
Fri, 11. Jan 19, 23:42
Bigtarget issue verified. Current author status: :?

Hmmm...looks like vanilla is set to exit attacking if a component is killed while you are supposed to be targeting it and not when the station/ship hosting the component is killed. tricky.

Think I have figured out a fix for the exiting issue, now tracing the sit still and die...

Ok, sit and die found...need to fix in a couple places. Forgot to add in the player age for some times :oops:

Having to backport some fixes into medium so it recognizes and reacts to big targets appropriately as the underlying combat script may be for big versus little targets
Even with bigtarget deleted, M ships dont fire missiles.

When i disabled AI core S/M ship behavior works a lot better. So i think the problem doesnt only lie in bigtarget, but somewhere else too

7ate9tin11s
Posts: 813
Joined: Fri, 11. Nov 05, 23:18
x4

Re: [Mod] Aggressive AI 2.0 - Modular AI Update

Post by 7ate9tin11s » Sat, 12. Jan 19, 04:52

Huh, in my debugging I may have found a way to disable escorts going rogue and following things through gates. :lol: Please let me know if it worked!

Fixed most of the versus station issues, medium ships now reliably use their main weapons, all smaller ships can move when attacking stations again, and a host of other small fixes.

Whoever came up with the schizophrenic pilot versus gunner dichotomy and then decided mediums should just use the full featured small fighter combat script for only the movement parts needs a lesson in keeping it simple :rant:

Anyways, 2.1 is up. Enjoy!

darthraven
Posts: 80
Joined: Sat, 12. Apr 08, 04:48
x4

Re: [Mod] Aggressive AI 2.1

Post by darthraven » Sat, 12. Jan 19, 16:06

Just updated to the latest version 2.1. I noticed a new module player stations, is it normal that is only has a content xml file and no cat/dat files?

BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7411
Joined: Mon, 15. Dec 03, 18:53
x4

Re: [Mod] Aggressive AI 2.1

Post by BlackRain » Sat, 12. Jan 19, 16:31

Code: Select all

[=ERROR=] 2103.86 Error in AI script fight.attack.object.fighter on entity 0x4a575: Evaluated component 0x3f335 'XEN M Pulse Turret Mk1' is not of class object
* Expression: $target
Found this error

7ate9tin11s
Posts: 813
Joined: Fri, 11. Nov 05, 23:18
x4

Re: [Mod] Aggressive AI 2.1

Post by 7ate9tin11s » Sat, 12. Jan 19, 16:51

darthraven wrote:
Sat, 12. Jan 19, 16:06
Just updated to the latest version 2.1. I noticed a new module player stations, is it normal that is only has a content xml file and no cat/dat files?
That's what I get for being tired and posting it right before bed. Thought of a small fix this morning anyways so hotfix incoming soon :roll:

7ate9tin11s
Posts: 813
Joined: Fri, 11. Nov 05, 23:18
x4

Re: [Mod] Aggressive AI 2.1

Post by 7ate9tin11s » Sat, 12. Jan 19, 16:53

BlackRain wrote:
Sat, 12. Jan 19, 16:31

Code: Select all

[=ERROR=] 2103.86 Error in AI script fight.attack.object.fighter on entity 0x4a575: Evaluated component 0x3f335 'XEN M Pulse Turret Mk1' is not of class object
* Expression: $target
Found this error
:o ...that is unique. I wonder if the component was destroyed between finding it and beginning to attack it...really wish it had a line number.

Mr.Freud
Posts: 302
Joined: Sat, 16. Nov 13, 20:20
x4

Re: [Mod] Aggressive AI 2.1

Post by Mr.Freud » Sat, 12. Jan 19, 17:17

Can I remove the mod from old save? or do I have to start a new game?
(want to play beta 1.51 for now)

7ate9tin11s
Posts: 813
Joined: Fri, 11. Nov 05, 23:18
x4

Re: [Mod] Aggressive AI 2.1

Post by 7ate9tin11s » Sat, 12. Jan 19, 17:39

Mr.Freud wrote:
Sat, 12. Jan 19, 17:17
Can I remove the mod from old save? or do I have to start a new game?
(want to play beta 1.51 for now)
Yes, it can be removed without issue in most cases. For the moment it is not beta compatible either (egosoft is tinkering with their broken fight scripts and our changes conflict :roll: ). However, I would remove it, load your game, save your game, then go to the 1.51 beta.

I will update the scripts for beta when it is released and the changes stop.

7ate9tin11s
Posts: 813
Joined: Fri, 11. Nov 05, 23:18
x4

Re: [Mod] Aggressive AI 2.2

Post by 7ate9tin11s » Sat, 12. Jan 19, 18:29

Missing files added in and some small changes made for escorts to keep them in the proper sector better.

darthraven
Posts: 80
Joined: Sat, 12. Apr 08, 04:48
x4

Re: [Mod] Aggressive AI 2.1

Post by darthraven » Sat, 12. Jan 19, 19:32

7ate9tin11s wrote:
Sat, 12. Jan 19, 16:51
darthraven wrote:
Sat, 12. Jan 19, 16:06
Just updated to the latest version 2.1. I noticed a new module player stations, is it normal that is only has a content xml file and no cat/dat files?
That's what I get for being tired and posting it right before bed. Thought of a small fix this morning anyways so hotfix incoming soon :roll:
You know I just had a thought about this aggressive player stations module of the mod. Your warning really putting me off turning it on *once you hotfix it*, I have this nightmare of the station accidentally hitting a faction ship while it's trying to kill a xenon or something and then becoming "red" to that faction which might make them send in bigger ships that I then have to kill and lose more faction standing (I'm guessing this might be the reason for your warning). But I was thinking, what if you changed it so that mod only affects defense stations? By that I mean when you make a station with an admin section and no production sections the game gives it the defense station icon and Betty says it is too when you select/target it.

Because defense stations don't make anything their docking traffic is almost non-existent just like the NPC ones (unless your doing a sort of roleplay build with habitats that house soldiers of your empire or something), it would mean a much-reduced chance a faction NPC will get hit by accident, plus it would make it worthwhile to make dedicated defense stations, it would be their job to engage enemies instead of factory or complex stations, and it would make the player put these defense stations in strategic places like near gates, superhighways, near/between your factories and such.

You can maybe set it so that the behavior only changes if the station has an admin section? I have little knowledge of modding so I'm just assuming that would be doable.

Any feedback would be great.
Last edited by darthraven on Sat, 12. Jan 19, 20:22, edited 1 time in total.

7ate9tin11s
Posts: 813
Joined: Fri, 11. Nov 05, 23:18
x4

Re: [Mod] Aggressive AI 2.1

Post by 7ate9tin11s » Sat, 12. Jan 19, 19:43

darthraven wrote:
Sat, 12. Jan 19, 19:32
You know I just had a thought about this aggressive player stations module of the mod. Your warning really putting me off turning it on *once you hotfix it*, I have this nightmare of the station accidentally hitting a faction ship while it's trying to kill a xenon or something and then becoming "red" to that faction which might make them send in bigger ships that I then have to kill and lose more faction standing (I'm guessing this might be the reason for your warning). But I was thinking, what if you changed it so that mod only affects defense stations? By that I mean when you make a station with an admin section and no production sections the game gives it the defense station icon and Betty says it is too when you select/target it.

Because defense stations don't make anything their docking traffic is almost non-existent just like the NPC ones (unless your doing a sort of roleplay build with habitats that house soldiers of your empire or something), it would mean a much-reduced chance a faction NPC will get hit by accident, plus it would make it worthwhile to make dedicated defense stations, it would be their job to engage enemies instead of factory or complex stations, and it would make the player put these defense stations in strategic places like near gates, superhighways, near/between your factories and such.

You can maybe set it so that the behavior only chances if the station has an admin section? I have little knowledge of modding so I'm just assuming that would be doable.

Any feedback would be great.
As it is just a simple variable flag on the station (Egosoft built-in the capability, but without any way to activate it!), what is really needed is just a toggle for each station done by talking with the station manager. I just have not had the time to learn the whole conversation scripting and such. I put out a request for someone to make such a mod a while back with no responses at all...thus I assumed there was no real interest and just included this simple fix for those that want it.

Warnoise
Posts: 674
Joined: Mon, 7. Mar 16, 23:47

Re: [Mod] Aggressive AI 2.2

Post by Warnoise » Sun, 13. Jan 19, 16:12

Feedback (version 2.2)

-I set a squad to patrol HoP sector, i found them fighting xenon in Xenon sector (that one near HOP) :(

7ate9tin11s
Posts: 813
Joined: Fri, 11. Nov 05, 23:18
x4

Re: [Mod] Aggressive AI 2.2

Post by 7ate9tin11s » Sun, 13. Jan 19, 17:06

Warnoise wrote:
Sun, 13. Jan 19, 16:12
Feedback (version 2.2)

-I set a squad to patrol HoP sector, i found them fighting xenon in Xenon sector (that one near HOP) :(
To narrow it down, was each squad member set to patrol that sector individually, or was there an escort leader? If there was a leader, were they in the Xenon sector with all their followers (i.e. the followers did nothing wrong and just stayed with the leader)?

My fixes have been concentrated on the followers as I had reports of escorts wandering off, but if the patrol command itself is messed up then there is more to do.

Post Reply

Return to “X4: Foundations - Scripts and Modding”