[MOD] Civilian Fleets (v1.14)

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

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

Vectorial1024
Posts: 151
Joined: Mon, 30. Jul 18, 04:16
x4

Re: [MOD] Civilian Fleets (v1.08)

Post by Vectorial1024 » Tue, 29. Oct 19, 10:45

gmargaro wrote:
Sun, 27. Oct 19, 11:32
Hi, and thanks for this great mod (It should have been in the game from the start...)

Just a suggestion : Could you add support for Explorer Fleets, specifically the AnotherExplorer mod : https://www.nexusmods.com/x4foundations/mods/332
It should be possible. I briefly looked at their Exploration script, and it makes sense to have a leader ship with the order to explore the galaxy, and other ships under the leader ship to do the same thing.

Note to self: the "police" assignment tag should be appropriate for the exploration script, but to aim for a more general solution, we should test whether arbitrary "assignment tag" strings could be passed from the Lua scripts to XML scripts without causing errors.

This should be simple. (But I will leave it for later...)

And, with the help of Nexus Mods user franchivp, the <run_script> bug has been killed. No version number increment since it was a rather minor issue.
Computer Science student, reporting for duty. College gon be tough, so no need to be rush.

Vectorial1024
Posts: 151
Joined: Mon, 30. Jul 18, 04:16
x4

Re: [MOD] Civilian Fleets (v1.08)

Post by Vectorial1024 » Fri, 1. Nov 19, 20:19

gmargaro wrote:
Sun, 27. Oct 19, 11:32
Hi, and thanks for this great mod (It should have been in the game from the start...)

Just a suggestion : Could you add support for Explorer Fleets, specifically the AnotherExplorer mod : https://www.nexusmods.com/x4foundations/mods/332
Upon closer inspection, I believe it not necessary for me to provide support for AnotherExplorer; they already have such feature.

As seen from their GitHub repo, if you assign other ships to a ship running AnotherExplorer, AE will attempt to copy the AnotherExplorer default order over to the new subordinate, just like how Civ-Fleets copy the trading/mining default order from the commander to the subordinates when you assign new subordinates using to a new commander.

So perhaps you can contact AnotherExplorer team instead to suggest improvements.
Computer Science student, reporting for duty. College gon be tough, so no need to be rush.

Kyle Baxter
Posts: 10
Joined: Sat, 22. Dec 18, 01:36
x4

Re: [MOD] Civilian Fleets (v1.08)

Post by Kyle Baxter » Fri, 8. Nov 19, 23:26

Hi, this mod is great and thank you for creating it. I've been using it for days and it is working nicely, but I found that the mod behaves strange when I use it with TaterTrader. I have for example a Mercury doing Universe trading with both ranges set to 14 jumps from the home sector. When I add another Mercury with join trading fleet its range gets set to 3 or 4 jumps, depending on the skill level of the captain. TaterTrader allows much higher values, like the one the commander Mercury already uses. So my question is, would it be possible for the mod the check the range settings from the commander and apply the value to the subordinates?

Another thing that I found is when I use your mod with the Mules mod. My station has a TravelMule that is doing sales. When i select another trading ship an right click on the TravelMule and click join trading fleet, the new ship gets the role of a DistriMule. I think that behavior is not wanted. Maybe the same is true for the normal StationMule, sadly i could not test it right now.

Edit: I just tested the normal StationMule and it works with the mod without a problem. Only TravelMule seems broken.

Vectorial1024
Posts: 151
Joined: Mon, 30. Jul 18, 04:16
x4

Re: [MOD] Civilian Fleets (v1.08)

Post by Vectorial1024 » Fri, 15. Nov 19, 20:12

Hey there! Thanks for the bug reports. Real life just hit me hard the past week... so I couldn't really respond here.

Both bugs are easy bugs and should be killed soon in the next update.

The TaterTrade bug was mainly because I was still using the vanilla calculation for trade range, which resulted in values from 0 to 5; TaterTrade actually used another way of calculation, and theoretically can range from 0 to 30.

The Mules support was not done by me, but it certainly is on my part for not checking it thoroughly; it's probably the contributor forgetting to type in the correct default order ID (i.e. "TravelMule") after copying code from DistriMule (this happens from time to time in programming in general XD)

I'm planning to extend support to RandomTrade/RandomMine; those extensions were originally supposed to have been in my drive, but I somehow deleted them...
Computer Science student, reporting for duty. College gon be tough, so no need to be rush.

