Loop Builders Rejoice! BuyResourceBest

The place to discuss scripting and game modifications for X²: The Threat.

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

Shara
Posts: 244
Joined: Tue, 24. Feb 04, 19:37
x2

Loop Builders Rejoice! BuyResourceBest

Post by Shara »

http://users.genesee-id.com/cholmes/x2/ ... ceBest.zip

This command is a NEW command for your TRADE COMMAND menu. It is part of the Trade Command Software MK2.

It works exactly like the BuyBestWare command with one exception: Your ships buy from only your stations.

It is what every loop builder should have.

If you are like me and have several loops built in one sector, then you want your ships to trade with all of your available stations, but not with the AI. Especially when the stupid AI has an SPP located in the middle of a hull-eating nebula like Spring of Belief. Well - now that problem is solved.

There are no funky numbers you have to input, no stations to specify - this command works exactly like BuyBestWare. Just tell your ship, with a HomeBase, to BuyResourceBest, and it will go fetch it, looking at ONLY your stations, according to the rules you specify in your stations Details. Just like BuyBestWare. No changes!

And it is a separate command added to the menu - so no overriding of existing commands takes place.

Enjoy! I know I am. Solved my problems...

EDIT This script is version 2.0 now, and the readme you get should reflect that. There were some instances when ships would do nothing because of the logic used to limit buying to AI ships. This has been resolved with the 2.0 version. The link is the same for downloading purposes.
Last edited by Shara on Sun, 2. May 04, 04:00, edited 1 time in total.
Xenon_Slayer
EGOSOFT
EGOSOFT
Posts: 13129
Joined: Sat, 9. Nov 02, 11:45
x4

Post by Xenon_Slayer »

Very very well done. Im going to test it in a minute but I believe every loop builder will thank you for this.
Come watch me on Twitch where I occasionally play several of the X games
Sorce
Posts: 54
Joined: Thu, 22. Apr 04, 00:11
x2

Post by Sorce »

Good work - but personally I think I'll just stick with GetWare, works very well for me in my loops.
Xenon_Slayer
EGOSOFT
EGOSOFT
Posts: 13129
Joined: Sat, 9. Nov 02, 11:45
x4

Post by Xenon_Slayer »

But dont you have to give the command again and again. Hopefully this one will wont do that.
Come watch me on Twitch where I occasionally play several of the X games
matthewfarmery
Posts: 4179
Joined: Fri, 9. Apr 04, 17:49
x3

Post by matthewfarmery »

Thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you……………………………
Chris (aka Shara)

I downloaded your mod and it gets my thumbs up. If it was possible to buy from your own factories, WHY HASN’T EGOSOST IMPLEMENTED THIS COMMAND ALREADY?????????

In X Tension this problem annoyed me greatly and even more so in X2, now finally after years of playing and waiting
YOU HAVE DONE THE POSSIBLE!!!

This mod also works in a loop comprising of many sectors, I have a crystal fab in Greater Profit, its TS’s where going sometime to Spaceweed Drift (and constantly been destroyed by a Khaak cluster) even though I HAD the needed resources (a full loop) in Seizewell, as a last resort I was using the command “Bye ware” but thanks to you no longer.

Thank you again

Matthew
Last edited by matthewfarmery on Sun, 2. May 04, 20:14, edited 1 time in total.
=
Xenon_Slayer
EGOSOFT
EGOSOFT
Posts: 13129
Joined: Sat, 9. Nov 02, 11:45
x4

Post by Xenon_Slayer »

matthewfarmery wrote: In X Tension this problem annoyed me greatly
Believe it or not, I didnt know that these commands existed in X-T. I always did everything by hand. Gave me a head ache.
Come watch me on Twitch where I occasionally play several of the X games
Shara
Posts: 244
Joined: Tue, 24. Feb 04, 19:37
x2

Post by Shara »

Xenon_Slayer wrote:But dont you have to give the command again and again. Hopefully this one will wont do that.
As stated, this command works exactly like the BestBuy command - meaning you do not have to re-issue it :)

The only difference between this command and and BestBuy, is that this command searches for only your stations. It rejects the others.

Hope everyone enjoys it. I woke up this morning after an entire night of SETA to find that none of my ships died trying to get to the AI factories located in the nebula in Spring of Belief... cause they were only going to MY factories :)

I love this script.
CHAZZ
Posts: 1836
Joined: Fri, 13. Feb 04, 18:48
x3tc

Post by CHAZZ »

