[MOD] Reactive Docking

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

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

runekn
Posts: 116
Joined: Sun, 21. Mar 21, 19:24
x4

[MOD] Reactive Docking

Post by runekn »

Reactive Docking

Download: https://www.nexusmods.com/x4foundations/mods/676/
Download: https://steamcommunity.com/sharedfiles/ ... 2463228815

Description
In vanilla X4: Foundations subordinates assigned to a carrier with the 'Launched' option will remain docked until something relevant to their standing order happens.
For example if the leader is attacked then groups with 'defend' will launch to defend.
Most other subordinate groups just have the options to always be launched, always docked, or no dockiong options at all. The overall intend with this mod is to expand this carrier 'reactive' docking behaviour to more ship types.

READ: You may need to disable UI Protection mode ("Settings" -> "Extensions" -> "Protected UI Mode") before you can see the extension settings.

3.0 Update Info!
In prior version of Reactive Docking, the "Reactive" option selection was tied to the commander pilot. This lead to problems where taking over manual control of a ship, or changing pilot, would reset or otherwise change the docking behaviour.
For 3.0 I wanted to fix this by switching where I store the selected docking behaviour to a place such that it could now be tied to the ship, rather than the pilot. 3.0 includes some migration code which will migrate the selected docking options to the new storage and delete the old.
This means that loading a save that has used 3.0 of Reactive Docking with an earlier version, will result in a full or partial reset of reactive docking options.

Docking behaviour options
You can change the default option for any of these cases in the Extension Options (requires SirNuke's Mod Support API). **It is recommended this is only done once at the start of the game, as changing the default options will flip all reactive/launched docking options**.

Non-carrier escort wing
Example: Fighter assigned to intercepting for Colossus XL carrier.

1. Docked: Same behaviour as vanilla. Subordinates will remain docked.
2. Launched (default): Same as vanilla. Subordinates will remain launched, and only dock if leader wants to travel far distances.
3. Reactive (added): Subordinates will dock, but launch if something happens that is relevant to their standing order.

Carrier escort wing
Example: Fighter assigned to attacking with Behemoth L destroyer.

1. Docked: Same behaviour as vanilla. Subordinates will remain docked.
2. Launched (added): Subordinates will remain launched, and only dock if leader wants to travel far distances.
3. Reactive (default): Same as vanilla launched. Subordinates will dock, but launch if something happens that is relevant to their standing order.

Station defence wing
Example: Fighter assigned to defence of player HQ station.

1. Docked (added): Subordinates will remain docked.
2. Launched (default): Same as vanilla. Subordinates will patrol around the station in a random pattern, and engage any enemy entering the zone of control.
3. Reactive (added): When no enemies are detected, ships will move towards available docking pads while keeping a lookout. If within 8km of docking pads they will initiate dock. Will launch and attack if enemies enter the zone of control.

Auxiliary trader
Example: Courier Vanguard assigned to trade for Nomad.

1. Docked: Option not available.
2. Launched (default): Same as vanilla. Ships will look for trades for the auxiliary ship, and launch as soon as it has completed a trade.
3. Reactive (added): Trader will dock at auxiliary if it has found no valid trades for some time. Will remain docked to auxiliary after completing trade, until it has found another.

Requirements

* (OPTIONAL) SirNuke's Mod Support API [Steam | Nexusmods] - Required for changing default docking options, but otherwise not needed. Will require UI Protection mode be disabled.
* (OPTIONAL) Kuertee's's UI Extension and HUD version >= 2.0.6 [Nexus] - Increase compatibility with other UI mods.

Compatibility
This mod is save compatible. You can add it to an existing save, and remove it without errors. If removed then groups with the 'Reactive' option enabled will simply change to 'Launched'.

This mod achieves compatibility with other UI mods through the UI Extension and HUD mod.
To work with Subsystem Targeting Orders, at least version 3.3 is required.

FAQ

1. When I have ships in storage, and one on the pad, and all are to launch why does the ship currently on the pad not launch first, rather than stow only to launch after another has?
- As far as I can tell this is vanilla behavior for the game. So I dunno what I could do about it. The game doesn't seem to make any priority for ships already on a pad if both it and one in storage needs to launch.

2. When they return to dock on my leader with one pad, only 1 ship docks and the rest just cancel their docking?
- Again, seems to be vanilla behavior. They get cancelled because the pad is occupied. Why they don't just queue up to dock I don't know atm.

3. I wanna fix your ****** code
- You are very welcome to make requests to the github.

4. My auxiliary trader is not docking after switching to Reactive
- Reactive mode for auxiliary traders will not dock until it has failed to find valid trades for some time.

Thanks to

* Allectus for making another mod that does somewhat the same things, so that I could easily see how to achieve what I wanted despite this being my first mod :P
* Forleyor for making the integration with UI Extension and HUD

Updates

* 3.0.0: Support for station defend subordinates. Support for auxiliary trade subordinates. Docking settings are now tied to the ship, rather than the pilot. Removed japanese translations, since they are outdated.
* 2.3.3: Fix Reactive docking preventing Expanded Configuration Loader from working
* 2.3.2: Use new official UI file declaration to avoid requiring disabled UI protection mode
* 2.3.1: Fix compatibility with 7.50
* 2.3.0: Add options menu for default behaviour of player ships. New docking behaviour is now instantly applied when chosen from dropdown.
* 2.2.1: Fixed docking menu
* v2.2: Fixed compatibility for 7.0
* v2.1: Updated standalone UI mode for 6.0
* v2.0: Launched option for carrier groups now behave as non-carriers. Added Reactive option to carrier groups.
* v1.4: Fixed compability with 5.0 when not using kuertee's UI mod, added Japanese by ArkBlade2015, added standalone mode (works without Kuertee's UI Extensions)
* v1.3: Fixed error logs when opening loadout menu on ship without captain. Reactive mode is now disabled if there is no captain.
* v1.2: Fixed reactive mode when leader is M ship.
* v1.1: Better mod compatibility. Disabled Reactive modes for stations.
* v1.0: Fixed ingame mod dependency. Added STO compatible version.
* v0.1: Initial release.
Last edited by runekn on Wed, 26. Mar 25, 08:07, edited 16 times in total.
runekn
Posts: 116
Joined: Sun, 21. Mar 21, 19:24
x4