Kyle Baxter
Posts: 10
Joined: Sat, 22. Dec 18, 01:36
x4

Re: [MOD] Civilian Fleets (v1.08)

Post by Kyle Baxter » Sun, 17. Nov 19, 02:01

Welcome back!

Mules and Warehouse seems to be all other the place right now, totally bugged in 2.6 and sadly the author is away. I stopped my playthrough, because i did not find a mules mod that was working properly. Maybe i bend somehow TaterTrader with buy and sell prices and faction restrictions to deliver to my warehouse. TaterTrader is my go to mod the fix all kinds of other broken mods. :) Now to the next bug! A mining fleet with a commander that uses expert miner has the same problem with the jump range. Expert miner allows high values like TaterTrader, but the wingman use again the same default values. I also read that expert miner is way better in mining, compared to advanced or the sector miner behavior. Do the wingman get the same bonuses applied or do they use the basic default sector mining speed?

Vectorial1024
Posts: 151
Joined: Mon, 30. Jul 18, 04:16
x4

Re: [MOD] Civilian Fleets (v1.08)

Post by Vectorial1024 » Sun, 17. Nov 19, 11:12

Kyle Baxter wrote:
Sun, 17. Nov 19, 02:01
Welcome back!

Mules and Warehouse seems to be all other the place right now, totally bugged in 2.6 and sadly the author is away. I stopped my playthrough, because i did not find a mules mod that was working properly. Maybe i bend somehow TaterTrader with buy and sell prices and faction restrictions to deliver to my warehouse. TaterTrader is my go to mod the fix all kinds of other broken mods. :) Now to the next bug! A mining fleet with a commander that uses expert miner has the same problem with the jump range. Expert miner allows high values like TaterTrader, but the wingman use again the same default values. I also read that expert miner is way better in mining, compared to advanced or the sector miner behavior. Do the wingman get the same bonuses applied or do they use the basic default sector mining speed?
Hmmm, the Expert Mining part is not noticed before, need to look into it.

Internally, all the 3 mining behaviors use the same "mining" script, but with different parameters. And yes, Expert Mining itself has a fixed "efficiency" score of 100, whereas Sector Mining has a fixed score of (I think) 10, with Advanced Mining inbetween.

I think I made it such that subordinates of a mining fleet will mine resources according to their own skill levels, instead of directly copying from the commanders' range because that will make this set up very OP: 1 Expert Miner leading numerous 0 star skill miners, all running Expert AutoMine
Computer Science student, reporting for duty. College gon be tough, so no need to be rush.

Buzz2005
Posts: 1282
Joined: Sat, 26. Feb 05, 02:47
x4

Re: [MOD] Civilian Fleets (v1.08)

Post by Buzz2005 » Sun, 17. Nov 19, 23:11

Kyle Baxter wrote:
Sun, 17. Nov 19, 02:01
Welcome back!

Mules and Warehouse seems to be all other the place right now, totally bugged in 2.6 and sadly the author is away. I stopped my playthrough, because i did not find a mules mod that was working properly. Maybe i bend somehow TaterTrader with buy and sell prices and faction restrictions to deliver to my warehouse. TaterTrader is my go to mod the fix all kinds of other broken mods. :) Now to the next bug! A mining fleet with a commander that uses expert miner has the same problem with the jump range. Expert miner allows high values like TaterTrader, but the wingman use again the same default values. I also read that expert miner is way better in mining, compared to advanced or the sector miner behavior. Do the wingman get the same bonuses applied or do they use the basic default sector mining speed?
mules mod extensions works good if you start a new game with it, or in the existing game edit out the order. base. xml file

its in cat and dat format but if you want I can send you the edited version, it should work great in 2.6 as it works for me

Kyle Baxter
Posts: 10
Joined: Sat, 22. Dec 18, 01:36
x4

Re: [MOD] Civilian Fleets (v1.08)

Post by Kyle Baxter » Mon, 18. Nov 19, 07:55

Vectorial1024 wrote:
Sun, 17. Nov 19, 11:12
Kyle Baxter wrote:
Sun, 17. Nov 19, 02:01
Welcome back!

Mules and Warehouse seems to be all other the place right now, totally bugged in 2.6 and sadly the author is away. I stopped my playthrough, because i did not find a mules mod that was working properly. Maybe i bend somehow TaterTrader with buy and sell prices and faction restrictions to deliver to my warehouse. TaterTrader is my go to mod the fix all kinds of other broken mods. :) Now to the next bug! A mining fleet with a commander that uses expert miner has the same problem with the jump range. Expert miner allows high values like TaterTrader, but the wingman use again the same default values. I also read that expert miner is way better in mining, compared to advanced or the sector miner behavior. Do the wingman get the same bonuses applied or do they use the basic default sector mining speed?
Hmmm, the Expert Mining part is not noticed before, need to look into it.

