[- UPDATE -] Improved Trade Software ST1 - Version 7.01 04/14/2011

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

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

User avatar
SpaceTycoon
Posts: 1190
Joined: Wed, 6. Nov 02, 20:31
x4

[- UPDATE -] Improved Trade Software ST1 - Version 7.01 04/14/2011

Post by SpaceTycoon » Fri, 7. May 04, 23:36

NEW VERSION 7.01 - 04/14/2011 Download here: Trade Software ST1 for X2-TheThread V7.01
Mandatory: If you used this scripts before, you must delete the file "init.navsoftwareST1.xml" in folder \scripts after update!

Ship commands for TS to automate buy and sell for up to 7 factories per ship.

This text got a complete edit at 10/15/2004!
So following answers and comments at page one of this topic are not appropriate anymore.

Do you still use one ore more TS for EACH of your factories? Stop this now. :mrgreen:
Buy for up to SEVEN factories or docks with ONE transport ship!
Sell for up to SEVEN factories or docks with ONE transport ship!
Take control over your TS like you've never thought before.
Make your TS as 'smart' as possible.

The Scripts work only with X2 Version 1.4/1.5 because the scripts use new scripteditor commands!
I'm German so please don't be angry if I mistyped something here...
These scripts are in use and tested by many hundered german players (i guess) of X2 since April 2004. This may be not the real count of german players because my german topic about this software got more than 32,000 hits this moment. With all of their functions included it is a very special software extension for TS you will not find similar in the world this moment. English language file (447777.xml) is enclosed. There is a short english documentation included. But THIS posting is much more the complete documentation. So please read this complete to learn more about the functionality.

The download above include TWO separated software extensions for ships. After activation of the script editor inside the game, installation of the scripts in \scripts directory and language files in \t directory of your X2 game you can buy two software extensions. At all Equipment Docks and all Pirate Stations available:
  • "Navigation Software ST1" for only 1.572 Cr.
    "Trade Software ST1" for 158.204 Cr.
First a short introduction of the Navigation Software:
"Navigation Software ST1" you can buy for every ship which is able to carry the jumpdrive (M4, M3, M6, TP, TS...).
Separate forum topic here: http://www.egosoft.com/x2/forum/viewtopic.php?t=67302
Give every ship the ability of automatic refueling with energy to jump into a sector and then fly to a given position or land at a given station/big ship. After you bought this software the navigation menue show two new commands "Jump and Dock" and "Jump to Position". The range your ship will be able to jump depends on the free space in cargo because neccessary energy cells are loaded into the cargo bay. You have to pay for the energy cells (only 16Cr.each). The cost is taken from your player account or from the homebase of the ship if "Trade Software ST1" is running on a TS. If you own a fleet and give the leader ship the command to jump, all escort ships will jump with their leader if they have jumpdrive and enough free space in cargo for energy cells.

The software here "Trade Software ST1" make use of the jump script, if you buy it too for the ship!
You need to buy both software extensions plus jumpdrive plus boost drive for your TS to make the complete buy an sell function work like expected. You can buy "Trade Software ST1" for TP or TS (I would prefer to use this extension with TS only). After you've bought this software you will find the following SIX commands in the trade menue of your TS:

Supply Sector
Choose a sector with one or more of your factories. It is not neccessary to position the TS inside this sector. Up to 7 factories are memorized by the ship. If you own more than 7 stations in one sector make usage of the second command (see below). Or send the TS to an appropriate position inside this sector because the scan of the stations starts up from the position of the TS. The ship buy for the choosen factories all of the needed resources. If you like only to delete a TS homebase use this command too. Set the missile fire probability of the TS to 0 and execute this command.

Supply Factories
Choose up to 7 of your factories [no docks] in different sectors (Or in the same sector. Or one/two/three... in the same sector or different sectors). The factories you choose are all supplied by the one transport ship with all neccessary resources. The ship is able to support less than SEVEN factories. To get this you need to choose factories twice or more. For eg. to give the ship FOUR factories to work for, choose one of the four factories four times. To let the ship work for one factory you need to choose this factory seven times. Sorry for that, but there is no other way to program this.

Supply with Resources
You can choose up to SEVEN stations (factories and/or docks) but you need to choose one resource of each station too. Your TS then will buy only this ware for the given factories. For example: With this function you can define a TS which buys only silicon for up to seven factories. Or you can define a TS which buy only the BoFu for a boron crystal fab, only the Cahoona for a argon crystal fab, crystals for a energy fab, and energy for another fab.
The start of the command is similar to the function above. If you want to choose only three of your stations with one of their resources you need to choose one of these three stations and the resource five times. Sorry for that, but there is no other way to program this.
This command supports trade docks and equipment docks too! So you're able to buy up to 7 wares for one dock with one TS.