Shara!
It is not only Spring Of Belief!. Recently, i started to build 'specialized' industy centers. Example: Elena's fortune is my food/crystals/ore/silicon center, and it has huge amounts of those goods in surplus. OK. In Olmankelstrats(ack!) Treaty i have my 'hidden' Pirate R&R center (pot, weed and booze industry), and President's end will become my main weapon/shielding production center. now, i had in mind that O.treaty and P.End industries should get the needed crystals/food/ore/silicon from Elena's Fortune only, so their jump number is set to 1. But! Instead of going there, the AI prefers to go to Bala-Gi Joy or Brennan Triumph! Nevermind if they eventually reach their destination, those goods are in most cases already taken and the price is higher, thus a huge amount of time is wasted-> yellow flashing fabs. Moreover, i have NO sector defence in those sectors, meaning it is annoying as hell to baby-sit all those transports. I will try your script, and, if what you said is true, my game experience will change dramatically.
Nice idea!
Chazz.

*EDIT*
Please, explain this: if there are NO player factories, and i issue the 'by for best price...' command, where will my traders look for the goods they are supposed to buy?? :? Is there a new, separate 'best buy' command or?

*EDIT2*
Sorry, my bad. I just read your reply on the topic in the X-universe forum.
Everything is clear now. :)
Shara
Posts: 244
Joined: Tue, 24. Feb 04, 19:37
x2

Post by Shara »

This is a separate command to the Trade menu. It does not overwrite any other commands :)

If you issue this command and do not have any of your own stations within the proper jump distance, and supplying the proper resource, then your ship will sit in dock and do nothing.

This works exactly like the BestBuy command.

There are a couple of instances using the default command that will cause your ships to sit in dock and do nothing:

(1) You have an SPP in some sector, and you set it to the default BestBuy command to buy crystals. You have jumps set to 1 for your SPP. If there are no stations (of any kind) within 1 jump selling crystals, your ship just sits in the dock and does nothing.

(2) You set your Crystal buying price to 1500, and there is a station within 1 jump that is selling for 1600, your ship will still sit in the dock, because the price isn't low enough.

Well - with my new command, these situations are still true, with one new exception: you must have one of YOUR factories within jump range, with price low enough, so the transport can buy from it.

It's really that simple - all this script does is make it so that your ships ONLY look at your stations for buying goods. They ignore the AI stations. It is a separate command, so if you need to use the default BestBuy, that one is still there.

This command is really ideal for loops, where you only want your stations to trade with each other, and not the AI.

:)
deadflip
Posts: 82
Joined: Mon, 26. Apr 04, 12:46
x2

Post by deadflip »

very very usefull mate, thnx a bunch. this really saved me :D :D,
one problem is they wont leave the station to buy even if my other stations are stocked (argnu beef is aproblem here..). bit off but owh well
deadflip
Posts: 82
Joined: Mon, 26. Apr 04, 12:46
x2

Post by deadflip »

found the problem, anothe rfactory is selling argnu for lowest, 1000/1000 stock (in the same sys), this seems to be a bug to me :(.

EDIT: fix, ill just blow it up :twisted:
matthewfarmery
Posts: 4179
Joined: Fri, 9. Apr 04, 17:49
x3

Post by matthewfarmery »

Bad news Shara, I am seeing bugs in your script, the full loop in Seizwell is still working however my other loop in Rhonkar’s Clouds is not,

Could it be that the script can only govern a finite number of ships?

I am using 1.3euro and disabled other mods but to no avail.

I have the following in Rhonkar’s Clouds
2x chelt aquarium
1x power plant
1x chip plant
1x ore mine
3x raster refinery
1x silicon mine
1x crystal fab (ediit) ! know I missed one

I am using your command to buy from my power plant and no other resource.

In Seizewell I have the following

1x bliss place
1x crystal fab
1x dream farm
2x flower farm
2x ore mine
1x power plant
1x shield prod 5MW
2x silicon mine
3x sun oil refinery

This sector is working and using script to buy power cells and sunrise flowers

In Greater Profit
1x crystal fab
1x spacefuel distillery
1x wheat farm

Using script for all three TS’s for crystal fab, these also don’t work all the time

There are other factories but not using your script.

I am using the script 20 times, I have noticed if I quit the game and reload sometimes there can be a mad buying spree for e-cells in Rhonkar’s Clouds, then grinds to a halt.

All factories have credits and resources and buying prices are fine and jump distance for GP crystal fab. If I select “buy ware for best price” then the TS’s that didn’t work, work.

I did read the readme and installed your package correctly.

That is as much as I can give you, contact me through the forum (your currant thread) if you want more info.
Last edited by matthewfarmery on Sun, 2. May 04, 20:18, edited 2 times in total.
=
Shara
Posts: 244
Joined: Tue, 24. Feb 04, 19:37
x2

Post by Shara »

matthewfarmery wrote:Bad news Shara, I am seeing bugs in your script, the full loop in Seizwell is still working however my other loop in Rhonkar’s Clouds is not,

Could it be that the script can only govern a finite number of ships?
Not likely, as it is exactly the same code as the BestBuy command. I only added two lines to it, and those lines just check to make sure the station the ship plans to buy from is a player station.

I experienced one moment last night testing this mod where I had 3 factories that all needed Silicon, and the ships assigned to those factories to buy silicon did nothing. I gave them a few minutes, and eventually they all made a mad dash for my Silicon mines.

I've got a pretty good idea of where this small bug lies and how to fix it. It's going to take some time to implement and test, but I'm confident we can get this ironed out.
XeHonk
Posts: 1087
Joined: Sun, 7. Mar 04, 23:03
x3tc

Post by XeHonk »

have the following in Rhonkar’s Clouds
2x chelt aquarium
1x power plant
1x chip plant
1x ore mine
3x raster refinery
1x silicon mine
well.. how do you suppose that is working? :)
you're missing crystals