Internally, all the 3 mining behaviors use the same "mining" script, but with different parameters. And yes, Expert Mining itself has a fixed "efficiency" score of 100, whereas Sector Mining has a fixed score of (I think) 10, with Advanced Mining inbetween.

I think I made it such that subordinates of a mining fleet will mine resources according to their own skill levels, instead of directly copying from the commanders' range because that will make this set up very OP: 1 Expert Miner leading numerous 0 star skill miners, all running Expert AutoMine
My intention was that the right values get applied to the miners. I'm totally fine if it works like you mentioned, that every miner uses their own skill level. :)
Buzz2005 wrote:
Sun, 17. Nov 19, 23:11
Kyle Baxter wrote:
Sun, 17. Nov 19, 02:01
Welcome back!

Mules and Warehouse seems to be all other the place right now, totally bugged in 2.6 and sadly the author is away. I stopped my playthrough, because i did not find a mules mod that was working properly. Maybe i bend somehow TaterTrader with buy and sell prices and faction restrictions to deliver to my warehouse. TaterTrader is my go to mod the fix all kinds of other broken mods. :) Now to the next bug! A mining fleet with a commander that uses expert miner has the same problem with the jump range. Expert miner allows high values like TaterTrader, but the wingman use again the same default values. I also read that expert miner is way better in mining, compared to advanced or the sector miner behavior. Do the wingman get the same bonuses applied or do they use the basic default sector mining speed?
mules mod extensions works good if you start a new game with it, or in the existing game edit out the order. base. xml file

its in cat and dat format but if you want I can send you the edited version, it should work great in 2.6 as it works for me
It worked at the start, but broke after a while. I'm unsure if this will fix it. I used for my stations StationMule with the warehouse option and later removed the mercury with the settings and replaced those with large freighters. The freighters are unable to do job, they start the trade order and immediately stop the trade order. This behavior goes on and on, but if i use the same ship class like the mercury before, the SationMule script works on those two stations. If i assign the large freighter to another station it also works fine. This is just one bug of many that i encountered. Also sometimes the orders get stuck and won't process. Really strange, but I will try your solution. Thanks. :)

Edit: Woops, just saw that you said mules extensions. Yeah that mod is also totally broken for me. My mules try to trade with npc wharfs and equipment docks and i have own stations only selected. It does not care for trade bans too or jump range restriction. Even with trade bans for all factions, own stations only and jump range set to 0 it still flies to other npc stations. Also only my first freighter does work. The second does absolutely nothing. :|

Vectorial1024
Posts: 151
Joined: Mon, 30. Jul 18, 04:16
x4

Re: [MOD] Civilian Fleets (v1.08)

Post by Vectorial1024 » Wed, 20. Nov 19, 15:22

Kyle Baxter wrote:
Mon, 18. Nov 19, 07:55
My intention was that the right values get applied to the miners. I'm totally fine if it works like you mentioned, that every miner uses their own skill level. :)
Updated to v1.09 a few days ago, and just got around to update here. The bugs mentioned a few posts up are all killed.

I checked the code carefully, and I can tell you this:

When a miner is assigned to another miner (for civilian fleet):
  • If the commander is more skillful than the subordinate, then the subordinate will use his own skill level to run the script; very intuitive, easy to understand.
  • If the commander is less skillful than the subordinate, then the subordinate will use the average of the commander's and his skill level (the value used will be lower than the subordinate's actual skill value); this indicates that the subordinate is somewhat hindered by the poor skill of the commander (think: a prodigy is limited by his average-IQ supervisor)
Computer Science student, reporting for duty. College gon be tough, so no need to be rush.

Kyle Baxter
Posts: 10
Joined: Sat, 22. Dec 18, 01:36
x4

Re: [MOD] Civilian Fleets (v1.09)

Post by Kyle Baxter » Fri, 22. Nov 19, 18:31

Great, it works now flawlessly! Thank you for the update and the clarification. :)

Vectorial1024
Posts: 151
Joined: Mon, 30. Jul 18, 04:16
x4

Re: [MOD] Civilian Fleets (v1.10)

Post by Vectorial1024 » Sat, 28. Dec 19, 16:42