Sell Fabware for best price
If you choose this command, you're able to select seven of your factories the TS should work for. If you want to get the TS work for only two factories you need to choose one of these two factories six times. The TS will start to sell the product of the factory(s) for the highest price it can find in the range of the jump setting of the actual factory. For example: I'm using this function to sell energy cells of 12 energy fabs with TWO boron dolphin. There is a special function included to avoid that more than one TS with selling function fly to the same factory at the same moment. This is explained further below.

Sell Dockware for best price
The function here to select stations and wares is the same than "Supply with Resources". Please refer to the function above. The difference is that the TS sell the choosen ware of the dock or docks. You can sell for one dock up to 7 of the wares in store or sell for seven docks one ware of these docks. Or anything in between (eg. seven wares from three docks).

Sell from Cargo for best price
Just choose the product in the cargo bay of your TS which you like to sell. The TS will sell all amount -may be at different factories- and after sold the complete amount the ship ends this command in the last buyer factory. I'm using this command after blowing up an asteroid to sell collected ore for the best price. But you can use this command too for selling ware you've bought manually at any factory before. You need to take care about the free amount in cargo for energy cells if the ship collects ore or if you buy manually ware at any factory. Because buyers are searched in the jump range the ship ist able to load energy for. For eg. you collected ore and now the free space in cargo is 67. The ship is searching for a buyer with the highest price in a scan range of 5 jumps and if found it loads 60 energy cells and jumps to the buyer. In this function the TS don't need a homebase. The money earned goes directly to the account of the player.

Functions to take influence how the TS works BUYING (special)
Like standard trade extensions of X2 the TS read the settings of the homebase to work in a given manner. These settings are jump range and price. You can take influence how the TS find a seller by adjusting these settings in the same way like you do with the standard X2 trade commands. But you need to know that the TS changes the homebase automatically if you choose more than one factory to buy for. So you should take care of the price and jump settings of ALL factories a TS buy for.

You can decide yourself when the ship shall start to buy or how much resources you like to store in your factories! Adjust the setting of missile fire probability in command menue of your transport ship (standard 5%) the way you like. You like the ship should start to buy if at one of the watched factories one of the primary resources goes lower than 70%? Then set the fire probability to 70%. You like to fill up six energy fabs only with a maximum amount of 83 crystals each? Choose 25% for the TS which buys crystal for these six energy fabs. The more factories (and resources) the TS is working for the higher percent you need to set up. Settings that make sense: Six energy fabs to buy for... 20% up to 30% (it is not neccessary to store more of the expensive crystals if the jump range at the six factories is set to 20 or 25 jumps). Six crystal fabs to buy for... not less than 60%. Six wheat factories... 50% up to 80%. Just test your own settings like you want. There is no need to stop the trade command if you like to change this setting. Only change the fire probability during the work of the TS and the change takes effect at the next scan of your factories several minutes later.

You can decide to buy FIRST at your own factories all over the galaxy for the price setting of these factories. All TS with a relation to Goner=Foe and a started buy-function of my "Trade Software" have knowledge about all player factories in the complete galaxy. If you change the relation to Goner of the transport ship to "Foe" the ship first seek all the player factories if one of these factories sell the needed resource and buy the ware there.
In this function-mode the ship doesn't care about the price setting at the actual homebase. It seeks for a player factory with the higest amount of the resource (if you own more than one of the same factory type) and buy there for the price you've set up there. But the jump setting at the actual homebase is important! The TS will never leave the jump range you've set up at the homebase factory. If none player fab is found in the given jump range the normal buy function (buy at foreign factories or trade docks) automatically take place and the TS will buy there. You can change this setting of relation to race "Goner" to Friend or Foe every time you like. There is no need to stop the trade command, change the setting and start the command new. Change directly the relation and up from the next search for sellers the TS will scan player factories first. Or switch off the function to buy first at own factories for their price by setting the Goner relation of the ship back to "Friend".
Closed factory circles: To support closed circles you can change the behavior of the ship to buy only at your own stations if you equip the TS with Ecliptic projector. If Goner=Foe and the TS holds the Ecliptic projector it buys only at your own stations and never more at alien stations. If the Goner setting of the TS is set to 'friend' the Ecliptic projector has no function.
Edit: This function changed for X3-Reunion and X3-TC. Now Formation setting of the ship is used. Refer to the forum topics of the X3 versions of my scripts.

Other than the standard X2 trade commands my script read the settings of the homebase (including how much resource amount is there on stock) and the rocket launch setting again when the TS arrive at the seller. So it can happen that the TS buy more or less as the amount it would have bought as it starts. Or nothing. This depends on several things. May be you've lowered the buy price at the homebase during the flight time of the TS to the seller. Then the TS will not buy if seller's price is higher than your setting. Or you've lowered the fire probability setting of the TS during the flight. So in advantage to the standard trade scripts of X2 you can change the behavior of your TS immediately and don't need to wait for the next scan or to stop and restart the buy command.

