[Bonus Plugin] Commercial Agent

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

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

Aesir
Posts: 68
Joined: Sun, 7. Jan 07, 15:04
x3tc

Post by Aesir »

jlehtone wrote:Input {0}{4}{1} makes the ship write every transaction into file 'log1502.txt' in your X3 folder.
Yes, I had logging on (the documentation for the Bonus Pack in this topic indicates the log file is named 8001.txt - and I think it was before I'd applied the hotfix on page 14 of this topic. The log only showed 'real' transactions and not these 40 energy cell purchases I mentioned though.

I monitored the freight bay of the CA during these runs, and even when it was not high enough level to use it's jump drive, it would get 40 ecells, and periodically go for another 40 ecells (but not really buy them, it would just dock at it's destination and not buy, then leave to do another order for 40 ecells, or sometimes go do something else).
[Edited: I see what this 40 energy cells thing is all about. It just shows what's in the current freight bay, but not that it's going out to buy 40 energy cells. I suppose then if the price goes up above limits set, that the freighter will dock and not buy anything, undock and keep showing this '40 energy cells' while it looks for another source within price limits. The trick apparently is to stop watching the CA and go to sleep, but leave the game running. When you wake up, progress will be made.]

I now understand the satellite naming requirements though, and after leaving the game running overnight, the CA leveled up high enough to use it's jump drive. Though I had the Jump Drive installed from the start, the CA seems to go on 'fake' runs for 40 energy cells. This is a guess though, as I really cannot tell why it does this. I presume it does this when it is 'Training'.

The issues I faced might be resolved with updated documentation explaining that the satellites must be named for the CA's home base, not just any home base (or just Advanced Satellite if you want all of your CAs to go to a given sector).

Despite the oddities, it is now a Freight Pilot and can keep up (easily) with Ore Mine M supply and production, so I am generally pleased with the script now and intend to continue using CA as I build my empire. I will be back soon asking about CLS once I start trying to manage logistics between disconnected stations and complexes. :)