Latest v1.10 update introduces the Fallback Mode, a safety measure which guarantees this mod to continue functioning even when Right Click API fails.

I do hope that the Right Click API will be updated in the future.
Computer Science student, reporting for duty. College gon be tough, so no need to be rush.

captainradish
Posts: 141
Joined: Sat, 30. Apr 05, 06:09
x4

Re: [MOD] Civilian Fleets (v1.11)

Post by captainradish » Fri, 3. Jan 20, 04:57

3.0 hotfix 2 (I think) changed the nature of wing commands and now defend(default) doesn't seem to exist anymore so fallback mode doesn't seem to be working properly. If I assign miners to defend miners with commands all they seem to do is defend. They don't mine themselves. Is there a fix or does this have to be updated?

Vectorial1024
Posts: 151
Joined: Mon, 30. Jul 18, 04:16
x4

Re: [MOD] Civilian Fleets (v1.11)

Post by Vectorial1024 » Fri, 3. Jan 20, 16:15

captainradish wrote:
Fri, 3. Jan 20, 04:57
3.0 hotfix 2 (I think) changed the nature of wing commands and now defend(default) doesn't seem to exist anymore so fallback mode doesn't seem to be working properly. If I assign miners to defend miners with commands all they seem to do is defend. They don't mine themselves. Is there a fix or does this have to be updated?
Egosoft might have changed how their script structures look like, and so my patches may fail.

Since I use my heavily modded mid-late-game savefile for testing this mod, I cant easily move over to v3.0 beta, so currently I dont have much options than to hope Egosoft quickly release v3.0...

But as a matter of fact, currently, if civ-fleet assignment fails, the mod will instruct those subordinates to use the "Follow" default behavior.
Computer Science student, reporting for duty. College gon be tough, so no need to be rush.

captainradish
Posts: 141
Joined: Sat, 30. Apr 05, 06:09
x4

Re: [MOD] Civilian Fleets (v1.11)

Post by captainradish » Sun, 5. Jan 20, 19:30

Vectorial1024 wrote:
Fri, 3. Jan 20, 16:15
captainradish wrote:
Fri, 3. Jan 20, 04:57
3.0 hotfix 2 (I think) changed the nature of wing commands and now defend(default) doesn't seem to exist anymore so fallback mode doesn't seem to be working properly. If I assign miners to defend miners with commands all they seem to do is defend. They don't mine themselves. Is there a fix or does this have to be updated?
Egosoft might have changed how their script structures look like, and so my patches may fail.

Since I use my heavily modded mid-late-game savefile for testing this mod, I cant easily move over to v3.0 beta, so currently I dont have much options than to hope Egosoft quickly release v3.0...

But as a matter of fact, currently, if civ-fleet assignment fails, the mod will instruct those subordinates to use the "Follow" default behavior.
OK, it started working now. I'm not sure what the original issue was but if you add ships to defence -> Alpha it will change them to beta -> miner, trade, whatever.

Vectorial1024
Posts: 151
Joined: Mon, 30. Jul 18, 04:16
x4

Re: [MOD] Civilian Fleets (v1.11)

Post by Vectorial1024 » Fri, 10. Jan 20, 17:50

captainradish wrote:
Sun, 5. Jan 20, 19:30
Vectorial1024 wrote:
Fri, 3. Jan 20, 16:15
captainradish wrote:
Fri, 3. Jan 20, 04:57
3.0 hotfix 2 (I think) changed the nature of wing commands and now defend(default) doesn't seem to exist anymore so fallback mode doesn't seem to be working properly. If I assign miners to defend miners with commands all they seem to do is defend. They don't mine themselves. Is there a fix or does this have to be updated?
Egosoft might have changed how their script structures look like, and so my patches may fail.

Since I use my heavily modded mid-late-game savefile for testing this mod, I cant easily move over to v3.0 beta, so currently I dont have much options than to hope Egosoft quickly release v3.0...

But as a matter of fact, currently, if civ-fleet assignment fails, the mod will instruct those subordinates to use the "Follow" default behavior.
OK, it started working now. I'm not sure what the original issue was but if you add ships to defence -> Alpha it will change them to beta -> miner, trade, whatever.
Note to self: Egosoft probably introduced extra flags for assignment in v3.0, so only assignment to Alpha (which is probably the "default value") "fails".
Computer Science student, reporting for duty. College gon be tough, so no need to be rush.

Post Reply

Return to “X4: Foundations - Scripts and Modding”