Functions to take influence how the TS works SELLING (special)
This information is for commands "Sell Fabware/Dockware for best price" only!
Like standard trade extensions of X2 the TS read the settings of the homebase to work in a given manner. These settings are jump range and your sell price. You can take influence how the TS find a buyer by adjusting these settings in the same way like you do with the standard X2 trade commands. But you need to know that the TS changes the homebase automatically if you choose more than one factory to sell for. So you should take care of the price and jump settings of ALL factories a TS sells for.

You can decide yourself when the ship shall start to sell a product of your factories! Adjust the setting of missile fire probability in command menue of your TS (standard 5%) the way you like. For example: A boron dolphin with 3000 cargo space sells energy for 6 energy fabs. I would prefer to set the fire probability of the TS to 55% (= 2.750 cells). Is the amount of energy in all 6 fabs less than 2.750 cells the TS is waiting until one factory has 2.750 or more cells. So the cargo space of the TS is really used and your profit increases. Because if a buyer at 23 Cr. is found it's better to sell 2.750 or more cells than 1000 or less.

And more other Functions! (Also special) :)
  • * The pilot name of your TS show to you what the TS is doing.
    * The stations own ships menueshow to you what the TS is doing.
    ...It shows the amount the ship trades in for buying or selling.
    * The owner menue (key 'R') show to you what the TS is doing.
    * The fire missile probability setting of "0":
    ...If the TS is on flight from seller back to homebase and you set this, the TS
    ...deliver the ressource to the homebase, reset the pilot name to the players name
    ...and the script terminates.
    ...If the TS is on flight from homebase to buyer and you set this, the TS deliver the
    ...product to the buyer and return to homebase. Then reset the pilot name to the players name,
    ...reset it's homebase to nothing and the script terminates.
    ...If you like to remove the ship's homebase:
    ...Only set the fire missile probability of this TS to ZERO and then choose "Supply Sector".
    * The ships avoid to make unneccessary flights. If a TS arrive at a seller and the
    ...seller raised it's price or hasn't enough ware anymore the TS don't fly back to homebase.
    ...It stays at the seller, search for a new seller and if a new seller was found fly to this one.
    ...The same by selling ware. If not all of the product in cargo bay could be sold at
    ...the buyer, or buyers price lowered during the flight, the TS seek for another
    ...buyer and sell the ware at this one. This goes on and on until all ware in cargo is sold.
    * You can define more than one TS for a given count of factories to buy for or sell for.
    ...If more than one TS sell ware for the same factories, all of these TS try to avoid selling
    ...for the same factory. Every Seller-TS proof first if another TS is at selling
    ...for this factory in the moment. If this is the case and the TS got more than one
    ...fab to sell for, it choose another factory to work for.
    ...If more than one TS are buying for the same factories, they all buy. With this
    ...case you can fill up a factory with resources very fast if you let work two or more TS
    ...for the same factory with fire probability setting about 80% or more.
    ...Also you can define a 'Backup-TS' for factories. For example: A Boron Dolphin is
    ...buying for 3 crystal factories with a fire probability setting of 60%. May be sometimes
    ...several resources (Silicon/BoFu/Cahoona) lower down to 40% because the TS is not that fast.
    ...So you can setup a second TS (eg. Argon Mercury) with a fire probability of 45% which will
    ...start buying too if one of the resources at one of the factories is lower than 45%.
    * The TS avoid visiting the same buyer or visiting the same seller if another TS is on the way
    ...During the process of searching a buyer or seller the TS proof if there is another TS
    ...owned by the player with this station as target AND the same ware as target.
    ...If this is the case, the TS choose another buyer or another seller.
    ...There is one exception of this behavior: If you are the owner of seller or buyer factory.
    ...Because the price don't change at players factories if a buyer or seller was there
    ...it doesn't matter (most it's better) to get parallel visits of your own ships.
    ...And sometimes it happens that two TS find the same buyer/seller in the same second.
    ...In this case both TS fly to the factory but only one (the first arrives) can buy/sell.
    ...The other TS then search automatically for another buyer or seller.
    * The TS don't visit sectors which are unknown for the player.
    ...They don't visit stations which are foe to the player. Don't confuse this with your own
    ...settings of friend or foe in the command menue of your ships or stations.
    * The TS recognize if target stations (including their homebase) got destroyed
    ...during the flight. If a foreign station was destroyed the TS scan for a new target.
    ...If the homebase is destroyed the TS stops it's command and send a message to the player log.
    * The TS send audio messages and messages to your log to inform you.