[Edited to add:
Wanted to keep a running list of possible bugs.

* CA gets promoted from Courier to Freighter Pilot 1st Class, bypassing training for Freighter Pilot 2nd Class? Logs show:

2-10:56:51: Freighter: CAG TS (InterSys Ore Mine M Alpha) 01 01 C-J
and the very next entry is:
2-11:00:47: Freighter: CAG TS (InterSys Ore Mine M Alpha) 01 01 FP1-JN-J
I believe I use configuration option 9, where C=Courier and FP1=Freighter Pilot 1st Class

* Documentation: BP 3.1.0.6 is more up to date than this topic. Some configuration options are missed and log file name is not accurate. The newest documentation is by Lucike but is in German. Though I can't read German, I can see that there is at least one newer configuration option added that is not shown in 3.1.0.6 readme(english).xml. Documentation conflicts in some terminology. For example, the readme(english).xml refers to Auxilliary Courier rank, but the game refers to it as Assistant Courier. Script version I have installed is BP 3.1.0.6 + signed 'hotfix' from page 14 of this topic.

These are minor things, but now that I have it working more or less as expected, I'd love to see some of the last kinks worked out to really make this script and the Bonus Pack scripts more polished.
-æsir
Horrigan
Posts: 92
Joined: Tue, 24. Jul 07, 20:44
x3tc

Post by Horrigan »

ouch wrote:try viewing him through the sector map and then scroll down to see his destination.
Hmm could you be more specific please? I didn't find this destination thingie you're talking about..
jlehtone
Posts: 22559
Joined: Sat, 23. Apr 05, 21:42
x4

Post by jlehtone »

Rest assured that the documentation is worked on. :wink:
Horrigan wrote:
ouch wrote:try viewing him through the sector map and then scroll down to see his destination.
Hmm could you be more specific please? I didn't find this destination thingie you're talking about..
It does not have to be via sector map. It is the ship menu you want. Select (highlight and Enter) a ship from the property list.

Ship menu is a dialog with two parts. The top part shows ship information, such as pilot name, shield value, hull value, etc. You do not see all of them at once. Try pressing 'PageDown' to scroll.
The bottom part of dialog shows the commands and you scroll that with arrow keys.
Goner Pancake Protector X
Insanity included at no extra charge.
There is no Box. I am the sand.
mrkdhrvy
Posts: 175
Joined: Mon, 7. Mar 05, 00:09
x4

Post by mrkdhrvy »

jlehtone wrote:Code looks like mrkdhrvy's idea about CAG on PHQ might work as expected.
moon-monster wrote:You mean {3}{4}{x}? Yeah, I don't really understand what this is for.

Code: Select all

ConditionC = {3}{3}{C}
ConditionD = {3}{4}{D}

Sell IF  ConditionC OR ConditionD
Thus, even if station does not yet have C% in stock, a small ship might be able to haul some. The only case where this might be useful is when one ware has large stock and another has small, and one ship has to haul both.
Moon-monster, jlehtone,
So I tried to get my CAG to work with the HQ by adjusting several {3}{3}{C} values/stock levels and it turns out I couldn't get it to work. I thought that perhaps it uses the percentage of stock out of the total possible (x/500000) instead of the ware limit that the PHQ allows us to set. Neither seemed to get the CAG to sell the excess I had in the HQ. Trying to get the {3}{4}{D} command to make the CAG sell didn't seem to work either. Bummer really - CAGs will buy for the PHQ but not sell. If I would have spent the time figuring out how scripts work, I could have probably kept myself from going through this trouble. :roll:
Storm666
Posts: 2013
Joined: Wed, 3. Mar 04, 23:42
x3tc

Post by Storm666 »

CAGs will buy for the PHQ but not sell.
it my understanding that you cannot get cag's to buy and sell from a HQ because it is dependant on your trade setting on the HQ, if its set to 'No trade with races' it will buy only, if set to trade with races it will sell only (or is it the other way around?).... you cannot have both
jlehtone
Posts: 22559
Joined: Sat, 23. Apr 05, 21:42
x4

Post by jlehtone »

Storm is right
Readme wrote:Trading Stations and Equipment Docks: When the pilot works for a Trading Station or en Equipment Dock, he will buy and only buy goods, if the dock does not allow other races to trade with it. Agent will sell and only sell goods, if the dock lets other races to trade with it. This applies to player HQ too.
and mentioned on this thread too.

So I have a "sandwich":
1. HQ with CAG buyer
2. CLS1 from HQ to ED
3. ED with CAG salesman

For local trade I have couple:
1. Trade Dock
2. CAG buyer
3. SM salesmen
Goner Pancake Protector X
Insanity included at no extra charge.
There is no Box. I am the sand.
ouch
Posts: 461
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by ouch »

Horrigan wrote:
ouch wrote:try viewing him through the sector map and then scroll down to see his destination.
Hmm could you be more specific please? I didn't find this destination thingie you're talking about..
push "r" to bring up the properties screen, find the ship, push enter, press "page down" a few times till you can see his orders.
Please fix the AI Egosoft! I'm sick of losing ships(doesn't matter what class) when they fly into what they are attacking! This occurs even if the object is stationary and doesn't have any protrusions.(Like a pirate base) It's just sad, and it totally ruins the entire concept of the series!
Horrigan
Posts: 92
Joined: Tue, 24. Jul 07, 20:44
x3tc

Post by Horrigan »

Is there a way to forbid them pirate sectors? All my ore cag are attracted to a damn pirate alley...
jlehtone
Posts: 22559
Joined: Sat, 23. Apr 05, 21:42
x4

Post by jlehtone »

Horrigan wrote:Is there a way to forbid them pirate sectors? All my ore cag are attracted to a damn pirate alley...
Set "Show as enemy if enemy to me" to 'No' and
set Pirates to 'Foe'. That should do it.

If it does not, there is still the "limit to AdvSat sectors", and "do not jump that far". The latter hampers global marketing plans though and former requires setting up that satellite network.

"Pirate Alley" ... and Ore? The Loomank-MiTon-MooKye Alley and Ore? Cannot remember seeing Ore industry there, but then again, haven't looked either. And X-Universes tend to differ. A bit.
Horrigan
Posts: 92
Joined: Tue, 24. Jul 07, 20:44
x3tc

Post by Horrigan »

Well there is new sectors that connect moo-kye and Maelstrom in XTM. A lots of them have stations.
jlehtone
Posts: 22559
Joined: Sat, 23. Apr 05, 21:42
x4

Post by jlehtone »

Ahh, the "added pleasures" of XTM, those I know not. :wink:

