[Pre-Release] Large Ship Ware Manager v0.8

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

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

Post Reply
Posts: 84
Joined: Wed, 3. Dec 03, 10:48

[Pre-Release] Large Ship Ware Manager v0.8

Post by fortysix2nz » Wed, 15. Feb 06, 10:14

Large Ship Ware Manager v0.8 by fortysix2nz

Script Objective:

I finally got a TL recently for the first time, and was annoyed to discover how long it took to get it kitted up. The purpose of this script is to streamline the whole process, introducing a automated trader type system.

The script works by activating a trade command on the TL in question (haven't tried it yet, probably works on M1, M2 aswell) which will control onboard ships and enable the ship to get the docked ships to acquire goods.

The second part of the script adds/removes wares that the first managers. Nice and simple.

How to use:
Activate the script under Trade Commands (using 'Start Auto Supply Ship')

Next go to Additional Ship Commands and select 'Add/Remove Ware from List'. Choose the ware followed by the quantity to buy. The script will then select a docked ship to go fetch the goods for you from the closest factory selling at best price, charging to the players account.

Well, thats how its all meant to work. This script is a pre-release for a reason. I was hoping some helpful people would set aside sometime to test what I already have. There are a lot of limitations at the moment. If people could look at the current limitations and suggest how they'd like it to be, that'd be nice. Even if you don't try the script out.

Current Limitations:

1) No max price on goods. How to select? I have some ideas, what's yours?
2) No jumpdrives, maximum 2 sectors jump distance (max 2 sectors away)
3) Ship selected to get wares random. Do we want only M5/M4, or any ship? I'm thinking of best ship for the task, ie just enough cargo storage and best speed
4) Issues if ship does not pick up enough cargo - script will not try to get more
5) No evasive action if under attack
6) I'm quite keen to introduce AStar path finding
7) Cannot give TL another command while it is running this script, though any ships currently fetching cargo should continue to do so

Probably more, will add if people think of them or I remember.

Only releasing SPK since there'll probably be a few updates before release.

Large Ship Ware Manager v0.8

Text File: 7700
Page Id: 7701

Ship Command 52
Trade Command 40

User avatar
Posts: 1379
Joined: Wed, 6. Oct 04, 10:26

Post by al_main » Wed, 15. Feb 06, 13:22

Firstly: I havent looked at your script as i'm not currently at home where my X3 lives :( but i will prob use it as its a pain kitting up large ships. Having said that, since i started using my bulk transporter upgrade its got alot easier!

Anyway, here's some feedback for you:

1)Either send an incoming to the player from ships computer asking for the maximum price (bit messy) or just have it as an argument thats requested after you select the ware? (better IMO)

4) i'd say that you should send the same ship out again for more. Or alternatively (better, but more scripting) as soon as the ship has bought the wares and they arent enough, dispatch a second ship as soon as the first starts its rerurn to the ship.

7)if the command was set as an additional ship command you'd be able to give your TL other orders and still have this working, though if the ships getting cargo already continue to do so anyway i dont see why its an issue tht the command on the TL needs to stay running?

Posts: 688
Joined: Sat, 31. Dec 05, 21:46

Post by PabloRSA » Wed, 15. Feb 06, 18:48

1, Have the script search for ware as the product in the max sector distance. If none found message player else collect lowest price ware.
May need to come up with some algerithom to calculate the profit margin with collecting the ware from 5 sectors away or getting it from a station 1 sector away from 1 cr higher.
or just have it as an argument thats requested after you select the ware? (better IMO)
That seems messy to me, a noob may enter 19 for ecells, which 1) wont find any ecells to buy as no stock, 2) No stock means ship will have to do many trips to get a decent amount of ware.

2, If you go wiht my idea number 1 you may need to factor in the cost of ecells in the jumps. I would say use a number argument to let the player select how many to search.

3, If the ware requirment is low and little space then you want an m5 to get it. You can write a calculation to determin which is the best ship to send.

Code: Select all

Selected ware amount * Selected ware size = Total Size
Check ship (While clause) if ship cargo >= Total size, put in array.
while array >= 0 check max speed, if speed is more that than previous ship add to variable.
I believe that should allow you to select the best cargo ship to send then cross referance with speed.

4, Check the cargo content when the ship comes back and if the bay is still not the required amount then go back to start label which starts this search again.

5, Abit hard to do. My guess would be to cancel anything its doing and let the AI take it from there. Unless your in the ship then you can.
If you have 1/2 the ware then it should have no problems starting where it left of. If it dose add a local variable to the ship to tell then script its resuming its collection.

6, Add this, If you go with my option number 2 then this would be benificial to the collecting ships.

7, i agree with al_main

Posts: 84
Joined: Wed, 3. Dec 03, 10:48

Post by fortysix2nz » Wed, 15. Feb 06, 22:07

Cheers guys. My current plan with some of the stuff is to weigh up the distance to product to the price of product. Shouldn't be too hard actually, just have to decide on how much time is worth. ie is 3 sectors and 14credit ecells better than 1 sector and 16 credit ecells.

I'll have to write my own script for getting the product, and then as soon as product is picked up, if it didn't get enough, it can add the remainder to the list for another ship to get.

Those two will be next on the agenda.

I kinda want to get the number of command slots used down to one, I don't reckon I need the Ship Command. It may be slightly messy, I'll have a look. I have a cunning plan. An issue is if your TL decides to jump away by 27 sectors and you haven't got all your m5's onboard sotra thing.

I also want the player to be able to set up default lists for ships, so if you buy three Mammoths you can have them all kit up the same.