Re: [MOD] Reactive Docking v0.1

Post by runekn »

Oh and do say if 'Reactive Docking' is a dumb name. I'm starting to think it is, but maybe that's just because I see it often and I made it. It's named such because subordinates are in a more vulnerable state (docked) and can only react to event. Rather than being always ready (launched).

Also if any has suggestions for points mentioned in known bugs or FAQ, do also mention it. This is my first dive into modding.
runekn
Posts: 116
Joined: Sun, 21. Mar 21, 19:24
x4

Re: [MOD] Reactive Docking

Post by runekn »

v1.0
  • Fixed missing ingame dependency requirement for Modding Support API
  • Added version which is compatible with (and requires!) Subsystem Targeting Orders 3.2
SunGod1
Posts: 52
Joined: Fri, 15. May 20, 07:58
x4

Re: [MOD] Reactive Docking

Post by SunGod1 »

I am going to test this mod out.... right now.... I want my Asgards to be even Mohar Powerful!!!!
Travel Drive Charge Time is absolutely @player_frustration +1
runekn
Posts: 116
Joined: Sun, 21. Mar 21, 19:24
x4

Re: [MOD] Reactive Docking

Post by runekn »

v1.1
  • Merges STO-compatible and normal versions into one (thanks to Forleyor). Now requires UI Extension and HUD >= 2.0.6
  • Disabled Reactive mode for stations. It wasn't working there anyway.
runekn
Posts: 116
Joined: Sun, 21. Mar 21, 19:24
x4

Re: [MOD] Reactive Docking

Post by runekn »

v1.3

For this one I have disabled the reactive docking option if the leader ship has no captain atm. Since I save the custom logic to the ship's captain, it would generate error logs if there were none.

If your option for some reason is still disabled while the ship has a captain, try just closing and reopening the menu. Otherwise hit me with a bug report.
MiFoludek
Posts: 65
Joined: Wed, 18. May 11, 21:06
x3tc

Re: [MOD] Reactive Docking

Post by MiFoludek »

Hello,

Did not try this mod yet but it sholud make mys destroyers behave like carriers?

Right?
runekn
Posts: 116
Joined: Sun, 21. Mar 21, 19:24
x4

Re: [MOD] Reactive Docking

Post by runekn »

MiFoludek wrote: Sun, 18. Apr 21, 17:36 Hello,

Did not try this mod yet but it sholud make mys destroyers behave like carriers?

Right?
More correct to say it will make subordinates of destroyers behave as if they are carrier based. The mod doesn't change the behavior of the leader ships, only the subordinates.
MiFoludek
Posts: 65
Joined: Wed, 18. May 11, 21:06
x3tc

Re: [MOD] Reactive Docking

Post by MiFoludek »

runekn wrote: Sun, 18. Apr 21, 17:57
MiFoludek wrote: Sun, 18. Apr 21, 17:36 Hello,

