[Mod] Update Trade Offers - Universe (final)

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

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

graphicboy
Posts: 718
Joined: Wed, 3. Jul 13, 03:21
xr

[Mod] Update Trade Offers - Universe (final)

Post by graphicboy » Sat, 27. Apr 19, 21:21

I got tired of "Update Trade Offers" / "Revisit Known Stations" (they're essentially the same thing) not working.

This mod changes UTO/RKS such that:
  • All known stations in the universe are checked.
  • If the trade offers on the station have expired, the station is revisited.
  • The ship will dock after a cycle, and undock if more stations are found to update.
  • The behavior runs in a loop, so it will never expire (as far as I know).
  • Sectors and stations are randomized, so you can run more than one updater ship at a time... but you really only need 1, maybe 2.
  • The ship is renamed to "Universal Trade Updater" when the job starts.
I recommend you start this using the default behavior "Revisit Known Stations" (starting sector is ignored), rather than the right-click "Update Trade Offers".

If you've installed correctly, you'll see "Update Trade Offers - Universe: Started." in a pop-up, otherwise this mod should be silent.

You can get it here: https://anonfile.com/HbD0ubk0n8/UpdateT ... iverse_rar

If you run into any problems, please quote me and let me know. Also feel free to embed this in any compilation mods, such as happened with my station-money-transfer script in "Fixin' X".

Enjoy


Known issues:
- Only seen it once, but my updater got on the race track and never left. Assuming station was destroyed, or other oddity (per ES' original scripts). If it keeps happening I'll work up a fix.



The early conversations below were from earlier passes.
Last edited by graphicboy on Mon, 29. Apr 19, 02:06, edited 15 times in total.

graphicboy
Posts: 718
Joined: Wed, 3. Jul 13, 03:21
xr

Re: Attempting to fix revisit known stations

Post by graphicboy » Sat, 27. Apr 19, 22:28

(see OP)
Last edited by graphicboy on Sun, 28. Apr 19, 19:41, edited 2 times in total.

DeadAirRT
Posts: 1008
Joined: Fri, 25. Jan 19, 03:26
x4

Re: Attempting to fix revisit known stations

Post by DeadAirRT » Sat, 27. Apr 19, 22:31

What do you think is wrong with revisit known stations? And why are you finding trades NOT known?

graphicboy
Posts: 718
Joined: Wed, 3. Jul 13, 03:21
xr

Re: Attempting to fix revisit known stations

Post by graphicboy » Sat, 27. Apr 19, 22:35

(see OP)
Last edited by graphicboy on Sun, 28. Apr 19, 19:41, edited 2 times in total.

graphicboy
Posts: 718
Joined: Wed, 3. Jul 13, 03:21
xr

Re: Attempting to fix revisit known stations

Post by graphicboy » Sat, 27. Apr 19, 22:36

(see OP)
Last edited by graphicboy on Sun, 28. Apr 19, 19:41, edited 1 time in total.

DeadAirRT
Posts: 1008
Joined: Fri, 25. Jan 19, 03:26
x4

Re: Attempting to fix revisit known stations

Post by DeadAirRT » Sat, 27. Apr 19, 22:48

I've never had a problem with it personally but to comment on your code, the order is meant to only be in sector while you are checking the entire galaxy. It will probably have a noticeable hit on performance. Also, it may end up not doing much because trades are known as soon as the station is known and I'm not sure that they become unkown once the update timer expires.

graphicboy
Posts: 718
Joined: Wed, 3. Jul 13, 03:21
xr

Re: Attempting to fix revisit known stations

Post by graphicboy » Sat, 27. Apr 19, 22:53

(see OP)
Last edited by graphicboy on Sun, 28. Apr 19, 19:41, edited 1 time in total.

DeadAirRT
Posts: 1008
Joined: Fri, 25. Jan 19, 03:26
x4

Re: Attempting to fix revisit known stations

Post by DeadAirRT » Sat, 27. Apr 19, 23:00

Since you are processing all stations found you may need to create an order to move instead of use move_to but that's outside my area of knowledge.

Best way to figure out what isn't working is add some debug_to_file to see what your values are at each step.

graphicboy
Posts: 718
Joined: Wed, 3. Jul 13, 03:21
xr

Re: Attempting to fix revisit known stations

Post by graphicboy » Sat, 27. Apr 19, 23:30

(see OP)
Last edited by graphicboy on Sun, 28. Apr 19, 19:40, edited 1 time in total.

DeadAirRT
Posts: 1008
Joined: Fri, 25. Jan 19, 03:26
x4

Re: Attempting to fix revisit known stations

Post by DeadAirRT » Sat, 27. Apr 19, 23:34

It has to be an issue then with trades not returning to unknown once timer expires then or no timers on the trade information has expired.

The reason it works when you don't have the station known requirement is because no known station has unknown trade offers as far I can theorize.

graphicboy
Posts: 718
Joined: Wed, 3. Jul 13, 03:21
xr

Re: [Mod] Update Trade Offers - Universe

Post by graphicboy » Sun, 28. Apr 19, 19:43

=== Updated to be a proper mod ===

graphicboy
Posts: 718
Joined: Wed, 3. Jul 13, 03:21
xr

Re: [Mod] Update Trade Offers - Universe

Post by graphicboy » Sun, 28. Apr 19, 20:22

Updated to rename the ship, and shuffle sectors/stations so you can run more than one ship on this task at a time.

graphicboy
Posts: 718
Joined: Wed, 3. Jul 13, 03:21
xr

Re: [Mod] Update Trade Offers - Universe

Post by graphicboy » Mon, 29. Apr 19, 00:49

Updated to use gravidar ticks instead of delays, and the ship now docks/undocks as needed.

Nifhtyeq
Posts: 73
Joined: Fri, 15. Feb 19, 17:32

Re: [Mod] Update Trade Offers - Universe (final)

Post by Nifhtyeq » Mon, 29. Apr 19, 04:01

graphicboy wrote:
Sat, 27. Apr 19, 21:21
I got tired of "Update Trade Offers" / "Revisit Known Stations" (they're essentially the same thing) not working.

This mod changes UTO/RKS such that:
  • All known stations in the universe are checked.
  • If the trade offers on the station have expired, the station is revisited.
  • The ship will dock after a cycle, and undock if more stations are found to update.
  • The behavior runs in a loop, so it will never expire (as far as I know).
  • Sectors and stations are randomized, so you can run more than one updater ship at a time... but you really only need 1, maybe 2.
  • The ship is renamed to "Universal Trade Updater" when the job starts.
I recommend you start this using the default behavior "Revisit Known Stations" (starting sector is ignored), rather than the right-click "Update Trade Offers".

If you've installed correctly, you'll see "Update Trade Offers - Universe: Started." in a pop-up, otherwise this mod should be silent.

You can get it here: https://anonfile.com/HbD0ubk0n8/UpdateT ... iverse_rar

If you run into any problems, please quote me and let me know. Also feel free to embed this in any compilation mods, such as happened with my station-money-transfer script in "Fixin' X".

Enjoy


Known issues:
- Only seen it once, but my updater got on the race track and never left. Assuming station was destroyed, or other oddity (per ES' original scripts). If it keeps happening I'll work up a fix.



The early conversations below were from earlier passes.
I don't think vanilla revisit known stations or update trade offers were supposed to for the entire x verse but rather for sector you are currently in. Does it not do this currently or did you want to create a universe wide version of the vanilla command.

graphicboy
Posts: 718
Joined: Wed, 3. Jul 13, 03:21
xr

Re: [Mod] Update Trade Offers - Universe (final)

Post by graphicboy » Mon, 29. Apr 19, 04:19

Nifhtyeq wrote:
Mon, 29. Apr 19, 04:01
I don't think vanilla revisit known stations or update trade offers were supposed to for the entire x verse but rather for sector you are currently in. Does it not do this currently or did you want to create a universe wide version of the vanilla command.
As far as I've ever observed, the vanilla behaviors don't work. You are correct however, they are single-sector.

While it would be trivial to switch this mod over to single-sector (to line up with vanilla), in the interest of performance / ease of use, I went with universe.

If anyone wants that version:
a) drop the sector search/loop entirely, and
b) use $destination when finding stations (rather than $sector)

The rest "should" work just fine.

Nifhtyeq
Posts: 73
Joined: Fri, 15. Feb 19, 17:32

Re: [Mod] Update Trade Offers - Universe (final)

Post by Nifhtyeq » Mon, 29. Apr 19, 05:25

graphicboy wrote:
Mon, 29. Apr 19, 04:19
Nifhtyeq wrote:
Mon, 29. Apr 19, 04:01
I don't think vanilla revisit known stations or update trade offers were supposed to for the entire x verse but rather for sector you are currently in. Does it not do this currently or did you want to create a universe wide version of the vanilla command.
As far as I've ever observed, the vanilla behaviors don't work. You are correct however, they are single-sector.

While it would be trivial to switch this mod over to single-sector (to line up with vanilla), in the interest of performance / ease of use, I went with universe.

If anyone wants that version:
a) drop the sector search/loop entirely, and
b) use $destination when finding stations (rather than $sector)

