[MOD] Satellite Network v0.33

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

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

Post Reply
morbideth
Posts: 389
Joined: Sun, 9. Nov 08, 04:07
x3tc

[MOD] Satellite Network v0.33

Post by morbideth » Sun, 9. Dec 18, 19:14

A simply mod to deploy satellites to cover all of the stations. Because I didn't want to do it by hand. This will place sats near (more or less) all non-hostile station in a sector (unless the station is already covered by a sat), then it will look in nearby sectors for a station that needs a sat. It is technically not galaxy wide, as that search would be too cpu intensive, but a single ship with this command would effectively cover most of the stations in the galaxy... eventually.

Only available as a default behavior order not as a right click order (because I couldn't see how to do that).

To use, set the default behavior to "Deploy Satellites" and set the starting sector, whether or not to use the more expensive advanced satellite, whether or not to cover gates (includes both jump gates and highway gates [also inactive jump gates because they apparently count]), whether or not to restock, the amount of satellites to purchase when restocking (up to the maximum amount this ship can carry), and finally, the search range, in clusters (the big hexagons).
NOTE: Increasing the search range is not recommended unless your ship finds itself in a dead end system, setting it to max is strongly discouraged. The script will do just fine at the default value, you may bump it up by one or two if it gets stuck.

It will take a few minutes for your pilot to perform his calculations before placing sats, if he is just sitting in a system where stations need sats it is because he is busy crunching numbers.

This is not intended to be any kind of recreation of the awesome X3 satellite network mods, it is just a quick fix until something better comes along.

If you having trouble with the language file, make sure the mod is in your game folder/extensions NOT your documents folder.

v0.33
Image

Changelog:
  • v0.33
    • Fixed error spam in the search for new sector/collaboration code.
  • v0.32
    • Moved to a cat file to hopefully fix the language files.
  • v0.31
    • Ships will now restock at equipment docks instead of shipyards/wharfs as equipment docks don't have the perpetually short on resources issue.
    • The order will no longer cancel itself if range is set to 0.
  • v0.30 Major update
    • Note: if you are updating from an older version, all deploy satellites orders will be canceled and have to be reissued. This is due to the new options.
    • Added several more options to the config screen:
      • Cover Gates: Will place sats to cover gates as well as stations. (Includes highway and inactive gates)
      • Use Advanced Sats: If checked, the ship will only deploy Advanced Satellites, if unchecks it will only use Basic Satellites. This applies regardless of what is in the hold.
      • Restock: If checked the ship will fly to the nearest shipyard/wharf and buy some satellites when it runs out.
      • Stock Amount: How many satellites to purchase each time the ship goes to restock, up to the maximum amount ship ship can carry. Defaults to 10.
      • Search Range: How far to search for stations/gates that need a satellite, in clusters (The big hexagons), Default value is 2. Decreasing this to 0 will make the ship stay in the same sector. Increasing it beyond 2 is not recommended unless your ship is stuck.
    • Brand new placement algorithm. This new algorithm will try to optimize the placement of satellites to use the fewest satellites possible. However, this algorithm trades accuracy for efficiency; it does not find the best solution, only one that is 'good enough'. It depends largely on the initial guess values with are randomize. This means that each run it will tend to come up with a different solution, some of which may be better than others.
      As should be obvious, this is much computationally intensive than just flying to a station as in previous version. Thus the calculation is spread out over a few minutes, during which your ship will sit there seemingly doing nothing. This is perfectly normal.
    • Will no longer place sats on top of stations, to make it easier to click on the stations. If the above algorithm tell it to place a sat on a station, it will offset it 15km in the x and z direction.
    • Collaboration: Ships will no longer compete to see who can race to a station the fastest. When a ship arrives in a target sector, it will check to see if someone else is already there deploying sats, if so it will move on.
    • Editing a value in the config menu will now restart the script, explicitly.
    • If a ship runs out of a satellites and the restock order is not checked, the ship will cancel the order, reverting to the default hold position order, then message you.
    • Ships will no longer play highway merry-go-round.
    • Moved download link to mediafire since people without adblockers had issue with previous host.
  • v0.22
    • Round 3 vs. the language file.
  • v0.21
    • Another attempt at fixing the language file issue.
  • v0.20
    • Added support for advanced satellites.
    • Added (untranslated) language files for non-english languages.
    • Attempted fix for flying through destination sector when many station already had sats nearby.
    • Improved checks for multiple sat layers.
    • Improved some interrupts, I think.
  • v0.10 initial release
Image
Last edited by morbideth on Sat, 29. Dec 18, 11:07, edited 11 times in total.

bm01
Posts: 421
Joined: Wed, 22. Jul 09, 22:31
x4

Re: [MOD] Satellite Network

Post by bm01 » Sun, 9. Dec 18, 19:31

Does it discover stations too?

morbideth
Posts: 389
Joined: Sun, 9. Nov 08, 04:07
x3tc

Re: [MOD] Satellite Network

Post by morbideth » Sun, 9. Dec 18, 19:54

bm01 wrote:
Sun, 9. Dec 18, 19:31
Does it discover stations too?
It does not explore, if, however, placing a satellite reveals a station it will come back and place a sat on it, eventually.

Grimshad
Posts: 98
Joined: Wed, 6. May 09, 06:31
x3ap

Re: [MOD] Satellite Network

Post by Grimshad » Sun, 9. Dec 18, 22:13

This is what i get, what am i missing?

https://imgur.com/xixcYRU

barra
Posts: 14
Joined: Tue, 31. Jan 17, 08:58
x4

Re: [MOD] Satellite Network

Post by barra » Sun, 9. Dec 18, 22:19

Grimshad wrote:
Sun, 9. Dec 18, 22:13
This is what i get, what am i missing?

https://imgur.com/xixcYRU
same here

User avatar
Baconnaise
Posts: 479
Joined: Sat, 23. Nov 13, 16:50
xr

Re: [MOD] Satellite Network

Post by Baconnaise » Sun, 9. Dec 18, 22:23

This mod sounds wonderful. Can't wait to try it out.

morbideth
Posts: 389
Joined: Sun, 9. Nov 08, 04:07
x3tc

Re: [MOD] Satellite Network

Post by morbideth » Sun, 9. Dec 18, 22:52

Grimshad wrote:
Sun, 9. Dec 18, 22:13
This is what i get, what am i missing?

https://imgur.com/xixcYRU
That is the translation file text. Is your game set to english? What other mods do you have installed? Could be some kind of conflict.
That being said, it is just the label. You can still click on the order and it will work.

I'll look at the replies and see what is going on in the morning.

Grimshad
Posts: 98
Joined: Wed, 6. May 09, 06:31
x3ap

Re: [MOD] Satellite Network

Post by Grimshad » Mon, 10. Dec 18, 00:00

morbideth wrote:
Sun, 9. Dec 18, 22:52
Grimshad wrote:
Sun, 9. Dec 18, 22:13
This is what i get, what am i missing?

https://imgur.com/xixcYRU
That is the translation file text. Is your game set to english? What other mods do you have installed? Could be some kind of conflict.
That being said, it is just the label. You can still click on the order and it will work.

I'll look at the replies and see what is going on in the morning.
Game is in English, using auto explore, learn all the things, and trade buy notifcation. The problem is that I can't click it. it's greyed out like my pilot doesn't have enough stars, but it only requires 0, so i don't understand why it's greyed out.

ShadowTek49
Posts: 17
Joined: Sat, 8. Dec 18, 02:06

Re: [MOD] Satellite Network

Post by ShadowTek49 » Mon, 10. Dec 18, 00:15

I don't get it? When you say " set the default behavior to "Deploy Satellites" and set the starting sector." How do you do that?

mcal9909
Posts: 72
Joined: Thu, 22. Jul 10, 05:50
x3tc

Re: [MOD] Satellite Network

Post by mcal9909 » Mon, 10. Dec 18, 00:41

ShadowTek49 wrote:
Mon, 10. Dec 18, 00:15
I don't get it? When you say " set the default behavior to "Deploy Satellites" and set the starting sector." How do you do that?
Select the ship you want to use. Right click him and choose information.
Select the behavior panel. Then change the ships default behavior to "Deploy Satellites" then click the Area to explore box, it will open the map. Choose as sector and click ok. Then confirm the changes and the order will start.


Had a strange bug of sorts. I started my Sat deploy in Grand Exchange I, Once he had finsihed he moved to Pious Mists II deployed sats, Then Pontiflex's Claim deployed sats, Then Cardinals Redress deployed sats. After this he seemd to ride the Highway between Pious Mists II and Holy Vision in a loop. Going back and forth without deploying any new sats. He had 45 left in his inventory. Starting his orders again just resulted in him going through this loop again. Moved him to Grand Exchange III and changed his area to deploy to Grand Exchange III and started him backup and hes off deploying sats again.

BD
Posts: 17
Joined: Tue, 3. Feb 04, 17:18
x4

Re: [MOD] Satellite Network

Post by BD » Mon, 10. Dec 18, 01:05

It's a really nice mod. I like it.
But it ignores my manual deployed satellites between 2 stations to cover both. It puts a new satellite on both stations. Also it jumps from sector to sector before all stations have a deployed satellite. And the last one, is that it's flying through sector without any coverage to do it's work in another one.
But hey, nice work!

ShadowTek49
Posts: 17
Joined: Sat, 8. Dec 18, 02:06

Re: [MOD] Satellite Network

Post by ShadowTek49 » Mon, 10. Dec 18, 01:10

mcal9909 wrote:
Mon, 10. Dec 18, 00:41
ShadowTek49 wrote:
Mon, 10. Dec 18, 00:15
I don't get it? When you say " set the default behavior to "Deploy Satellites" and set the starting sector." How do you do that?
Select the ship you want to use. Right click him and choose information.
Select the behavior panel. Then change the ships default behavior to "Deploy Satellites" then click the Area to explore box, it will open the map. Choose as sector and click ok. Then confirm the changes and the order will start.


Had a strange bug of sorts. I started my Sat deploy in Grand Exchange I, Once he had finsihed he moved to Pious Mists II deployed sats, Then Pontiflex's Claim deployed sats, Then Cardinals Redress deployed sats. After this he seemd to ride the Highway between Pious Mists II and Holy Vision in a loop. Going back and forth without deploying any new sats. He had 45 left in his inventory. Starting his orders again just resulted in him going through this loop again. Moved him to Grand Exchange III and changed his area to deploy to Grand Exchange III and started him backup and hes off deploying sats again.
Got it, thanks!
Can we use advanced sats? Or only normal or don't it matter?

mcal9909
Posts: 72
Joined: Thu, 22. Jul 10, 05:50
x3tc

Re: [MOD] Satellite Network

Post by mcal9909 » Mon, 10. Dec 18, 02:01

ShadowTek49 wrote:
Mon, 10. Dec 18, 01:10
mcal9909 wrote:
Mon, 10. Dec 18, 00:41
ShadowTek49 wrote:
Mon, 10. Dec 18, 00:15
I don't get it? When you say " set the default behavior to "Deploy Satellites" and set the starting sector." How do you do that?
Select the ship you want to use. Right click him and choose information.
Select the behavior panel. Then change the ships default behavior to "Deploy Satellites" then click the Area to explore box, it will open the map. Choose as sector and click ok. Then confirm the changes and the order will start.


Had a strange bug of sorts. I started my Sat deploy in Grand Exchange I, Once he had finsihed he moved to Pious Mists II deployed sats, Then Pontiflex's Claim deployed sats, Then Cardinals Redress deployed sats. After this he seemd to ride the Highway between Pious Mists II and Holy Vision in a loop. Going back and forth without deploying any new sats. He had 45 left in his inventory. Starting his orders again just resulted in him going through this loop again. Moved him to Grand Exchange III and changed his area to deploy to Grand Exchange III and started him backup and hes off deploying sats again.
Got it, thanks!
Can we use advanced sats? Or only normal or don't it matter?
Seems the order will use what ever Satellites you have, Advanced sats will be used first then normal. So load em up with what ever you want to use.

morbideth
Posts: 389
Joined: Sun, 9. Nov 08, 04:07
x3tc

Re: [MOD] Satellite Network

Post by morbideth » Mon, 10. Dec 18, 08:41

ShadowTek49 wrote:
Mon, 10. Dec 18, 01:10
Got it, thanks!
Can we use advanced sats? Or only normal or don't it matter?
BD wrote:
Mon, 10. Dec 18, 01:05
It's a really nice mod. I like it.
But it ignores my manual deployed satellites between 2 stations to cover both. It puts a new satellite on both stations. Also it jumps from sector to sector before all stations have a deployed satellite. And the last one, is that it's flying through sector without any coverage to do it's work in another one.
But hey, nice work!
It will deploy advanced sats but it only calculate the coverage using the range of basic sats. So using advanced sats is a waste.

When checking for stations outside its current sector, it goes to the first one it finds, which is not usually the closest. Finding the closest would require checking every station in range to see if they have a sat nearby and then sorting the list. I could do that if people want but it is much more computationally intensive and might cause a fps drop.

STOPix
Posts: 10
Joined: Wed, 28. Jun 17, 05:47
x4

Re: [MOD] Satellite Network

Post by STOPix » Mon, 10. Dec 18, 09:21

It is strange that Egosoft programmers could not write a similar script. :lol:

Does anyone know why they still haven't turned on support for steam workshop?

Post Reply

Return to “X4: Foundations - Scripts and Modding”