@Aesir:
Aesir wrote:* Documentation: BP 3.1.0.6 is more up to date than this topic. Some configuration options are missed and log file name is not accurate. The newest documentation is by Lucike but is in German. Though I can't read German, I can see that there is at least one newer configuration option added that is not shown in 3.1.0.6 readme(english).xml. Documentation conflicts in some terminology. For example, the readme(english).xml refers to Auxilliary Courier rank, but the game refers to it as Assistant Courier. Script version I have installed is BP 3.1.0.6 + signed 'hotfix' from page 14 of this topic.
True, first post of this topic is old compared to current BP. Readme format tags and post format tags differ. Not just a cut-n-paste. Sort of up to OP.

Unsigned script does use text page 8001, while signed uses 1502. And original (as well current) translation are based on the unsigned description. Can be fixed.

The script uses rank strings that are actually in game. Readme uses translations of german strings (from description). Can be fixed.

Unsigned CAG is on version 3.3.01. Signed is 3.2.17 (IIRC). Are there other config options in Readme missing than the "arbitrary amount of jump fuel", which was added in 3.3.00? For the record, I cannot read German either. That is why I do translate it to English. :P
Goner Pancake Protector X
Insanity included at no extra charge.
There is no Box. I am the sand.
mrkdhrvy
Posts: 175
Joined: Mon, 7. Mar 05, 00:09
x4

Post by mrkdhrvy »

thanks Storm and jlehtone - I didn't realize that the latest bonus pack documentation contained much more info than the beginning of this thread. :shock:
Aesir
Posts: 68
Joined: Sun, 7. Jan 07, 15:04
x3tc

Post by Aesir »

jlehtone wrote:Are there other config options in Readme missing than the "arbitrary amount of jump fuel", which was added in 3.3.00? For the record, I cannot read German either. That is why I do translate it to English. :P
Babelfish wrote:{2} {3} {X} the pilot holds itself jump energy reserves of X energy cells, instead of a supply of 10% of the loading space and/or. 20% with an installed Boost extension. (X = 0 standard jump energy reserves)
Yes, that is the one I see. I did use babelfish before posting previously, but babelfish didn't do quite as well (as what we see above) for other parts of the German topic (and I was left babbling...)


Relating to the documentation differences, 3.1.0.6 readme fails to document {4} {X} {Y} in a useful manner. The German topic links a coordinate map that defines the required inputs for that command: wieder mal ne sektorenkarte (update: 10.01.2006)

I see this map as a spoiler, and for that reason (and others) Egosoft may not want to link to that the topic in the readme. But without defining the parameters required, I expect many folks are missing out on the possibilities that {4} {X} {Y} offers in terms of organization of "trade zones". Therefore, I would suggest expanding the readme documentation to at least describe how the coordinates are mapped and/or giving some landmark references (like saying that Argon Prime is at 1,3 or Kingdom's End is at 0,0 for example).

Anyway, I'm glad I stuck with this script this time around - I gave up using it the first time I played X3 because it "didn't work". But I was probably missing some critical information that I have now. Now, I have 2 separate mines and 2 factories that comprise the start of a planned 6 factory Bio complex that are all operating autonomously using just 3 CAGs. I have changed some default parameters (I think you have to for the CAGs to be most effective), but these factories have operated for days now without stopping production and sales. Soon I will rule the universe, and this time I will do so without needing UTs to generate income.

[UPDATE]
I now have a 6 station Argon Bioware Complex, with a Cahoona Bakery M, Rhimes Fact M, 2 Wheat Farm M, and 2 Argnu Cattle Ranch M stations. This is designed to supply 2 primary products and 2 intermediate products products to surrounding sectors, as well as supplying intermediate products for it's own production (and requiring only energy cell purchases to operate). I have 2 CA Freighter Pilots running the show, with 1 tasked to buy just energy cells (Mercury Tanker), and the other (Mercury) tasked with sales of the production. They are keeping up just fine with production requirements, and it doesn't appear I will require a 3rd CA as originally planned.

Here is a short orbiting video of the facility:
InterSys Corporation Argon Bio-Plex, Antigone Memorial
[/UPDATE]
-æsir
User avatar
V2200
Posts: 2526
Joined: Sun, 1. Aug 04, 00:35
xr

Post by V2200 »

Hi everyone.

I have a question to two options:
Input - {3} {3} {C}
Auxiliary Courier or higher: Products are sold when stock is above C% (default 20%)

Input - {3} {4} {D}
Auxiliary Courier or higher: Products are sold if the pilot can load D% into his cargobay (default 30%)
What of them has the greatest priority for my CAG, which trades only one type of the goods?

edit:
Ok, thanks Carlo the Curious :)
Last edited by V2200 on Sun, 23. Sep 07, 18:53, edited 1 time in total.
User avatar
Carlo the Curious
Posts: 16999
Joined: Mon, 5. Mar 07, 22:03
x4