The rest "should" work just fine.
But is that a straight up bug because I would put that in tech support section or public beta support. Because the command works for me.

graphicboy
Posts: 718
Joined: Wed, 3. Jul 13, 03:21
xr

Re: [Mod] Update Trade Offers - Universe (final)

Post by graphicboy » Mon, 29. Apr 19, 05:46

Nifhtyeq wrote:
Mon, 29. Apr 19, 05:25
But is that a straight up bug because I would put that in tech support section or public beta support. Because the command works for me.
:shrug: I've posted plenty over there. I'll give vanilla another run one of these days. If no one else is having this problem, then we'll call this the "universe version".

Nifhtyeq
Posts: 73
Joined: Fri, 15. Feb 19, 17:32

Re: [Mod] Update Trade Offers - Universe (final)

Post by Nifhtyeq » Mon, 29. Apr 19, 13:29

graphicboy wrote:
Mon, 29. Apr 19, 05:46
Nifhtyeq wrote:
Mon, 29. Apr 19, 05:25
But is that a straight up bug because I would put that in tech support section or public beta support. Because the command works for me.
:shrug: I've posted plenty over there. I'll give vanilla another run one of these days. If no one else is having this problem, then we'll call this the "universe version".
Do you have a vanilla savefile and do you know what version this bug happened in.
Thanks

graphicboy
Posts: 718
Joined: Wed, 3. Jul 13, 03:21
xr

Re: [Mod] Update Trade Offers - Universe (final)

Post by graphicboy » Mon, 29. Apr 19, 13:34

Nifhtyeq wrote:
Mon, 29. Apr 19, 13:29
Do you have a vanilla savefile and do you know what version this bug happened in.
Not handy. I've tried it in every build post 2.0. /hijack

Also found the subscribe button. Imagine that.

12vh3
Posts: 8
Joined: Sun, 17. Nov 19, 09:25
x3ap

Re: [Mod] Update Trade Offers - Universe (final)

Post by 12vh3 » Tue, 8. Jun 21, 09:33

Hi,

does anyone has this mod and can reupload it?

Thanks.

Post Reply

Return to “X4: Foundations - Scripts and Modding”