Tips!
  • How you should equip your TS.
    I prefer to setup TS with maximum cargo space, maximum speed and max. agility.
    If you need to save money setup only about 70% of cargo space and agility. Then buy
    - Shield 3x 5MW OR 1x 25 MW (that's enough)
    - Duplex or Triplex Scanner
    - Jumpdrive
    - Navigation Software ST1
    - Supply Software ST1
    This TS will cost you about 1.000.000 Credits. But think about that this TS is able to buy for SEVEN factories all of their resources. If you own 7 crystal fabs and work with standard X2 trade commands you need 21 "normal" TS to buy all of the resources. They cost you about 7.000.000 Credits (even more, depends on equipment) and they are not so 'smart' and they cannot use jumpdrive with automatic fueling.

    If you like to collect ore and sell it by use of the fifth command "Sell from cargo.." buy additional
    - Ore collector
    - Special Software MK1
    - Navigation Software MK1

    If you like to enhance the speed of your TS equip them with
    - Boost-Extension
    Ships with installed boost-extension perform the In-Sector jump with my "Navigation Software ST1" (first seen in Version 6.xx).

    If you like to buy only at your own factories equip TS with
    - Ecliptic projector
    Ships with Ecliptic projector installed and Goner=Foe Setting will never buy at alien stations.
    This setting is exchanged with 'Formation setting' in X3 version of my scripts! Refer to viewtopic.php?t=300339

    If you don't like to get arrival messages of remote controlled ships into your log. Equip your ships with
    - SETA
    Ships with SETA installed give no message at arrival. This is a function of "Navigation Software ST1" only. No need for the trade software.

    Read more about "Navigation Software ST1" here:
    http://www.egosoft.com/x2/forum/viewtopic.php?t=67302

    I would prefer to use the 'jump inside the sector' function (Boost extension installed) not for all ships (don't equip all TS with Boost drive). One reason is the money consumption. Another reason is that, if the ships are not so fast, the price might decrease until the ship arrives at the seller. In my opinion, best practice is to prefer the equipment of Seller-TS with boost drive to perform the internal sector jump. And, -may be- the slow Dolphin-/Vulture-TS which shall buy for 4 to 7 factories all of their resources .

    How to use the different types of TS
    To buy crystal for up to 7 energy fabs use Argon Mercury or Paranid Demeter
    with less cargo space (max. 1000) and a fire probability setting of about 25%.
    I'm using 2 Paranid TS for 10 energy fabs (five factories each).
    ----
    To sell energy use Boron Dolphin with fire probability of 55% or 60% and 3000 cargo space.
    ----
    To sell silicon use Paranid Demeter or Argon Mercury with cargo space of 1100
    ----
    To buy resources for level 3 factories (all fabs with 3 resources) use Teladi Vulture
    with fire probability not less than 70% and 2500 cargo space.
    ----
    For level 3 factories you can alternate work in this way (example):
    Setup 1 Argon Mercury with "Supply with Resources" to buy only silicon. Set it's fire probability to 70%.
    Setup 1 Boron Dolphin with fire probability 50% for the same factories with command "Supply Factories".
    The Dolphin will only buy Energy and Eat in reason of the lower setting of missile fire probability.
    ----
    It's funny too to buy for seven level-3 factories with 3 different TS. Each TS buy another ware for the seven factories with command "Supply with resources". For example one Boron Dolphin for energy, one Argon Mercury for ore/silicon and one Teladi Vulture or Boron Dolphin for Food.
    ----
    ...to be continued (may be :wink: )
Now I hope this is enough information so have fun and good profit with this extension :)
Last edited by SpaceTycoon on Sun, 14. Oct 18, 10:42, edited 119 times in total.

User avatar
JustHere4Coffee
Posts: 1075
Joined: Wed, 6. Nov 02, 20:31
x2

Post by JustHere4Coffee » Fri, 7. May 04, 23:44

sounds very nice, although couldn't the script be rewritten to use the inbuilt jumpdrive options now? after all, they're a couple of months old...

User avatar
SpaceTycoon
Posts: 1190
Joined: Wed, 6. Nov 02, 20:31
x4

Post by SpaceTycoon » Fri, 7. May 04, 23:49

JustHere4Coffee wrote:sounds very nice, although couldn't the script be rewritten to use the inbuilt jumpdrive options now? after all, they're a couple of months old...
Actually there is no function in script editor to bind scripts at standard keystrokes like SHIFT-J. So you can only use the script command [THIS] - use jumpdrive ... to activate jumping.
The inbuild scripts for jumping are not usable because there is no calculation of the best jumpgate nearest to the target.

User avatar
JustHere4Coffee
Posts: 1075
Joined: Wed, 6. Nov 02, 20:31
x2

Post by JustHere4Coffee » Sat, 8. May 04, 00:04

I understand (and did not mean to suggest) that your command can't be added to the keystroke, I only meant you could use the built-in jumpdrive command you just mentioned

as that drops you in the middle of the system anyway, would it matter that much that you can't pick which gate's closest?

User avatar
SpaceTycoon
Posts: 1190
Joined: Wed, 6. Nov 02, 20:31
x4

Post by SpaceTycoon » Sat, 8. May 04, 00:25

JustHere4Coffee wrote:I understand (and did not mean to suggest) that your command can't be added to the keystroke, I only meant you could use the built-in jumpdrive command you just mentioned
as that drops you in the middle of the system anyway, would it matter that much that you can't pick which gate's closest?
You're right. I compared the buildin scripts to mine. Usage of the buildin jump script for SupplySoftware is functionable but the ship appears in the center of the sector. But what happens, if a player positioned a station in the center of a sector? Or if a big KI ship idles exactly in the center of a sector when a player ship appears there?
I havn't testet this but I suggest the player ship would be destroyed.

And... If you used the 2E Version of the NavSoftST1 you will never miss it :mrgreen:

User avatar
Kailric
Posts: 985
Joined: Sun, 7. Dec 03, 05:15
x3

Post by Kailric » Sat, 8. May 04, 00:38

I think there is some kind of fail safe in case a ship spawns ontop of another ship while playing in the normal universe. As with my combat script I used a script to spawn a ship right ontop of myship but it always spawned it a few meters away. Now in a new galaxy this doesn't work, the ship will spawn on top of your ship and you both get destroyed :(
"Try not. Do or do not, there is no try."-Yoda

"[Its] time for the human race to enter the solar system"-Dan Quayle

User avatar
SpaceTycoon
Posts: 1190
Joined: Wed, 6. Nov 02, 20:31
x4

Post by SpaceTycoon » Sat, 8. May 04, 00:50

Kailric wrote:I think there is some kind of fail safe in case a ship spawns ontop of another ship while playing in the normal universe. As with my combat script I used a script to spawn a ship right ontop of myship but it always spawned it a few meters away. Now in a new galaxy this doesn't work, the ship will spawn on top of your ship and you both get destroyed :(
Your post reminds me to something I forgot :)
I tried to develop my scripts with the thought in mind that they can used in a modified X2 too.

