[SCRIPT] Autotrader Sector Lock 1.0 . . . . . . . . { UPDATED 2007/05/30 }

The place to discuss scripting and game modifications for X³: Reunion.

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

User avatar
halo112358
Posts: 374
Joined: Thu, 16. Feb 06, 07:56
x3

Post by halo112358 » Wed, 30. May 07, 11:15

unfunf wrote:halo you know what might make sense is a autotrader multi-sector lock based on race.

If you are enemies with a race you could just lock every sector belonging to that race. Of course there would have to be a way to get UTs to jump across those sectors.

Just a thought.
You should be able to just set the race to enemy on the UT's ship and be done with it ;)

If you can't, then go here and download gnasirator's tuned up mk3 trader - it's 100% improved over the stock mk3 trader (fewer crashes, improved ecell routines, etc..). I know that his improved mk3 respects friend/foe settings and doesn't attempt to trade in foe sectors/stations.

edit: using my script to multi-sector lock based on race is computationally expensive - it's much cheaper (in cpu time) to use gnasirator's improved UT.
Last edited by halo112358 on Sat, 2. Jun 07, 11:43, edited 1 time in total.
*** modified ***

[ external image ]

qarnaj
Posts: 1
Joined: Fri, 1. Jun 07, 16:58

Post by qarnaj » Fri, 1. Jun 07, 17:39

Do you have to have any particular trading software installed before the commands become available? I only have Trade Mk3 on my UTs and don't see the command coming up in the trade commands window.

User avatar
halo112358
Posts: 374
Joined: Thu, 16. Feb 06, 07:56
x3

Post by halo112358 » Sat, 2. Jun 07, 11:40

qarnaj wrote:Do you have to have any particular trading software installed before the commands become available? I only have Trade Mk3 on my UTs and don't see the command coming up in the trade commands window.
If the script is installed correctly then you should see the commands to "Lock Sector" and "List Locked Sectors" on all of your ships - there is no ware requirement.

Make sure you have the script editor turned on and double check under the trade commands section, let me know if there is still a problem ;)
*** modified ***

[ external image ]

viptir
Posts: 486
Joined: Wed, 8. Dec 04, 22:48
x2

Post by viptir » Wed, 6. Jun 07, 04:28

Been testing this on my PHQ sector. Not stopping at least two of the UTs (repeat offenders). Fired one, dropped the other in a Xenon Sector.
Breaking games to help ward off corporate greed-induced folly.

wingot
Posts: 14
Joined: Tue, 5. Jun 07, 10:00

Post by wingot » Wed, 6. Jun 07, 05:36

halo112358 wrote: If the script is installed correctly then you should see the commands to "Lock Sector" and "List Locked Sectors" on all of your ships - there is no ware requirement.
Do you have to lock the sector for every single UT? Or is it a global list?

viptir
Posts: 486
Joined: Wed, 8. Dec 04, 22:48
x2

Post by viptir » Wed, 6. Jun 07, 12:37

It's global. I did it on several traders, then went to check the messages: lock, unlock, lock, unlock, et cetera.
Breaking games to help ward off corporate greed-induced folly.

saar
Posts: 51
Joined: Mon, 24. Jul 06, 19:30
x3

Post by saar » Thu, 21. Jun 07, 20:37

sorry for the noob question but i have never installed a scirpt\played a scripted game in my file and am pretty new to X3: is cycrow's installer required to install your script?

BTW, great script! Congratulations!

