[MOD] Reaction Force

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

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

CamdalfTheWhite
Posts: 1
Joined: Mon, 3. Dec 18, 21:37
x4

Re: [MOD] Reaction Force

Post by CamdalfTheWhite » Thu, 1. Apr 21, 09:37

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!

Sturmer
Posts: 497
Joined: Thu, 9. Jun 11, 19:17

Re: [MOD] Reaction Force

Post by Sturmer » Thu, 1. Apr 21, 21:52

ShiBDiB wrote:
Wed, 31. Mar 21, 23:52
I just got the DLC finally so this and my other mods are finally getting some TLC
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.

drowningfly
Posts: 52
Joined: Sun, 21. Apr 13, 21:44
x4

Re: [MOD] Reaction Force

Post by drowningfly » Fri, 2. Apr 21, 12:35

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?

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

Re: [MOD] Reaction Force

Post by BlackRain » Fri, 2. Apr 21, 16:22

drowningfly wrote:
Fri, 2. Apr 21, 12:35
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?
Yeah, turn off the notifications in the game. There is a global option for it. I turned it off.

drowningfly
Posts: 52
Joined: Sun, 21. Apr 13, 21:44
x4

Re: [MOD] Reaction Force

Post by drowningfly » Fri, 2. Apr 21, 20:39

BlackRain wrote:
Fri, 2. Apr 21, 16:22
drowningfly wrote:
Fri, 2. Apr 21, 12:35
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?
Yeah, turn off the notifications in the game. There is a global option for it. I turned it off.
Thank you sir!

Star4ce
Posts: 31
Joined: Fri, 2. May 08, 21:53
x4

Re: [MOD] Reaction Force

Post by Star4ce » Sun, 4. Apr 21, 14:01

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.

drowningfly
Posts: 52
Joined: Sun, 21. Apr 13, 21:44
x4

Re: [MOD] Reaction Force

Post by drowningfly » Tue, 6. Apr 21, 19:17

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.

monish_05m
Posts: 21
Joined: Wed, 10. Aug 05, 15:57
x3tc

Re: [MOD] Reaction Force

Post by monish_05m » Wed, 7. Apr 21, 10:36

Does the version from github work for anyone?

monish_05m
Posts: 21
Joined: Wed, 10. Aug 05, 15:57
x3tc

Re: [MOD] Reaction Force

Post by monish_05m » Wed, 7. Apr 21, 16:00

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.
Last edited by monish_05m on Fri, 9. Apr 21, 06:27, edited 2 times in total.

ShiBDiB
Posts: 78
Joined: Mon, 7. May 07, 00:12
x4

Re: [MOD] Reaction Force

Post by ShiBDiB » Wed, 7. Apr 21, 18:16

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

HateDread
Posts: 51
Joined: Sun, 26. Feb 12, 09:15
x3ap

Re: [MOD] Reaction Force

Post by HateDread » Thu, 8. Apr 21, 10:20

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 :)

monish_05m
Posts: 21
Joined: Wed, 10. Aug 05, 15:57
x3tc

Re: [MOD] Reaction Force

Post by monish_05m » Fri, 9. Apr 21, 06:25

HateDread wrote:
Thu, 8. Apr 21, 10:20
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 :)
use the file I posted above, fleets are working with that.

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

Re: [MOD] Reaction Force

Post by BlackRain » Fri, 9. Apr 21, 14:12

monish_05m wrote:
Fri, 9. Apr 21, 06:25
HateDread wrote:
Thu, 8. Apr 21, 10:20
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 :)
use the file I posted above, fleets are working with that.
There are actually a few errors that popped up with that.

monish_05m
Posts: 21
Joined: Wed, 10. Aug 05, 15:57
x3tc

Re: [MOD] Reaction Force

Post by monish_05m » Fri, 9. Apr 21, 15:20

BlackRain wrote:
Fri, 9. Apr 21, 14:12
monish_05m wrote:
Fri, 9. Apr 21, 06:25
HateDread wrote:
Thu, 8. Apr 21, 10:20
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 :)
use the file I posted above, fleets are working with that.
There are actually a few errors that popped up with that.
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
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7411
Joined: Mon, 15. Dec 03, 18:53
x4

Re: [MOD] Reaction Force

Post by BlackRain » Fri, 9. Apr 21, 15:21

monish_05m wrote:
Fri, 9. Apr 21, 15:20
BlackRain wrote:
Fri, 9. Apr 21, 14:12
monish_05m wrote:
Fri, 9. Apr 21, 06:25


use the file I posted above, fleets are working with that.
There are actually a few errors that popped up with that.
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.
I wasn't criticizing you, just mentioning I noticed errors in the debug log but I didn't really look at it yet.

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

Re: [MOD] Reaction Force

Post by BlackRain » Fri, 9. Apr 21, 16:17

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'
See, 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.

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.

Alkeena
Posts: 603
Joined: Tue, 15. May 07, 20:43
x4

Re: [MOD] Reaction Force

Post by Alkeena » Sun, 11. Apr 21, 06:40

BlackRain wrote:
Fri, 9. Apr 21, 16:17

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'
See, 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.

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.
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
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7411
Joined: Mon, 15. Dec 03, 18:53
x4

Re: [MOD] Reaction Force

Post by BlackRain » Sun, 11. Apr 21, 07:17

Alkeena wrote:
Sun, 11. Apr 21, 06:40
BlackRain wrote:
Fri, 9. Apr 21, 16:17

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'
See, 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.

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.
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.
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 deal

monish_05m
Posts: 21
Joined: Wed, 10. Aug 05, 15:57
x3tc

Re: [MOD] Reaction Force

Post by monish_05m » Sun, 11. Apr 21, 10:30

Alkeena wrote:
Sun, 11. Apr 21, 06:40
BlackRain wrote:
Fri, 9. Apr 21, 16:17

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'
See, 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.

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.
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.
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.

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>
Below is the original code that makes the fleet follow the protected ship for a long time, even if fixed this should not be the ideal behaviour as attacking the threats should be the goal and not following the protected ship, as there may be other ships in the area being attacked and in need of protection.

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>
what i want to achieve is to have the fleet get command to attack in range at the current position of the protected ship ,like the one we give in game by right click on an area on map view

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>
Thanks

j.harshaw
EGOSOFT
EGOSOFT
Posts: 1872
Joined: Mon, 23. Nov 15, 18:02

Re: [MOD] Reaction Force

Post by j.harshaw » Tue, 13. Apr 21, 00:58

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:

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>
Translating that to your code, should be something like:

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>
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.

Post Reply

Return to “X4: Foundations - Scripts and Modding”