User avatar
SpaceTycoon
Posts: 1190
Joined: Wed, 6. Nov 02, 20:31
x4

Post by SpaceTycoon » Wed, 26. May 04, 00:26

A new function included in this software. Buy at own factories (without care of the price and distance but with care of the amount in store if you own more than one factory of the same type). You can switch the function on/off by setting the relation to Goner to enemy (on) or friend (off) in the ship (transport) with this software installed.

Hiroshima
Posts: 177
Joined: Sat, 6. Mar 04, 02:39

Re: Supply Software ST1 - NEW * Version 4 *

Post by Hiroshima » Wed, 26. May 04, 10:35

............Supply up to FIVE factories with ONE transport ship - this use jumpdrive to buy resources!.........
Your script is good however there is 2 problems.....

1. It messages the player...never a good sign a script should just do it's job and never tell anything unless it's very important
2. The script shuts off when the stations are full...a trade script should never turn off the ship should just sit there waiting for the station to make money then buying more goods not stop working so the player needs to tell the ship to do it's job every time it finishes filling the stations

8)

User avatar
JustHere4Coffee
Posts: 1075
Joined: Wed, 6. Nov 02, 20:31
x2

Post by JustHere4Coffee » Wed, 26. May 04, 10:37

1: if you don't like that feature, turn it off. depending on what it tels the player, it can be a good thing, a bad thing, or an invaluable thing

2: are you sure it's not just idling waiting for your stations to need resources again?

Hiroshima
Posts: 177
Joined: Sat, 6. Mar 04, 02:39

Post by Hiroshima » Wed, 26. May 04, 10:41

JustHere4Coffee wrote:1: if you don't like that feature, turn it off. depending on what it tels the player, it can be a good thing, a bad thing, or an invaluable thing
You have a point but i just don't like to get a message every 5 minutes saying my station is full when i know it should be because i used a script to do just that...i would expect a message if the script had somehow made me lose a lot of cash...etc
JustHere4Coffee wrote:2: are you sure it's not just idling waiting for your stations to need resources again?
No it's not on i checked the ships info in the script editor it said there is no script running on this ship

User avatar
JustHere4Coffee
Posts: 1075
Joined: Wed, 6. Nov 02, 20:31
x2

Post by JustHere4Coffee » Wed, 26. May 04, 11:28

ah well, to each their own

I'm finally going to install this tonight, so I can sell off the pirate fleet I've been using in order to subsidise my first full loop

adam00
Posts: 333
Joined: Sun, 9. May 04, 12:03
x4

