[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, 8. Aug 07, 11:30

imperiosus wrote: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? :/
Since you're the only person to ever report something like this I'm not sure what to say, I suggest you check your other scripts.
*** modified ***

[ external image ]

Okonomi
Posts: 22
Joined: Sat, 13. Oct 07, 11:52
x3tc

Post by Okonomi » Sat, 13. Oct 07, 11:57

Hi folks,

Ive been looking for ages for something that effectively locks down JUMPGATES.

My less then intelligent freighters keep on chugging into those pesky Xenon sectors on there way from one friendly sector to the next friendly sector 2 gates down. Each time they do that, get the full on welcome wagon from the Xenons, hordes of hungry purple beasts prowling around for some freighter cream soup. :evil:

Will this script get them to pick a more rassional route?

Akiel
Posts: 22
Joined: Mon, 25. Dec 06, 20:14
x3

Post by Akiel » Sat, 24. Nov 07, 21:50

Hi,

I'm definitly not able to get this script working :(
Instead of the commands you re presenting in the description I getting things like that :
readtext2010-416 for CT TRADE 16 and
readtext2010-417 for CT TRADE 17

Also getting this message after using cttrade 16 on a sector :
read text 7610-99980

I'm far from being a specialist so if you have advises there are welcome !

Thks

Akiel

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

Post by halo112358 » Fri, 30. Nov 07, 16:28

Okonomi wrote:Hi folks,

Ive been looking for ages for something that effectively locks down JUMPGATES.

My less then intelligent freighters keep on chugging into those pesky Xenon sectors on there way from one friendly sector to the next friendly sector 2 gates down. Each time they do that, get the full on welcome wagon from the Xenons, hordes of hungry purple beasts prowling around for some freighter cream soup. :evil:

Will this script get them to pick a more rassional route?
Look around for AalaarDB's A* (AStar) pathing system, if you install it so that it overwrites the stock move commands then you should be able to get the result you want. Be sure to read all of his documentation ;)
*** modified ***

[ external image ]

Tardis1
Posts: 1
Joined: Thu, 21. Oct 04, 11:57
x2

Post by Tardis1 » Fri, 9. May 08, 03:36

Greetings!

First of all I would like to thank Halo for a simple an elegant attempt to easily control the unruly behavior of the famed UT's.

From the previous posters and my personal experience with UT's still trading in locked sectors even after waiting hours before starting any UT's trading after locking, unlocking and again relocking sectors I decided to spend some time looking at the scripts and watching the scripts running on locked stations.

I found several things of interest, which looked into may help with the problems.

1. I found that when unlocking a sector the stations in the sector, even after several hours, never unlock. The halo.locksector.stationlockloop script keeps running on the station and calling plugin.autotrade.lockrequest. This task continues to run on the station regardless of stopping all UT's, unlocking a sector and waiting hours for the task to end on the station. Even uninstalling all the scripts and t-files will not stop this this infinite loop. I think this is due to the script halo.locksector.sectorunlock which calls the script lib.halo.taskTerminate failing to stop the task on the station because that script is missing in the zip and SPK package. Anyone have or know of this script?

2. Another thing I noticed while watching the station locking script running on the station is that it repeatedly calls plugin.autotrade.lockrequest. the problem with this is that the lock request does not stay constant but keeps "refreshing" thus dissapearing and reappearing as it is repeatedly called.....I think this creates "Holes" in the lock which when running 45 UT's like I am allow the UT to slip in a lock request during the refresh. Thus eventually, especially when running alot of UT's, the locking of the station will fail regardless of following the correct procedures (stop all UT's, unlock all sectors, wait, relock sectors, wait etc).

3. I too have noticed the endless "searching for wares to buy" as mentioned by above posters. I run over 45 UT's over 118 sectors and, on average, only 10-15% are ever in space actually performing there task. Before using sectorlock this was never the case.

4. A curious positive side effect of using Autotrader Sectorlock is that the UT's never seem to get stuck in that infamous "carry 1 ware from supplier to trading station infinite loop. Prior to installing Sectorlock I Had to continually stop UT's in this infamous loop.

In conclusion,
If the above problems could be addressed this script would be a wonderful and easy to use tool in managing the unruly UT's. As the script stands now it is missing the script lib.halo.taskTerminate which is making it impossible to unlock a sector, terminate the script running on a station and thus uninstallation of Autotrader Sector lock ineffective. Secondly, I do not know the effect's on the behavior of the UT's when lib.halo.taskTerminate is called and found missing, but in the text file log09880.txt all that is there is repeated locks on the stations, never an unlock message.

Once again thank you for your hard work Halo on this script and I hope these bugs can be ironed out.

Sincerely.
58 year old gamer :P

madprof
Posts: 15
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by madprof » Fri, 9. May 08, 17:38

I believe the lib.halo.taskTerminate scripg should consist of just one line

Code: Select all

return null

This removed the locking script from the station for me.

Think I've also figured out why the plugin.autotrader.lockrequest is called over and over again.

plugin.autotrade.lockmaster controls the locking, it will only keep a lock for fix length of time, each calling to lockrequest updates the start time of the lock.

So it goes like this
lockrequest is called at 0 seconds the lock will last until 1200 seconds.
lockrequest is called again at 10 seconds so now the lock will last until 1210 seconds.

This explains the multiple calls to lockrequest but not the traders still trading every so often with stations in locked sectors.

bluedoggy
Posts: 1
Joined: Wed, 23. Jul 08, 15:37

Post by bluedoggy » Wed, 23. Jul 08, 15:41

can someone post the script file to terminate the lock? Getting rid of the script doesn't seem to help at all....

Fledz
Posts: 1
Joined: Tue, 9. Jan 07, 04:25

Post by Fledz » Sat, 11. Oct 08, 07:10

I'm having trouble with Mi Tons Refuge too. The script seems to be working fine otherwise but they keep wandering into here. It's 100% locked.

I'm using Vanilla with only this script and UT Mk3 Improvements script. That's all.

User avatar
Seathal
Posts: 920
Joined: Thu, 5. Jun 08, 23:03
x4

Post by Seathal » Fri, 24. Oct 08, 19:37

I have a small problem with this. I'm running Spanish version 2.5 of the vanilla game with MK3 Trade Script and this one. I get the fantastic "ReadText XXXXX" thing instead of the commands I should be getting, same with the messages and reports I get from the script.

Can somebody tell me what's going on? The idea is excellent as my damend UT's keep running into Brennan's Triumph and Elena's Fortune and having to be saved everytime, still I lost two of my best Mercury Hauler UT's of 10 I had.

User avatar
Seathal
Posts: 920
Joined: Thu, 5. Jun 08, 23:03
x4

Post by Seathal » Fri, 24. Oct 08, 20:36

Found the proble, just had to switch the language code number in the xml files in "t" foler of the game to 34 (in my case) works with all scripts it seems.

Now the next big thing would be a sector restricter for Station buyers-sellers TS and TL. One of the ore Mercury seller I have keep flying itno Helen's Fortune and getting ambushed by pirates,

thunderai
Posts: 374
Joined: Fri, 17. Apr 09, 04:40
x3tc

Post by thunderai » Sun, 26. Apr 09, 21:59

Not to pull this from the depth but does this command have to be completed for every UT or will the sector locks be carried over between different UTs?

User avatar
dralk
Posts: 44
Joined: Thu, 1. Mar 07, 06:46
x4

Post by dralk » Mon, 27. Apr 09, 00:58

the sector lock is for all trade ships i believe
I cook with wine, sometimes I even add it to the food.
W. C. Fields.

thunderai
Posts: 374
Joined: Fri, 17. Apr 09, 04:40
x3tc

Post by thunderai » Mon, 27. Apr 09, 16:56

then it dosn't work...

i have preists pitty locked but they still go there even after a reload and waiting 10 minutes.


also, i have 20 sectors blocked and i swear all the uts do is sit in a station on standby.

also, how does a ut park at a pirate base if they are the enemy?

User avatar
dralk
Posts: 44
Joined: Thu, 1. Mar 07, 06:46
x4

Post by dralk » Mon, 27. Apr 09, 18:44

if i read it right it will only stop them from trading there no going through if that is the prob you are having if they are still trading in that sector you have a prob with the script then
I cook with wine, sometimes I even add it to the food.
W. C. Fields.

thunderai
Posts: 374
Joined: Fri, 17. Apr 09, 04:40
x3tc

Post by thunderai » Mon, 27. Apr 09, 19:18

dralk wrote:if i read it right it will only stop them from trading there no going through if that is the prob you are having if they are still trading in that sector you have a prob with the script then
I'm pretty sure I have a problem with the script, because my UTs will still go into locked sectors and dock at stations and sit there. But then I had problems with the LOCAL TRADER script as well, going well outside of the jump range I set them at.

I train my UTs in Empires Edge, send them somewhere random and turn the UT trade on. My UT's have everything on them I can get on them minus a gun and the fight upgrades.

Not sure why they hate me so.

User avatar
dralk
Posts: 44
Joined: Thu, 1. Mar 07, 06:46
x4

Post by dralk » Tue, 28. Apr 09, 20:43

in that case i have no clue sorry
I cook with wine, sometimes I even add it to the food.
W. C. Fields.

Khourieat
Posts: 47
Joined: Sun, 12. Jul 09, 23:54

Post by Khourieat » Mon, 20. Jul 09, 23:07

Yeah it seems to only mostly work, not sure why, but I regularly have my UTs travel into locked sectors to sell quantum tubes or silicon wafers or what have you, I'm not even sure the script is doing anything at this point.

I think it has gotten more frequent since I've updated to the newest bonus pack, I hope they are not conflicting.

I wish I could find the sat-nav limited trading script for download :(

Buck_Rogers
Posts: 1521
Joined: Mon, 20. Dec 04, 23:23
x3

Post by Buck_Rogers » Tue, 21. Jul 09, 13:59

halo112358 wrote: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.
Have any of you tried the above??
Buck Rogers

Vice Admiral of Shadows Haven Alliance (SHA) visit us at:
SHA Forum
Feel free to join my DID
Too often we lose sight of life's simple pleasures. Remember, when someone annoys you, it takes 42 muscles in your face to frown. But only 4 to extend your arm and slap the bugger!

Khourieat
Posts: 47
Joined: Sun, 12. Jul 09, 23:54

Post by Khourieat » Tue, 21. Jul 09, 19:32

I tried the restart last night, but with 15 locked sectors (and my CAGs discovering new ones all the time!) it's a pain to do this.

It took awhile, so I did not yet have a chance to see if it's working, my UTs spent the last 15 minutes of play I had on standby, so I dunno if it's working yet or not :P will post back in a few days after some proper running!

Edit: Welp, I restarted it last night as described, and I just had a UT Mercury waltz into a locked sector to buy Sunrise Flowers, directly next to a pleasure base even! Either the script is busted, or something in the bonus pack conflicts with it, sadly.

Buck_Rogers
Posts: 1521
Joined: Mon, 20. Dec 04, 23:23
x3

Post by Buck_Rogers » Wed, 22. Jul 09, 10:15

Hmmmm strange this. I have no such problems with my UT's straying into locked sectors, but I may know why. See below

There is one more thing you lot can try. Do any of you have this installed?
Buck Rogers

Vice Admiral of Shadows Haven Alliance (SHA) visit us at:
SHA Forum
Feel free to join my DID
Too often we lose sight of life's simple pleasures. Remember, when someone annoys you, it takes 42 muscles in your face to frown. But only 4 to extend your arm and slap the bugger!

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