Post by Carlo the Curious »

If I'm reading the code correctly...

If either are true then the CAG will sell, but it checks stock level first.
Rapier
Posts: 11377
Joined: Mon, 11. Nov 02, 10:57
x3tc

Post by Rapier »

jlehtone wrote:Storm is right
Readme wrote:Trading Stations and Equipment Docks: When the pilot works for a Trading Station or en Equipment Dock, he will buy and only buy goods, if the dock does not allow other races to trade with it. Agent will sell and only sell goods, if the dock lets other races to trade with it. This applies to player HQ too.
and mentioned on this thread too.
I've been looking at this issue myself just now. It's the first time I've really looked hard at a script, so please forgive me if this is a daft question, or I've got it completely wrong:
In the main script file plugin.agent.main (or whatever the full name actually is, I'm remebering names and numbers rather than having noted them down), around line 330-350, the script appears to be setting lists of what are wares and what are products at the homebase. Lines 345-350ish seem to be setting this when the homebase is a dock. If, instead of adding $Ware to array.WareProduct or array.WareResource, it is added to array.WareIntermediate shouldn't the agent then treat all wares as intermediate products and buy and sell them accordingly?
I haven't had a chance to try this yet, but does anyone know if it should or shouldn't work?
Rapier - The Orifice of all Knowledge

Godwin's Law is not one of the Forum Rules.
Search just the forum with Google
Storm666
Posts: 2013
Joined: Wed, 3. Mar 04, 23:42
x3tc

Post by Storm666 »

@Rapier
not sure of what the script is saying (not looked) but it does work as stated in the quote
Rapier
Posts: 11377
Joined: Mon, 11. Nov 02, 10:57
x3tc

Post by Rapier »

Thanks. I realise how the script functions, which is why I'm trying to tweak it. I want to sell bu t also bar other ships from trading with my dock. I've had another thought thoug, wich doesn't involve changing any scripts, so I'll try that first.
Rapier - The Orifice of all Knowledge

Godwin's Law is not one of the Forum Rules.
Search just the forum with Google
jlehtone
Posts: 22559
Joined: Sat, 23. Apr 05, 21:42
x4

Post by jlehtone »

Rapier wrote:Thanks. I realise how the script functions, which is why I'm trying to tweak it. I want to sell bu t also bar other ships from trading with my dock. I've had another thought thoug, wich doesn't involve changing any scripts, so I'll try that first.
Prices. Vanilla NPC traders will never buy from (player) Dock. And they never sell cheap. So a right price means they will stay out. Even at low "acceptable" price, the NPC is prone to see a better deal elsewhere.


Trading Intermediates and trade at Dock are quite different:

Intermediates are both produced and consumed by the Complex. There is a need for trade only if the Complex would run out or would unnecessarily fill up with an Intermediate. And CAG trades Intermediates only when needed. Its configuration options say "when".

Dock does not produce or consume. You would like to see it buy and sell all the time and as much as possible. Ideally a ship would go out to fetch some more even when the Dock is already full, trusting that another ship will manage to sell the current stock before it returns with new wares. And the stock size of Dock is small. A freighter has no trouble filling the whole stock. Quite unlike the Intermediate ECell stock of some Complexes, where a moderate herd of Mammoths cannot fill it up.
Goner Pancake Protector X
Insanity included at no extra charge.
There is no Box. I am the sand.
Rapier
Posts: 11377
Joined: Mon, 11. Nov 02, 10:57
x3tc

Post by Rapier »

Assumiong your transatctions are infinitely quick, you're right. However, my main task is to stop my ships buying things because I want them to spend their time selling (supplying is done by CLS). IT seems that swapping array.WareResource and array. WareProduct works as expected, so I've got the setup I want. Cheers.

Incidently, my other plan was to set the 'Buy wares when station's credit balance is above B Cr" to be above the value of 'Auto transfer money to player account'. This did stop the ships buying, but they didn't start selling until I altered the script.
Rapier - The Orifice of all Knowledge

Godwin's Law is not one of the Forum Rules.
Search just the forum with Google

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