Post by adam00 » Wed, 26. May 04, 12:05

Well, I have wrote very similar script to supplay chain of factorys. It transport wares in this chain and can buy resources from outside, useing jumpdrive too. There is now limits to number of factorys, you can freely configure this complex. My script have one more thing, can be configured to supplay complex of same factorys, products of this complex will be then cumulated in "main" factory. I think it is more optimal to let other ships to buy from one factory, where is less "disappointments" :D or if you activly sell ware, one seller could be enough for many factorys, especially if it use some jumping-sell command. Well, I wrote such script too :D

I think I will be publishing my scripts in few days.

User avatar
SpaceTycoon
Posts: 1190
Joined: Wed, 6. Nov 02, 20:31
x4

Re: Supply Software ST1 - NEW * Version 4 *

Post by SpaceTycoon » Wed, 26. May 04, 13:46

Hiroshima wrote:
............Supply up to FIVE factories with ONE transport ship - this use jumpdrive to buy resources!.........
Your script is good however there is 2 problems.....
1. It messages the player...never a good sign a script should just do it's job and never tell anything unless it's very important
There are only two messages and in my opinion these are a must.
First message tells the player which factories are supplied by the transport ship. This happens only once at the beginning of the trade loop. I think if the player choose "Supply Sector" and own seven factories in this sector he should know which five factories are supported by this ship. This first message you can see also as a confirmation that the command is accepted and the function is working up from now.
Second message tells the player if there is not enough money in a factory to buy the neccessary resource and the amount of money needed. The script/function stops in this case. Because in my opinion it make no sense to let the ship fly to stations to buy but cannot buy in reason of less money. And no one knows why there is not enough money. May be the player spent his complete money to buy a TL or things like this. So in reason that every running script make X2 more slow and cost CPU-performance (especially loops) it's better to let the script stop here. To give the decision to the player what he like (or is able) to do now. And to inform him why the function cannot work.
Other messages in 447777.xml are for the Navigation Software script. These msgs are not used by Supply Software. They are only used if the player choose a jump-command in Navmenue to order a ship to a station or destination. To tell the player that ships are arrived at destination. I talked with a lot of players in the past an many of them forgot ships they ordered to a destination. Or to inform player that the jumpdrive cannot work in reason of less energy cells or no jumpdrive installed.
Hiroshima wrote:2. The script shuts off when the stations are full...a trade script should never turn off the ship should just sit there waiting for the station to make money then buying more goods not stop working so the player needs to tell the ship to do it's job every time it finishes filling the stations
I had this problem in early versions of the script. Take care to use really the version 3 or version 4 on your ships. It is not enough to overwrite a script in \scripts folder to make new versions work. Scripts actually running on ships are saved within the savegame. And if you load a savegame these running scripts run further. They are not exchanged at runtime with the newer one's in the script folder. You have to stop the command/script running on a ship and give the command again to load the new versions of a script copied into the \scripts folder. This is not an issue of my script it's an issue with all scripts.
This code here

Code: Select all

062   skip if $AmountNeed > 0 AND $PercentFab <= ( 100 - $StartToBuy )
063    goto label HOMEBASE
prevent she script from stopping if the station is full of resources. In this case the ship fly to the homebase (if it is not already landed there) and the trade loop is running... In the overview of your items (Key "r") you should see that the ship has command "Supply Sector..." OR "Supply Stations...".
In reason of wait-time with code

Code: Select all

203 @ = wait randomly from 20000 to 30000 ms
may be it looks like nothing will happen. But scripts need wait times to give other scripts CPU-time. The biggest waittime is if the transport cannot find a resource to buy:

Code: Select all

183 @  = wait randomly from 120000 to 360000 ms
In this case it waits for two minutes up to 6 minutes. May be the player need to adjust the price and/or jumps at the actual homebase if the transport do nothing.

If a script break with an error you get a special error message from X2.exe into your logbook (i got them several times in the past by developing this script :wink: ). To proof if a script is running you can select ship menue and press PgDwn Key. Running scripts are shown beneath the information about the shields, weapons, homebase, etc.

The german thread about this script is one of the higher visited thread. It got 2395 hits this moment. So I think a lot of players are using this script :) and since version 3 were no errors reportet. :)

User avatar
SpaceTycoon
Posts: 1190
Joined: Wed, 6. Nov 02, 20:31
x4

Post by SpaceTycoon » Sat, 23. Oct 04, 13:19

So the hard work of writing a brandnew english documentation at first posting of this topic is done :doh:
It was neccessary because Version 5 (5.00) was released in September 2004 with three brandnew tricky functions and a complete redesign of several functions. I spent several hours of testing. So I can say version 5.05 works exact like expected. Tip: You should take care about enough money in factories to buy resources and to pay for jump-energy. And you should take care about the function "Sell ware..." with the switch of the relation to race "Unknown".
If you have any problems or questions, feel free to ask here. I'll try to explain best I can.
Enjoy :)