I am exactly in your same situation with the only difference that in my game Grand Exchange is experiencing some heavy traffic all of the same color...purple...!!! :(

And having started with xtreme doesnt help much in terms of credits available so a little bit of help is really not cheating :D

Tx so much for the help in advance

saar
Posts: 51
Joined: Mon, 24. Jul 06, 19:30
x3

Post by saar » Tue, 26. Jun 07, 09:21

Hi Halo,

I have installed your script together with Gnasirator's but I seem to experience something unusual. I have a saved game with 4 ST's in 4 different sectors (all between lvl10 and 12 so ready to become UT's).

Unfortunately when I go to the trade menu of the ST's I don't see neither functions Start Sector Trader and Universal Trader; all i can see it's Manual Trade Run. How am i supposed to tell any freighter to start either ST or UT?

Do I need to enable your script to be able to see Start ST\UT again? Also I don't see any command to blacklist sectors.

My game version is vanilla 2.0.02 plus Bonus Package 3.1.06 and the two scripts mentioned above.

Thanks,
Saar

jhscott
Posts: 8
Joined: Fri, 29. Jun 07, 10:01

Post by jhscott » Fri, 6. Jul 07, 01:37

I have a question. I've installed this script, as well as the AStar mod (and your jump addition) and gnasirator's mk3 improvement, but it doesn't seem to be working well. I left the game on SETA for a few hours, and two of my traders got destroyed in Brennan's Triumph, despite the fact that it was blacklisted. That wasn't the first time that traders have wondered into pirate sections and gotten destroyed, either. The only other scripts I have installed are all the bonus package ones. Is it possible that there's a conflict there?

DaveyP
Posts: 986
Joined: Mon, 7. Nov 05, 19:06
x3tc

Post by DaveyP » Fri, 6. Jul 07, 09:41

I have the same problem. I've lost 2 UTs in Mi Tons refuge despite the sector being locked and the ships friend/foe settings being set accordingly.

The sector shows as being locked when I run the "report locked sectors" command.

Any ideas?

User avatar
halo112358
Posts: 374
Joined: Thu, 16. Feb 06, 07:56
x3

Post by halo112358 » Fri, 6. Jul 07, 18:27

Unless you know exactly what the trader was doing when it wandered into a locked sector it's hard for me to tell what went wrong.

While it is possible for traders to select newly built stations in locked sectors it is unlikely - it's more likely that some other script caused the trader to move into the dangerous sector for some reason.

If you can find a pattern in the ship losses and look at it closely (especially if you can catch the ship in the act) you can figure out exactly which script is causing the ship to go there. It could be a refueling run, or a supply run (drones, etc) or the ship could have tried to escape to that sector to avoid pirates. It's hard for me to tell :?
*** modified ***

[ external image ]

Cacker
Posts: 10
Joined: Thu, 12. Oct 06, 19:41

Post by Cacker » Fri, 6. Jul 07, 19:55

Hi,

Just to report I too have had 3-4 UT losses in sectors that were locked. Most notably Ghinn's Escape, which currently has two Khaak Destroyer's and a Khaak Carrier living there.

A couple of times i was just checking my inventory and managed twice to rescue the UT's before they were attacked. I got a report from them each time and they indicate that Ghinn's Escape is indeed locked.

Next time i will check what they are doing and check the freight to see what their current destination/wares/ecells.

fyi -

X3 v2.02 with Bala Gi Missions Bonus Pack (dl'd from Egosoft)
No other scripts installed apart from sector lock

Cheers,

Cacker

Annex
Posts: 39
Joined: Sun, 18. Jul 04, 21:11

Post by Annex » Sat, 7. Jul 07, 20:04

Ive started losing UT's in Farnhams Legend, even though it was one of the first systems ive locked. Ive verified the system is locked and yet UTs all of a sudden started going there to do business. Velvet Tears, a system from XTM, was locked immediately and yet my UTs started using that system almost immediately and have never obeyed the lock until I cheated to destroy the one chelt factory there.

Cacker
Posts: 10
Joined: Thu, 12. Oct 06, 19:41

Post by Cacker » Sun, 8. Jul 07, 12:02

Okay, I just had a UT escape from a locked sector (Ghinn's escape, which has a Khaak Carrier and 2xKhaak Destroyers).

I checked it's orders after it had escaped .. and it was enroute to buying lasertowers from a factory in Ghinn's Escape. So it seems like it was just on a normal trading run.

However, it could be coincidence, but i'm pretty sure most, if not all of these occurences happened whilst SETA was active.

User avatar
bumpinthenight
Posts: 118
Joined: Thu, 5. Jul 07, 20:58
x3tc

Post by bumpinthenight » Mon, 9. Jul 07, 21:11

I lost a Dolphin in a locked sector that was trying to buy energy from the last remaining station in there (khack attack), he'd also avoided a pirate attack previously, couldn't check but possibly it was replacing energy cells for future jumping needs.

Over all I'd say that since employing this lock out add-on my losses have greatly reduced. 2-3 UTs in an overnight SETA session prior, just one (that dolphin) last night during the same duration.

James_D
Posts: 1
Joined: Tue, 10. Jul 07, 00:38

Post by James_D » Tue, 10. Jul 07, 00:43

As a new starter to X3 (less than 1 week played) I just wanted to say thanks for this script, I'd rushed my ST's to UT's and kept loosing them, my damned nova was so heavily armed that most times I couldnt jump to save them and for some reason when assigning my mercuries to my stations they'd go miles into pirate territory for energy cells despite their being 2 solar farms in the same system! :roll:

Anyway tonight this script has saved my sanity so thanks.

James

User avatar
halo112358
Posts: 374
Joined: Thu, 16. Feb 06, 07:56
x3

Post by halo112358 » Tue, 10. Jul 07, 05:01

Here's a suggestion to anyone who's losing ships to locked sectors - stop all of your autotraders and unlock any sectors then seta for a little bit, maybe a minute or two, then lock the sectors again, seta a bit more and then restart your UT's.

Here's how this script works: when you lock a sector it's stuffed into a global 2d array representing the universe. Any value in this array can be true (locked) or false (ignored). The script walks the universe grid, in order, from upper left to lower right and checks the global array to see if the current sector should be locked or not. If the sector should be locked then the script grabs a list of all stations in that sector and attempts to lock each of them with a perpetual task running on that station. The universe lock script will process the entire universe grid and then restart in the upper left corner - I refer to the universe lock task as the "rolling universe task" or "universe lock script", it's the coordinator for the whole system.

Here's the problem: if something has already requested that a station be locked then the perpetual lock task will fail and end. This means that the station won't be locked and that your traders are free to request a lock once the current locker releases it. If the lock target is extremely desirable (Full load of goods, or full demand for goods) then your traders will attempt to lock it and trade with it as a high priority. If they happen to have the station locked when the rolling universe task comes back to the sector then the cycle will start over.

There's one other possible problem: If GOD creates new stations then they're available for trade until the rolling task comes around again and locks them.

Here's why these problems still exist: I can make the rolling task roll around more often, unfortunately if I do that then there is a performance hit from processing sectors and stations more often. I tried to tune the script so that you wouldn't notice it running and I'm still convinced that decreasing the wait times isn't the best way to fix these issues.

I'll see if I can come up with some way to improve the locking mechanism, this was the best I could come up with when I wrote the script originally (no promises ;) it might take a while to improve the method).

edit: with gnasirator's improved UT script I don't think your ships will go into hostile territory to make any refuel transaction (ecells, drones, etc) - I __highly__ recommend using it in conjunction with my sector lock script.
*** modified ***

[ external image ]

xierxior
Posts: 78
Joined: Thu, 16. Jan 03, 09:50
x3

Post by xierxior » Fri, 13. Jul 07, 15:37

my universe traders keep trying to wonder into locked pirate sectors even though I'm absolutely sure that the sector is locked.
I'm using this script with XTM.
XTM uses an expanded universe map, would this cause problems with your script?

everytime I've seen them wonder into a pirate sector it's because they're trying to buy/sell something at the pirate bases there.

the last time my universe trader got destroyed it was trying to sell laser towers to the pirate base (which is neutral).

Cacker
Posts: 10
Joined: Thu, 12. Oct 06, 19:41

Post by Cacker » Sun, 15. Jul 07, 23:10

Okay. i'm going to try your tip Halo. i've stopped all 23 UTs, unlocked all sectors, SETA'd, locked sectors, SETA'd. Restarted UTs. shall see what happens.

imperiosus
Posts: 13
Joined: Tue, 10. Jul 07, 05:04

Post by imperiosus » Thu, 19. Jul 07, 23:18

So I tried using your script cause the Xenon routinely annihilate half my UTs overnight in 2 or 3 sectors. Your script made all my UTs come to a standstill and they never traded anything after that... they just infinitely searched for product after product in their command menu never actually getting anything. I ran the game overnight with the script, and my UTs made me LOSE 4 million credits because they weren't doing anything but restocking on energy. This seems like a crippling glitch to me? :/

Return to “X³: Reunion - Scripts and Modding”