SCNR
Shara
Posts: 244
Joined: Tue, 24. Feb 04, 19:37
x2

Post by Shara »

Script has been fixed. I located the error that was comming up occassionally that would cause ships to sit there and do nothing. It only happened under specific cercumstances, and I was able to replicate it for testing purposes.

I have written a new script to fix this behavior, tested it, and it appears to work. Download the new script, and the readme should say v2.0. Overwrite all your old files.

I have no idea if you have to reissue the GetResourceBest command to ships to see the changes - so try it out.

Edit I have confirmed that in some cases you will need to re-issue the new BuyResourceBest command in order to have the new version take effect.
matthewfarmery
Posts: 4179
Joined: Fri, 9. Apr 04, 17:49
x3

Post by matthewfarmery »

Thank you for a very quick response Shara, I only posted the bug report very late Saturday. First impressions, on V2 works like a dream, it also fixes another problem that I discovered after posting the report, my crystal fab transporter for nostrop oil, in Greater Profit was only buying from one refinery (when it worked) but thanks to you and version 2, it now buys from all three.

Anyone reading this and HASN’T already downloaded this fantastic mod, DO SO NOW…..

It gets my thumbs, arms and legs (and the rest of me) approval; finally happy days are here again

Thank you again

Matthew


PS as for reissuing the command, yes you have to (but a very minor niggle)
=
Shara
Posts: 244
Joined: Tue, 24. Feb 04, 19:37
x2

Post by Shara »

Thanks for the support Matt :)

I found out you have to reissue the command as well, but that is a small price to pay for upgrading to 2.0 because it actually works. I'm giddy :)
matthewfarmery
Posts: 4179
Joined: Fri, 9. Apr 04, 17:49
x3

Post by matthewfarmery »

I played the game again for a while, my e-cells are selling like hot cakes in both loops (I forgot to add 1x crystal fab in Rhonkar’s clouds) and my crystal fab in Greater profit is also working without problems, no more “your Teladi vulture has been destroyed by……. Etc)

If you make other mods I will be interested in testing them for you (some way we can keep in touch?)

As a short term goal I’m going to a put another SPP in Family Pride, now with you mod supplying it will not be a problem and probably another crystal fab as my expansion continues!

Again I can’t thank you enough for solving an infuriating problem that existed since X-BTF but especially in X-T (which I still have but now confined to a dark cupboard, so I doubt I will ever play them again!!!)

M
=
Shara
Posts: 244
Joined: Tue, 24. Feb 04, 19:37
x2

Post by Shara »

I have another script I just wrote this morning that could use some testing :)

I was looking for a way to skim all the profits from my stations in one shot. I kept hearing about this StationAccountant thing, but since I had so much fun writing BuyResourceBest, I decided to give it a go. I found someone's script that did something close to what I wanted mine to do, but it needed tweaking.

My latest script is called ProfitCollector. It's part of the Trade Command software. You input the minimum balance you want stations to have, and it skims any credits above that number from all your stations. If a station doesn't meet the minimum balance, it doesn't skim anything, and doesn't add anything to that station (I still like to micromanage a bit).

Then it writes to your logfile how many credits of profit it collected.


Feel free to email me at cholmes@genesee-id.com. I can send you a version of it in case you feel like testing it.
User avatar
GoateeCat
Posts: 1184
Joined: Mon, 10. Mar 03, 23:50
x2

Post by GoateeCat »

You get the seal of approval, top job.

Blogaramus!!!

Make sure you post that profit Collector in a separate thread for all to see. Even better still, make it available.

Love your ideas, keep it up. :)

Return to “X²: The Threat - Scripts and Modding”