[MOD] Reaction Force
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
-
- Posts: 1
- Joined: Mon, 3. Dec 18, 21:37
Re: [MOD] Reaction Force
Hooray! Looking forward to it. I'm not sure if it's been reported, but I tried your fix on Github, and it appears now they don’t get stuck on protect ship, but now I've noticed they sometimes get stuck on a patrol command, and while stuck on this command will ignore ships being attacked and not respond. I still have some more testing to do though, but I thought I'd let you know just in case!
Re: [MOD] Reaction Force
That's good to hear! Could you also please change the notifications to actually say which sector the reaction force is reacting (preferably even which ship/fleet)? Maybe I'm missing something, but for me it only reports two long sets of numbers that I just stare helplessly at.
-
- Posts: 52
- Joined: Sun, 21. Apr 13, 21:44
Re: [MOD] Reaction Force
This mod is really useful. Response fleets manage to save my miners most of the time, especially after making the changes suggested above.
They do comm me constantly though, saying "Awaiting orders" whenever they kill something, which is a little annoying. Any way to prevent that?
They do comm me constantly though, saying "Awaiting orders" whenever they kill something, which is a little annoying. Any way to prevent that?
Re: [MOD] Reaction Force
Yeah, turn off the notifications in the game. There is a global option for it. I turned it off.drowningfly wrote: ↑Fri, 2. Apr 21, 12:35This mod is really useful. Response fleets manage to save my miners most of the time, especially after making the changes suggested above.
They do comm me constantly though, saying "Awaiting orders" whenever they kill something, which is a little annoying. Any way to prevent that?
-
- Posts: 52
- Joined: Sun, 21. Apr 13, 21:44
Re: [MOD] Reaction Force
Thank you sir!BlackRain wrote: ↑Fri, 2. Apr 21, 16:22Yeah, turn off the notifications in the game. There is a global option for it. I turned it off.drowningfly wrote: ↑Fri, 2. Apr 21, 12:35This mod is really useful. Response fleets manage to save my miners most of the time, especially after making the changes suggested above.
They do comm me constantly though, saying "Awaiting orders" whenever they kill something, which is a little annoying. Any way to prevent that?
Re: [MOD] Reaction Force
I've observed some buggy (perhaps?) behaviour when the reaction force command is set for a fleet. I'm using the nightly version from end of march.
A destroyer assigned to asteroid belt as reaction force with range 0 works as expected. He regurarly seeks out Kha'ak, destroys the group and then continues patrolling until new targets arrive. The defense behaviour also works as intended, but as has been said here and on the other platforms, I think this is overkill and should be removed. It's essentially only locking the ship idle for 5 minutes.
Now a fighter wing, however, does not act at all when set to reaction force. I have set 5 corvettes and 10 heavy fighters as a patrol fleet for fast interception, a corvette is the leader. They have since not reacted even once to any spawning hostiles. Their settings are
Dock if idle: [ ]
Range: 0/5
React to ship: [x] - 100%
React to station: [x] - 100%
React to player: [x]
React to emergency: [ ]
Notifications: [ ]
Changing react settings does not cause any change in behaviour, neither ticking the checkboxes, nor the health settings. I have confirmed that several miners have been attacked and also killed. Neither with shields nor when their hull gets damaged the patrol reacts. They just keep randomly floating through the sector.
A destroyer assigned to asteroid belt as reaction force with range 0 works as expected. He regurarly seeks out Kha'ak, destroys the group and then continues patrolling until new targets arrive. The defense behaviour also works as intended, but as has been said here and on the other platforms, I think this is overkill and should be removed. It's essentially only locking the ship idle for 5 minutes.
Now a fighter wing, however, does not act at all when set to reaction force. I have set 5 corvettes and 10 heavy fighters as a patrol fleet for fast interception, a corvette is the leader. They have since not reacted even once to any spawning hostiles. Their settings are
Dock if idle: [ ]
Range: 0/5
React to ship: [x] - 100%
React to station: [x] - 100%
React to player: [x]
React to emergency: [ ]
Notifications: [ ]
Changing react settings does not cause any change in behaviour, neither ticking the checkboxes, nor the health settings. I have confirmed that several miners have been attacked and also killed. Neither with shields nor when their hull gets damaged the patrol reacts. They just keep randomly floating through the sector.
-
- Posts: 52
- Joined: Sun, 21. Apr 13, 21:44
Re: [MOD] Reaction Force
I have no problems with corvette and fighter reaction fleets using the version on page 1 when the fleet members are set to "attack". I have noticed that if they are set to "mimic" only the leader functions while the rest do nothing. I also use check Respond to Distress.
-
- Posts: 21
- Joined: Wed, 10. Aug 05, 15:57
Re: [MOD] Reaction Force
Does the version from github work for anyone?
-
- Posts: 21
- Joined: Wed, 10. Aug 05, 15:57
Re: [MOD] Reaction Force
Anyone having RF following protected ships too long use this file until an official fix.
order.fight.reactionforce.xml
Place it inside your Extensions folder or where the mod is installed and overwrite the already existing file.
../X4 Foundations\extensions\shib_reactionforce\aiscripts
Edit: Relinked file to a different host if you still cant access let me know.
Edit#2: Fixed Station protection not working, now it works fine, also enabled ship protection script and applied a fix to make it work as intended.
Edit#3: Fleets fixed, now you can use the fleets with Reaction Force Orders.
Special thanks to Aftokinito on discord for his code.
order.fight.reactionforce.xml
Place it inside your Extensions folder or where the mod is installed and overwrite the already existing file.
../X4 Foundations\extensions\shib_reactionforce\aiscripts
Edit: Relinked file to a different host if you still cant access let me know.
Edit#2: Fixed Station protection not working, now it works fine, also enabled ship protection script and applied a fix to make it work as intended.
Edit#3: Fleets fixed, now you can use the fleets with Reaction Force Orders.
Special thanks to Aftokinito on discord for his code.
Last edited by monish_05m on Fri, 9. Apr 21, 06:27, edited 2 times in total.
Re: [MOD] Reaction Force
Busy easter weekend and was my kids birthday monday, should be able to debug and push out some fixes this week (hopefully).
-----
My Mods
Go Home Drone, Reaction Force, Disable Story, Pay The Builder, Landlord, Training Exercise
Github with the latest (Unstable) Versions
Nexus Page
Steam Workshop Page
My Mods
Go Home Drone, Reaction Force, Disable Story, Pay The Builder, Landlord, Training Exercise
Github with the latest (Unstable) Versions
Nexus Page
Steam Workshop Page
Re: [MOD] Reaction Force
This mod is awesome! Thanks for making it.
I had to modify it locally, taking out the "Protect" part of the script so they wouldn't follow a ship that is now safe for too long and leave others in need to fry on their own.
After doing that, everything worked as expected, but only if I keep my reaction forces to be one ship only (and have several separate reaction forces); you can't have a >1 ship fleet as a reaction force. I can work around it but it'd be cool to have e.g. 10 fighters in a fleet that zoom in together to help
I had to modify it locally, taking out the "Protect" part of the script so they wouldn't follow a ship that is now safe for too long and leave others in need to fry on their own.
After doing that, everything worked as expected, but only if I keep my reaction forces to be one ship only (and have several separate reaction forces); you can't have a >1 ship fleet as a reaction force. I can work around it but it'd be cool to have e.g. 10 fighters in a fleet that zoom in together to help
-
- Posts: 21
- Joined: Wed, 10. Aug 05, 15:57
Re: [MOD] Reaction Force
use the file I posted above, fleets are working with that.HateDread wrote: ↑Thu, 8. Apr 21, 10:20This mod is awesome! Thanks for making it.
I had to modify it locally, taking out the "Protect" part of the script so they wouldn't follow a ship that is now safe for too long and leave others in need to fry on their own.
After doing that, everything worked as expected, but only if I keep my reaction forces to be one ship only (and have several separate reaction forces); you can't have a >1 ship fleet as a reaction force. I can work around it but it'd be cool to have e.g. 10 fighters in a fleet that zoom in together to help
Re: [MOD] Reaction Force
There are actually a few errors that popped up with that.monish_05m wrote: ↑Fri, 9. Apr 21, 06:25use the file I posted above, fleets are working with that.HateDread wrote: ↑Thu, 8. Apr 21, 10:20This mod is awesome! Thanks for making it.
I had to modify it locally, taking out the "Protect" part of the script so they wouldn't follow a ship that is now safe for too long and leave others in need to fry on their own.
After doing that, everything worked as expected, but only if I keep my reaction forces to be one ship only (and have several separate reaction forces); you can't have a >1 ship fleet as a reaction force. I can work around it but it'd be cool to have e.g. 10 fighters in a fleet that zoom in together to help
-
- Posts: 21
- Joined: Wed, 10. Aug 05, 15:57
Re: [MOD] Reaction Force
I'm not an expert modder or good at coding like you, so I did what I could, errors can be safely ignored if you uncheck Enable notification option when you give the Mod order, Been playing with this for over 100hrs without any issues and everything working even fleets.BlackRain wrote: ↑Fri, 9. Apr 21, 14:12There are actually a few errors that popped up with that.monish_05m wrote: ↑Fri, 9. Apr 21, 06:25use the file I posted above, fleets are working with that.HateDread wrote: ↑Thu, 8. Apr 21, 10:20This mod is awesome! Thanks for making it.
I had to modify it locally, taking out the "Protect" part of the script so they wouldn't follow a ship that is now safe for too long and leave others in need to fry on their own.
After doing that, everything worked as expected, but only if I keep my reaction forces to be one ship only (and have several separate reaction forces); you can't have a >1 ship fleet as a reaction force. I can work around it but it'd be cool to have e.g. 10 fighters in a fleet that zoom in together to help
Re: [MOD] Reaction Force
I wasn't criticizing you, just mentioning I noticed errors in the debug log but I didn't really look at it yet.monish_05m wrote: ↑Fri, 9. Apr 21, 15:20I'm not an expert modder or good at coding like you, so I did what I could, errors can be safely ignored if you uncheck Enable notification option when you give the Mod order, Been playing with this for over 100hrs without any issues and everything working even fleets.
Re: [MOD] Reaction Force
Code: Select all
[=ERROR=] 182200.14 Script warning: AI script 'reactionforce' references AI order 'ProtectShip' via <create_order> with unexpected parameter 'radiusanchorspace'
[=ERROR=] 182200.14 Script warning: AI script 'reactionforce' references AI order 'ProtectShip' via <create_order> with unexpected parameter 'pursuetargets'
[=ERROR=] 182200.14 Script warning: AI script 'reactionforce' references AI order 'ProtectShip' via <create_order> with unexpected parameter 'radiusanchorpos'
[=ERROR=] 182200.14 Script warning: AI script 'reactionforce' references AI order 'ProtectShip' via <create_order> with unexpected parameter 'squad_attack'
[=ERROR=] 182200.14 Script warning: AI script 'reactionforce' references AI order 'ProtectShip' via <create_order> with unexpected parameter 'allowothertargets'
[=ERROR=] 182200.14 Script warning: AI script 'reactionforce' references AI order 'Attack' via <create_order> with unexpected parameter 'timeout'
Also, this too but this is from the original version and not new changes.
Code: Select all
Line 87712: [=ERROR=] 182200.14 extensions\shib_reactionforce\aiscripts\order.fight.reactionforce.xml(200): Script node 'resume' is not allowed in this context.
Re: [MOD] Reaction Force
Those are all base attack parameters. He either meant to call the attack order (I believe the id is literally "Attack") OR he mistakenly believed protectship had the same params.BlackRain wrote: ↑Fri, 9. Apr 21, 16:17See, these are some of the errors popping up. This means none of those parameters are working as intended for that particular command. Not necessarily a big deal though in this case I guess.Code: Select all
[=ERROR=] 182200.14 Script warning: AI script 'reactionforce' references AI order 'ProtectShip' via <create_order> with unexpected parameter 'radiusanchorspace' [=ERROR=] 182200.14 Script warning: AI script 'reactionforce' references AI order 'ProtectShip' via <create_order> with unexpected parameter 'pursuetargets' [=ERROR=] 182200.14 Script warning: AI script 'reactionforce' references AI order 'ProtectShip' via <create_order> with unexpected parameter 'radiusanchorpos' [=ERROR=] 182200.14 Script warning: AI script 'reactionforce' references AI order 'ProtectShip' via <create_order> with unexpected parameter 'squad_attack' [=ERROR=] 182200.14 Script warning: AI script 'reactionforce' references AI order 'ProtectShip' via <create_order> with unexpected parameter 'allowothertargets' [=ERROR=] 182200.14 Script warning: AI script 'reactionforce' references AI order 'Attack' via <create_order> with unexpected parameter 'timeout'
Also, this too but this is from the original version and not new changes.
Code: Select all
Line 87712: [=ERROR=] 182200.14 extensions\shib_reactionforce\aiscripts\order.fight.reactionforce.xml(200): Script node 'resume' is not allowed in this context.
My Contributions to the Community:
X4: Wing Hotkeys
X4: Urgent Orders
X4: Subsystem Targeting Orders
X4: Starbright: Variable Sector Sunlight Values
Landing page with all my mods
X4: Wing Hotkeys
X4: Urgent Orders
X4: Subsystem Targeting Orders
X4: Starbright: Variable Sector Sunlight Values
Landing page with all my mods
Re: [MOD] Reaction Force
Yeah, i was basically saying that but in less detail. Those params don’t work with that order. The resume start one is a little more serious but still not a big dealAlkeena wrote: ↑Sun, 11. Apr 21, 06:40Those are all base attack parameters. He either meant to call the attack order (I believe the id is literally "Attack") OR he mistakenly believed protectship had the same params.BlackRain wrote: ↑Fri, 9. Apr 21, 16:17See, these are some of the errors popping up. This means none of those parameters are working as intended for that particular command. Not necessarily a big deal though in this case I guess.Code: Select all
[=ERROR=] 182200.14 Script warning: AI script 'reactionforce' references AI order 'ProtectShip' via <create_order> with unexpected parameter 'radiusanchorspace' [=ERROR=] 182200.14 Script warning: AI script 'reactionforce' references AI order 'ProtectShip' via <create_order> with unexpected parameter 'pursuetargets' [=ERROR=] 182200.14 Script warning: AI script 'reactionforce' references AI order 'ProtectShip' via <create_order> with unexpected parameter 'radiusanchorpos' [=ERROR=] 182200.14 Script warning: AI script 'reactionforce' references AI order 'ProtectShip' via <create_order> with unexpected parameter 'squad_attack' [=ERROR=] 182200.14 Script warning: AI script 'reactionforce' references AI order 'ProtectShip' via <create_order> with unexpected parameter 'allowothertargets' [=ERROR=] 182200.14 Script warning: AI script 'reactionforce' references AI order 'Attack' via <create_order> with unexpected parameter 'timeout'
Also, this too but this is from the original version and not new changes.
Code: Select all
Line 87712: [=ERROR=] 182200.14 extensions\shib_reactionforce\aiscripts\order.fight.reactionforce.xml(200): Script node 'resume' is not allowed in this context.
-
- Posts: 21
- Joined: Wed, 10. Aug 05, 15:57
Re: [MOD] Reaction Force
Hey, im the noob in question here, please help me out. My knowledge of code and modding is brand spanking new, so i accept all the mistakes.Alkeena wrote: ↑Sun, 11. Apr 21, 06:40Those are all base attack parameters. He either meant to call the attack order (I believe the id is literally "Attack") OR he mistakenly believed protectship had the same params.BlackRain wrote: ↑Fri, 9. Apr 21, 16:17See, these are some of the errors popping up. This means none of those parameters are working as intended for that particular command. Not necessarily a big deal though in this case I guess.Code: Select all
[=ERROR=] 182200.14 Script warning: AI script 'reactionforce' references AI order 'ProtectShip' via <create_order> with unexpected parameter 'radiusanchorspace' [=ERROR=] 182200.14 Script warning: AI script 'reactionforce' references AI order 'ProtectShip' via <create_order> with unexpected parameter 'pursuetargets' [=ERROR=] 182200.14 Script warning: AI script 'reactionforce' references AI order 'ProtectShip' via <create_order> with unexpected parameter 'radiusanchorpos' [=ERROR=] 182200.14 Script warning: AI script 'reactionforce' references AI order 'ProtectShip' via <create_order> with unexpected parameter 'squad_attack' [=ERROR=] 182200.14 Script warning: AI script 'reactionforce' references AI order 'ProtectShip' via <create_order> with unexpected parameter 'allowothertargets' [=ERROR=] 182200.14 Script warning: AI script 'reactionforce' references AI order 'Attack' via <create_order> with unexpected parameter 'timeout'
Also, this too but this is from the original version and not new changes.
Code: Select all
Line 87712: [=ERROR=] 182200.14 extensions\shib_reactionforce\aiscripts\order.fight.reactionforce.xml(200): Script node 'resume' is not allowed in this context.
this is my code generating the error:
Code: Select all
<do_else>
<!-- Get some XP for responding -->
<apply_experience entity="this" experience="'ship_disable_easy'" chance="20"/>
<set_value name="$responseTime" exact="player.age"/>
<set_value name="$activeResponse" exact="true"/>
<!-- Handle notifications/Log -->
<do_if value="$notifyMe">
<show_notification text="'{7442342,30122}'.[this.ship.knownname, $responseTarget.knownname]" priority="9"/>
</do_if>
<write_to_logbook category="alerts" title="'{7442342,30123}:'" text="'{7442342,30124}'.[this.ship.knownname, $responseTarget.knownname, $responseTarget.sector.knownname]"/>
<set_value name="$responding" exact="true"/>
<set_value name="$responseTime" exact="player.age"/>
<set_value name="$idling" exact="null"/>
<!-- If it's a station protect the station -->
<do_if value="$responseTarget.isclass.station">
<debug_text text="'SHIB Reaction Force - %s - Responding to Station %s'.[this.ship.knownname, $responseTarget.knownname]"/>
<create_order object="this.ship" id="'ProtectStation'">
<param name="station" value="$responseTarget"/>
<param name="timeout" value="10s"/>
</create_order>
</do_if>
<!-- If it's a ship protect the ship -->
<do_elseif value="$responseTarget.isclass.ship">
<debug_text text="'SHIB Reaction Force - %s - Responding to Ship %s'.[this.ship.knownname, $responseTarget.knownname]"/>
<create_order object="this.ship" id="'AttackInRange'">
<param name="target" value="$responseTarget"/>
<param name="pursuetargets" value="true"/>
<param name="allowothertargets" value="true"/>
<param name="timeout" value="30s"/>
<param name="radius" value="100"/>
<param name="radiusanchorpos" value="$responseTarget.position"/>
<param name="radiusanchorspace" value="$responseTarget.sector"/>
<param name="squad_attack" value="this.ship.subordinates.count gt 0"/>
</create_order>
</do_elseif>
<!-- New response -->
<do_if value="@$aggressor">
<create_order object="this.ship" id="'Attack'" immediate="true">
<param name="primarytarget" value="$aggressor"/>
<param name="pursuetargets" value="true"/>
<param name="escort" value="$responseTarget"/>
<param name="allowothertargets" value="true"/>
<param name="squad_attack" value="this.ship.subordinates.count gt 0"/>
<param name="timeout" value="30s"/>
</create_order>
</do_if>
</do_else>
Code: Select all
<do_else>
<!-- Get some XP for responding -->
<apply_experience entity="this" experience="'ship_disable_easy'" chance="20"/>
<set_value name="$responseTime" exact="player.age"/>
<set_value name="$activeResponse" exact="true"/>
<!-- Handle notifications/Log -->
<do_if value="$notifyMe">
<show_notification text="{7442342,30122}.[this.ship.knownname, $responseTarget.knownname]"
priority="9"/>
</do_if>
<write_to_logbook category="alerts" title="{7442342,30123}"
text="{7442342,30124}.[this.ship.knownname, $responseTarget.knownname, $responseTarget.sector.knownname]"/>
<set_value name="$responding" exact="true"/>
<set_value name="$responseTime" exact="player.age"/>
<set_value name="$idling" exact="null"/>
<!-- If it's a station protect the station -->
<do_if value="$responseTarget.isclass.station">
<debug_text text="'SHIB Reaction Force - %s - Responding to Station %s'.[this.ship.knownname, $responseTarget.knownname]"/>
<create_order object="this.ship" id="'ProtectStation'">
<param name="station" value="$responseTarget"/>
<param name="timeout" value="300s"/>
</create_order>
</do_if>
<!-- If it's a ship protect the ship -->
<do_elseif value="$responseTarget.isclass.ship">
<debug_text text="'SHIB Reaction Force - %s - Responding to Ship %s'.[this.ship.knownname, $responseTarget.knownname]"/>
<create_order object="this.ship" id="'ProtectShip'">
<param name="target" value="$responseTarget"/>
<param name="timeout" value="300s"/>
</create_order>
</do_elseif>
<!-- New response -->
<do_if value="@$aggressor">
<create_order object="this.ship" id="'Attack'" immediate="true">
<param name="primarytarget" value="$aggressor"/>
<param name="pursuetargets" value="false"/>
<param name="escort" value="$responseTarget"/>
<param name="allowothertargets" value="true"/>
</create_order>
</do_if>
</do_else>
these are the lines concerned with this
Code: Select all
<!-- If it's a ship protect the ship -->
<do_elseif value="$responseTarget.isclass.ship">
<debug_text text="'SHIB Reaction Force - %s - Responding to Ship %s'.[this.ship.knownname, $responseTarget.knownname]"/>
<create_order object="this.ship" id="'AttackInRange'">
<param name="target" value="$responseTarget"/>
<param name="pursuetargets" value="true"/>
<param name="allowothertargets" value="true"/>
<param name="timeout" value="30s"/>
<param name="radius" value="100"/>
<param name="radiusanchorpos" value="$responseTarget.position"/>
<param name="radiusanchorspace" value="$responseTarget.sector"/>
<param name="squad_attack" value="this.ship.subordinates.count gt 0"/>
</create_order>
</do_elseif>
Re: [MOD] Reaction Force
I didn't follow the whole discussion, so pardon me if this is out of context and ignore if not useful.
These are the supported parameters in vanilla order.fight.attack.inrange:
Translating that to your code, should be something like:
Note that this precludes the use of squad_attack, though. For that, you'd have to call the Attack order directly, but the resulting behavior would be different. Depends on what you want it to do, of course. Code you posted won't trigger those errors mentioned earlier involving ProtectShip, though.
These are the supported parameters in vanilla order.fight.attack.inrange:
Code: Select all
<params>
<param name="destination" type="position" text="{1041, 10158}" comment="Center of area in which targets will be attacked. Position">
<input_param name="class" value="class.sector"/>
</param>
<param name="radius" type="length" default="this.ship.maxradarrange" text="{1041, 10093}" comment="Radius">
<input_param name="min" value="1km"/>
<input_param name="max" value="[this.ship.maxradarrange, 1km].max"/>
<input_param name="step" value="1km"/>
</param>
<param name="pursuetargets" default="false" type="bool" text="{1041, 10091}" advanced="true" comment="Pursue targets"/>
<param name="debugchance" type="bool" default="0" advanced="true" text="{1041, 10086}" comment="Print debug output">
<input_param name="truevalue" value="100"/>
</param>
</params>
Code: Select all
<do_if value="$responseTarget.sector">
<create_position name="$targetsectorpos" space="$responseTarget.sector" value="$responseTarget.position" object="$responseTarget.zone"/>
<create_order id="'AttackInRange'" object="this.assignedcontrolled">
<param name="destination" value="[$responseTarget.sector, $targetsectorpos]"/>
<param name="radius" value="100km"/> <!-- at least, i assume you meant that in km? -->
<param name="pursuetargets" value="true"/>
</create_order>
<remove_value name="$targetsectorpos"/>
</do_if>