IMPORTANT:
To perform securely an UPGRADE from a PREVIOUS version.
You should first delete all older files of the software in the \scripts folder and \t folder.
The filenames of Versions before 5.xx to delete:
  • plugin.fabsupplysoftST1.helper.xml
    plugin.fabsupplysoftST1.main.xml
    plugin.fabsupplysoftST1.sect.pl.xml
    plugin.fabsupplysoftST1.stat.pl.xml
    plugin.navsoftwareST1.jump.xml
    plugin.navsoftwareST1.jumpDck.pl.xml
    plugin.navsoftwareST1.jumpPos.pl.xml
    remove.plugin.fabsupplysoftST1.xml
    remove.plugin.navsoftwareST1.xml
    setup.plugin.fabsupplysoftST1.xml
    setup.plugin.navsoftwareST1.xml
The filenames of Versions up from 5.xx to delete:
  • init.plugin.fabsupplysoftST1.xml
    init.plugin.navsoftwareST1.xml
    plugin.fabsupplysoftST1.helper.xml
    plugin.fabsupplysoftST1.main1.xml
    plugin.fabsupplysoftST1.main2.xml
    plugin.fabsupplysoftST1.sect.pl.xml
    plugin.fabsupplysoftST1.sellc.pl.xml
    plugin.fabsupplysoftST1.sellw.pl.xml
    plugin.fabsupplysoftST1.stat.pl.xml
    plugin.fabsupplysoftST1.ware.pl.xml
    plugin.navsoftwareST1.jump.xml
    plugin.navsoftwareST1.jumpDck.pl.xml
    plugin.navsoftwareST1.jumpPos.pl.xml
    remove.plugin.fabsupplysoftST1.xml
    remove.plugin.navsoftwareST1.xml
All files of last Versions are dated 11/30/2004 5:02 for ..navsoftwareST1...
and dated 12/05/2004 5:07 for ...fabsupplysoftST1... and 4x7777.xml and README.
After deletion of the files above copy all scripts
(init.xx.xml, plugin.xx.xml, remove.xx.xml) inside the zip-file to folder \scripts.
Copy all language-files 4x7777.xml and README-Files inside the zip-file to folder \t.
Last edited by SpaceTycoon on Tue, 21. Dec 04, 00:28, edited 2 times in total.

User avatar
SpaceTycoon
Posts: 1190
Joined: Wed, 6. Nov 02, 20:31
x4

Post by SpaceTycoon » Tue, 21. Dec 04, 11:43

Changes in Version 6.00 of 12/20/2004:

1.
Two minor bugs in scripts fixed.
One bug: If you own a trade station and ships with a setting of Goner=friend found your own trade station as seller. And you set the prices there higher than the average price. Then the ships fly to your trade station but didn't buy. Fixed.
Another bug: By selling some wares with higher volumes the ship couldn't load enough energy for the jump. So it fly in standard way to the target. Fixed.

2.
Major change in programming of the two main-scripts for buy and sell functions. Less arrays and smaller, faster loops. I was able to exchange the usage of several arrays or loops by usage of global and local variables. So I think the consumption of CPU-performance and memory should be less and/or the script runs faster.
Player's factories are now stored in a global array-variable. And there is no play around anymore with the relation setting to race "Unknown" in the command menue of your factories. This function is gone. Ships check if another TS is at work for the same factory by checking a local variable at this factory.

To perform the upgrade:
I would prefer to stop ALL TS (set the fire missile probability to ZERO and wait until all ships are landed with command 'none'). Then save the game. Exchange all scripts (folder /scripts) and the language files in folder /t with the new ones. And command your TS again. I suggest that there will be no further update in the next two or three months.
Last edited by SpaceTycoon on Sun, 17. Apr 05, 15:48, edited 1 time in total.

xalien
Posts: 2252
Joined: Fri, 12. Mar 04, 01:03
x4

Post by xalien » Wed, 22. Dec 04, 17:24