Did not try this mod yet but it sholud make mys destroyers behave like carriers?

Right?
More correct to say it will make subordinates of destroyers behave as if they are carrier based. The mod doesn't change the behavior of the leader ships, only the subordinates.
That is exactly what I am looking for.
Downloading now
Thank you :)
runekn
Posts: 116
Joined: Sun, 21. Mar 21, 19:24
x4

Re: [MOD] Reactive Docking

Post by runekn »

v1.4
  • Can now work without Kuertee's UI Extensions. But it might break compatibility with other mods.
  • Added Japanese translation by ArkBlade2015
runekn
Posts: 116
Joined: Sun, 21. Mar 21, 19:24
x4

Re: [MOD] Reactive Docking

Post by runekn »

v2.0
  • Launched option for carrier groups now behave as non-carriers
  • Added Reactive option to carrier groups
runekn
Posts: 116
Joined: Sun, 21. Mar 21, 19:24
x4

Re: [MOD] Reactive Docking

Post by runekn »

v2.1
  • Fixed compatibility with 6.0 when not using Kuertee's's UI Extension and HUD mod
runekn
Posts: 116
Joined: Sun, 21. Mar 21, 19:24
x4

Re: [MOD] Reactive Docking

Post by runekn »

v2.2
  • Fixed compatibility with 7.0
runekn
Posts: 116
Joined: Sun, 21. Mar 21, 19:24
x4

Re: [MOD] Reactive Docking

Post by runekn »

v2.3
  • Add options menu for default behavior of player ships.
  • New docking behavior is now instantly applied when chosen from dropdown.
Falcrack
Posts: 5683
Joined: Wed, 29. Jul 09, 00:46
x4

Re: [MOD] Reactive Docking

Post by Falcrack »

I was actually interested in a mod that would create an option for fighters assigned to carriers to stay launched and not return to dock, unless they need to.return for repairs. The time it takes to launch decreases their response time, and sometimes they go back to dock, a new threat appears, and they are vulnerable. Maybe an extra option called "always launched", in addition to the "launched" and "docked" options.
runekn
Posts: 116
Joined: Sun, 21. Mar 21, 19:24
x4

Re: [MOD] Reactive Docking

Post by runekn »

Falcrack wrote: Wed, 25. Sep 24, 16:08 I was actually interested in a mod that would create an option for fighters assigned to carriers to stay launched and not return to dock, unless they need to.return for repairs. The time it takes to launch decreases their response time, and sometimes they go back to dock, a new threat appears, and they are vulnerable. Maybe an extra option called "always launched", in addition to the "launched" and "docked" options.
This mod actually replaces carrier 'launched' with the new 'reactive'. And the new 'launched' is as you say, where it does not dock when idle.
runekn
Posts: 116
Joined: Sun, 21. Mar 21, 19:24
x4

Re: [MOD] Reactive Docking

Post by runekn »

Hello. So I have been working on an update that implements the two most requested features. Support for stations defenders and auxiliary traders. Given that this update basically quadruples the size and complexity of the mod, and the mod has become somewhat popular, I figured it might be best to have people test it a bit before I YOLO the steam workshop version and break peoples games.

The update can be found on the nexus page, under "Optional files".

Two things of note.

In prior version of Reactive Docking, the "Reactive" option selection was tied to the commander pilot. This lead to problems where taking over manual control of a ship, or changing pilot, would reset or otherwise change the docking behaviour. For 3.0 I wanted to fix this by switching where I store the selected docking behaviour to a place such that it could now be tied to the ship, rather than the pilot. 3.0 includes some migration code which will migrate the selected docking options to the new storage and delete the old. This means that loading a save that has used 3.0 of Reactive Docking with an earlier version, will result in a full or partial reset of reactive docking options.

The other thing is that the current release version of UI Extensions mod will not work with this. If you use UI Extensions mod you will have to either disable it (assuming that you don't have other mods depending on it), or download the yet unreleased version from Kuertee's Github page (direct download link).

EDIT: Removed info that has been added to main description to reduce comment size
Last edited by runekn on Sat, 22. Mar 25, 10:12, edited 1 time in total.
runekn
Posts: 116
Joined: Sun, 21. Mar 21, 19:24
x4

Re: [MOD] Reactive Docking

Post by runekn »

v3.0.0
  • Support for station defend subordinates.
  • Support for auxiliary trade subordinates.
  • Docking settings are now tied to the ship, rather than the pilot.
  • Removed japanese translations, since they are outdated.

Return to “X4: Foundations - Scripts and Modding”