Also, if you happened to look at the code for the scripts, sorry its such a mess but still debugging and writing so I couln't be bothered cleaning it up. I never like inefficient programming, but will worry about it for v1.0

Posts: 84
Joined: Wed, 3. Dec 03, 10:48

Post by fortysix2nz » Fri, 17. Feb 06, 12:50

Well, I've written a script to look for best option of station to buy at. It involves checking every sector within jumprange and any sectors 1 jumpgate further. This means a ship can travel a maximum of:

(Available Cargo Space - Space Required for Wares) / (Energy Cells Required Per Gate) + 1 = Maximum Number of Gates

The cost of ecells and a cost per sector having to cross manually is included in the calc (ie a time cost), so the further out the ship has to go, the less likely it will be to go there, unless there's a really good deal - can't be missed, final days, clearance. All that jazz.

This script will be called by a scrit I'll write which is essentially going to be the default go to station and get ware. Except if the number of wares picked up is less than the number required, it will straight away set the remainder to be collected by another ship.

I plan to include a cost associated with not getting a full complement of required goods into the script I've been writing. But ...

Whilst debugging what I had, I managed to break X3 quite bad. Can't start and games now. Even after reinstall. Had this problem before and know how to fix but will have to wait as I'm usy for a few days.

So much effort ... I'm fairly sure it would've been easier just to load up the TL myself. Ah well. Turns out I like scripting, and making unnecessarily complicated scripts to do reasonable simple tasks (this one I've been writing is currently 174 lines long)

User avatar
Aragon Speed
Posts: 781
Joined: Sat, 10. Dec 05, 14:30

Post by Aragon Speed » Wed, 4. Oct 06, 16:32

Here's an idea that you might want to expand your script towards. Massive universal trader. Ship jumps into sector, sends docked ships out to buy and sell products at all relevent stations, jumps to next sector that it can make lots of money in. With the extra protection that these ships have in terms of shielding and weapons, it would be much better than using TS's.

Posts: 153
Joined: Sat, 5. Nov 05, 20:19

Post by fransbos01 » Thu, 6. Dec 07, 14:37

Do I understand correctly that this script only supplies a large ship and cannot funtion as a kind of TL-wares selling option? If so, is there another script somewhere that could be use to sell things from a ships cargo bay? Or maybe it is (easy?) possible to add this option to your script?
This because I would like an automated possibility to sell wares from XTM-"production"-TL's like the Faunus etc.


Posts: 1227
Joined: Wed, 6. Nov 02, 21:31

Post by Marodeur » Thu, 31. Jul 08, 15:54

Will there ever be a final version? Looks like fortysix2nz won't come back. :?

Posts: 2
Joined: Sun, 29. Nov 09, 23:38

Post by Jedzia » Tue, 1. Dec 09, 11:06

Some help with TL handling.

You need Commodity Logistics Software MK2.

First assign a homebase to your deliverer. I explain this in fact to supply a faunus. ( That is a XTM Ship. a TL in fact, who needs our supply )
Then go, noob, enter 0 at the first "question". This is that the next waypoint is added to our list ->
Now mark your destination ( my Faunus at Home of Light ) ... i click Home of Light, my Faunus
then what to deliver: -> i click again Home of Light ... some of my factories that have ORE to deliver. You don't have one ? ... this tutorial is over for YOU !

Now. Here comes the question how to deliver a TL BIG Ship. Is my pilot still of the rank courier ? not, then you have to leave, too. Sorry, mate :=)

How .... how, ah i am talking shit. The next question we are asked is about the MONEY !
and Money talks.
If your ship has a homebase and the product is registered there .... you can give a price or -1 for the factory price like we often do ... but when not ... You can give ANY payment you want that is not zero or -1factory.

Lets say my Icarus isnt registered at egosoft. So i press 16 for the payment for the ore ,,, sure a mistake. but own factory ... own love
Good. next input is 100200. Hundred thousand is a flag that tells the commodity logistics software in that turn to not load more than 200 pieces of ore into the freighter ,,,,, +100000 ideas like lucike you must have *g*

so again. press add
I mean under your delivery ship. Ctrl-C, ship Slot Commodity logst.
Add/Change Interm. Stopps.
I pay zero (0) for the first input. That means ... to add a waypoint (->ReadMe%20(English).xml#1._3. Bonuspack ). Then i choose the ware i forgot it now what ware, cos starting X3 took over 700MB. Then !!!!!!!! .... sell your ore for 1 pence ... or something you like at your own TL. Don't put the -1 or 0 for factory price input. This is a TL Ship. Pay ... no, write the price. Then ....you want the TL to have 535 Ore ?
Press in: -100535 .... as our last input. The commodity logistics pilot now will never load more than 535 unit of ore into your holy TL.
or energy cells
or disruptor missiles for your unzohllysssss wrarfarzzzss

Factory Point, Hauler homebase is there:
Waypoint 1 - {0} {XXX Station} {Factory with Energy Cells} {Energy cells} {0} {100535}
Now every time we have 535 pieces of Energy Cells in our delivery Ship

Waypoint 2 - {0} {Faunus ... the destination} {Factory with Energy Cells} {Energy cells} {16} {-102000}

16 credits will be charged for the load ...aehm to the player account. 2000 energy cells are the limit that are loaded up into the destination.

This can supply a faunus. Or a Carrier with jump energy ... missiles and more. Your little bug jumps to the destination when it is necessary
Btw. RTFM. Courier pilots will supply TL ships. Train, train, mates

Mfg. Stefanie.

Post Reply

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