It would be the right script for loops, but it has some drawbacks (if I haven't missed anything). It should have the ability to force the ship to operate strictly within specified array of 7 (or less) factories. As it is, even if you set goners=foe and assign it to serve some stations in the loop, it won't prevent the ship from robbing other loops of their resources - no good if you have many closed loops in the same sector. Lowering missile probability may help with this, but IMHO it's still not very convenient way to run loops, and if you have to manage lots of loops convenience becomes a priority.

User avatar
SpaceTycoon
Posts: 1190
Joined: Wed, 6. Nov 02, 20:31
x4

Post by SpaceTycoon » Wed, 22. Dec 04, 20:49

x2alien wrote:It would be the right script for loops, but it has some drawbacks (if I haven't missed anything). It should have the ability to force the ship to operate strictly within specified array of 7 (or less) factories.
That's right. The script isn't made for closed loops especially. A ship operates strictly with the specified 7 or less factories. But it operates for these factories strictly only as buyer or only as seller. The stations at which the TS buy or sell the ware are all other stations in the galaxy. In the given range of jumps and price settings at the given up to 7 factories. Without care about the owner race of the factories (if not foe).
x2alien wrote: As it is, even if you set goners=foe and assign it to serve some stations in the loop, it won't prevent the ship from robbing other loops of their resources - no good if you have many closed loops in the same sector.
That's right again. Goners=Foe only helps as long as your own factories in the given jump range hold enough ware to buy there. If there's not enough ware a ship automatically buy at other factories or at last at trade docks.
x2alien wrote:Lowering missile probability may help with this, but IMHO it's still not very convenient way to run loops, and if you have to manage lots of loops convenience becomes a priority.
I'm sorry for that. But I didn't develop and design the script for closed loops. Highest priority for the script is to prevent that player's factories run out of resources. To ensure that the production works. So - if a ship working as buyer in the given jump range
  • - cannot find player factories with enough ware (if Goners=Foe),
    - and cannot find other factories with a price below/equal it's homebase price,
    - last it searches and buys at trade docks for the average price
    (or at a player owned trade dock for the price there).
For my own I prefer for supporting my energy plants with crystal to let aliens trade docks buy my crystals for 1.904 Credits and buy them back at trade docks for 1.684 Credits. The same with energy. I prefer to sell with my seller TSs energy for 21 up to 23 Cr. each and let my buyer TSs buy energy at aliens energy plants for not more than 10 Cr.

If you're want to support closed loops may be this helps:
A seller TS always will sell for the highest price it can find in the given jump range. So if you set the price of your factory resources to max. and the price of the product(s) at sellers factory(s) to maximum too. A seller TS of your own may sell the product(s) only to your factories. You can play a little bit with the jump range setting of the sellers factory to earn better results.

Buyer TSs behavior is much more complicated. If Goner=Foe a buyer choose the player factory with the highest amount of ware in store inside the jump range. No care about the price. But didn't buy there if the amount there is less than 50% of the amount it needs to buy. Here you can play with the missile launch setting to change the results. But if there is not enough or no ware in store at your factories the buyer switches to 'normal' mode (like Goner = Friend). Then a buyer seek a alien factory inside the jump range to buy there. And if none is found it search the trade docks inside the jump range and buy there for the average price. So it's very difficult to support closed loops with the three buyer functions "Supply...".

May be you're able to use only the sell function like described above.
And then don't need any buyer TS to supply your factories with resources.
Last edited by SpaceTycoon on Sun, 3. Apr 05, 17:26, edited 1 time in total.

User avatar
TSM
Not a Moderator
Posts: 2947
Joined: Thu, 1. Jul 04, 12:31
x4

Post by TSM » Mon, 27. Dec 04, 16:26

This add-on clashes with Burianeks 2nd Prouction line as since i installed ST1 and use Burianeks add-on i get the read text blah blah, i not sure what to do apart from go back to a backup save its rather annoying as your scirpt looked good but is also rather annoying when scripters release without checking for clashes :x
FAQ's Egosoft Interactive FAQ
Egosoft Wiki

User avatar
SpaceTycoon
Posts: 1190
Joined: Wed, 6. Nov 02, 20:31
x4

Post by SpaceTycoon » Mon, 27. Dec 04, 18:07

TycoonSpaceMan wrote:This add-on clashes with Burianeks 2nd Prouction line as since i installed ST1 and use Burianeks add-on i get the read text blah blah,
I'm wondering. Because Burianek use totally different command-slot, ware-slot and language-ID/page-ID.
Take a proof if all neccessary language files reside in your directory "/t". For my scripts you need the 447777.xml there in. With 3 KB (2.974 Bytes) in length and dated 11/30/2004 5:07 OR 12/20/2004 6:00.
It would be fine to get an exact error description. At which menue appears which ReadText-Number.
TycoonSpaceMan wrote:i not sure what to do apart from go back to a backup save its rather annoying as your scirpt looked good but is also rather annoying when scripters release without checking for clashes :x
First was mine. If you take a look at page 1 of this topic my script exist since May 2004. :)
-------------
But there is another important thing with my trade software for TS and the script of Burianek :!:
My script "Supply Software ST1" is developed for the standard X2. In standard X2 no players factory use secondary resources. So my 'ST1' cannot buy secondary resources for a players factory! The same with trade docks. Because trade docks use secondary resources only, the 'ST1' cannot buy or sell for a player owned trade dock!

Post Reply

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