[SCR] Commercial Agent [2010-04-28 X3TC 3.3.03]

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

User avatar
Saetan
Posts: 3223
Joined: Wed, 1. Feb 06, 19:26
x4

Re: [SCR] Commercial Agent [2010-04-28 X3TC 3.3.03]

Post by Saetan »

It's all described in the manual:
Lucike wrote:Trade Duties

[ external image ]

[...]

Purchase Resources
The Agent will buy resources to fill up the homebase to this level.

Sell Products
The Agent will sell stock down to this level.

Sell Products Freighter cargo bay
The Agent will sell products, if it can fill its cargohold at least to this level. In this case, the Agent will sell product even if the "Sell Products" requirement is not met. The rationale here is that it is more important to sell "sufficient" amounts than to wait for the product stock to fill up.

[...]

Purchase stations credit balance
The agent draws from the station's account to buy resources and intermediates. The agent will not purchase anything if the station has fewer credits than this limit.
For a dock, just replace ressource and product through ware. But be aware of the following:

Apprentices can't work for a dock, the pilots have to be at least of a courier level. Also, you have to set the "Sell Products Freighter cargo bay"-setting to 101%, else the freighter will go and buy the wares, ignoring the set limit for the station, if it can fill its cargo bay to the set own limit.
Goncyn
Posts: 98
Joined: Fri, 17. Jan 03, 02:51
x4

Post by Goncyn »

I think that will work OK. Thanks for the explanation. Maybe you can add a sentence to the manual to say that all the "trade duties" settings apply to docks? I wasn't sure if they would.
Maverick024
Posts: 139
Joined: Tue, 21. Nov 06, 17:16
x3tc

CAG Help

Post by Maverick024 »

Could someone please advise as to where my CAG setup is going wrong.

I have a trading station set up to buy and sell high-end tech, weapons and such-like. It's based in Argon Prime. It operates a few CAGs in M3s in the local area and over greater distance uses Mistrals.

I have the Mistrals set up to use jumpdrives to go anywhere. They have a range as a CAG of 20 sectors, and jump energy reserves of 400 Ecells (so 40+ jumps). The Mistrals however keep taking enough jump energy from the trading station to get to their destination, then buy whatever weapons their collecting and fly back without jumping. This often means that they buy from lower Paranid space and go back through pirate alley. I have had one attacked before who survived, but have just lost one 10 minutes ago in Nopileos' Memorial.

The CAGs are all trained to Major Dealers before being put to use. All pirate sectors are blacklisted.

Does anyone know what I am doing wrong with the setup of these CAGs? The log is posted below:

Code: Select all

Commercial Agent

Script version: 3303
Libraries version: 3415
Pilot Union version: 3310

Pilot: Menika Cheram
Pilot rank: Major Dealer
Flight time: 32:13 hour
Employ time: 35:25 hour
Payment: 66,790 credits
Profit: -5,566,830 credits
Expenses: -153,512 credits

Promotion: Yes
Payment: Station account
Agreement with colleagues: Yes

Ship name: SolTrade <ArgP.STHQ> CAG 03 Mistral
Ship class: TS
Ship type: Mistral
Transport class: Extra Large Containers XL
Cargo bay size: 3000 units
Cargo bay volume: 266 units

Relation to Argon: Neutral
Relation to Boron: Neutral
Relation to Split: Neutral
Relation to Paranid: Friend
Relation to Teladi: Neutral
Relation to Xenon: Foe
Relation to Kha'ak: Foe
Relation to Pirates: Neutral
Relation to Goner: Neutral
Relation to ATF: Neutral
Relation to Terran: Neutral
Relation to Yaki: Neutral

Fight Command Software MK1: installed
Fight Command Software MK2: installed

Supply Command Software: not installed

Jump Drive: installed
Jump Drive: activated
Jump Drive: allowed
Jump Drive energy: 400 energy cells
Jump Drive minimum jumps: 1 jumps

Home base: SolTrade HQ Teladi Trading Station <ArgP.STHQ> (Argon Prime)
Home base class: Trading Dock
Home base type: Teladi Trading Station
Trade jumps: 4 jumps
Station account: 9,834,444 credits
Global account: 3,078,610 credits

Black list stations: -
Black list sectors: Bala Gi's Joy, Brennan's Triumph, Danna's Chance, Desecrated Skies, Farnham's Legend, Gunne's Crusade, Hatikvah's Faith, Moo-Kye's Revenge, Nopileos' Memorial, Ocracoke's Storm, Olmancketslat's Treaty, Savage Spur, Senator's Badlands, Split Fire, Unknown Sector, Unknown Sector, Weaver's Tempest, Xenon Core 023, Xenon Sector 598, Xenon Sector 627

Only trade with satellite network sectors: No
Only trade in sectors with a jumpgate: No
Only trade with non-player bases: Yes

Trader job: Trader
Purchase resources: 100 %
Sell products: 0 %
Sell products freighter cargo bay: 0 %
Purchase intermediate products: 0 %
Sell intermediate products: 0 %
Purchase stations credit balance: 30,000 credits

Home sector: Argon Prime
Home jumps: 20 jumps

Ware list type: Blacklist
Ware list: Energy Cells, Meatsteak Cahoonas, Mosquito Missile, Ore, Silicon Wafers
User avatar
Saetan
Posts: 3223
Joined: Wed, 1. Feb 06, 19:26
x4

Re: CAG Help

Post by Saetan »

CiaranM wrote:... energy reserves of 400 Ecells (so 40+ jumps).
CiaranM wrote:

Code: Select all

[...]

Jump Drive energy: 400 energy cells
Jump Drive minimum jumps: 1 jumps

[...]

Home sector: Argon Prime
Home jumps: 20 jumps

[...]
Wrong. You give your traders a little bit less energy cells as they would need for jumping to und back from the stations which are farest away. So, its 38/39 jumps (10/jump + 10 for the first sector) and not 40+ jumps. That means, there are no reserves if they need to do an emergency jump, or if the have to change their route because some other trader was faster than they.

If one of that cases appear, they may run out of energy cells and need to go for a walk then until their reserves are enough for a jump.

I'd suggest to increase their amount of energy cells.
Maverick024
Posts: 139
Joined: Tue, 21. Nov 06, 17:16
x3tc

Re: CAG Help

Post by Maverick024 »

Saetan wrote:Wrong. You give your traders a little bit less energy cells as they would need for jumping to und back from the stations which are farest away. So, its 38/39 jumps (10/jump + 10 for the first sector) and not 40+ jumps. That means, there are no reserves if they need to do an emergency jump, or if the have to change their route because some other trader was faster than they.

If one of that cases appear, they may run out of energy cells and need to go for a walk then until their reserves are enough for a jump.

I'd suggest to increase their amount of energy cells.
I've doubled their energy cell allocation and they're working fine now. Thanks for the help.
TestingTesting
Posts: 46
Joined: Sun, 8. Aug 04, 03:05

Post by TestingTesting »

i've been using "Automated Satellite Network"

my two recon ships go out and explore, and lay down sat network (Adv sats take time to come by so sat network builds very slowly).

here's a problem i have noticed,

sometimes my TS will jump out to a far out system, but then get stuck trying to get back,

the ships stays on idle,

i have noticed that the explorer ships utilize the jump drive, which bypasses certain sectors, like Xenon, or Unknown system's,


my TS ships also bypass these systems,

however there is no direct path back the way, the only way back for the TS ship is to jump, it can't come back by normal travel because no direct connections have been discovered as of yet, meaning my explorer ships have not discovered all the gates inside the systems,

because no direct path is available the TS ships can't seem to get back, i have checked the ship that is stuck in idle, and there are plenty of Energy cells, but for some reason the TS ship can't do what it done to get in the far out system "JUMP",

i see the TS ships quickly comes up with CAG Busy in the status, but then flashes back too IDLE, and the main destinations stays the same,



the CAGS are salesman locked to my Complex located in "Elysium of Light"

problem places that i have observed,

Third Redemption
Perdition's End
Eighteen Billion (gets stuck here a lot)
Ceo's Doubt
New Income
Homily of Perpetuity



i'm gonna restart my game from a early save point, but this time, i'm gonna tell my explorer ships (http://forum.egosoft.com/viewtopic.php?t=265029) NOT to use the jump drive,
i'm thinking that because no direct connections exists, if the CAG ships tries to come back using normal pathways, then it can't because they have not fully been explored yet, only way back would be the same way it got there JUMP DRIVE,


if my explorer ships can't jump, then they won't be able to bypass certain systems, and unknowingly not create the necessary direct connections needed for any ships trying to get there or back using those pathways.

i'm not very good at explaining, i hope people understand,


i will verify this by turning of the Explorer's jump drives, forcing them to travel using only jump gates.



****EDIT****

i can confirm this problem is being caused by the Auto Satellite network mod 1.33, when a explorer ship passes through a new gate in a new system, the gate is not revealed, the gate that the ship has jump come though is not revealed, so obviously as time goes on, systems become impossible to get to as there are no direct connections that exists.

i am going to post this issue in the relevant thread,

this would explain why the TS ship gets stuck, and is through no fault of this CAG script.
TestingTesting
Posts: 46
Joined: Sun, 8. Aug 04, 03:05

Post by TestingTesting »

i may have spoken too soon,

i think i have found another issue,


i have my complex in Elysium of Light of light, only 2 asteroids connected to a hub.


i have my 1 TS cag set to salesman,
use jump drive,

been working for quite some time, whilst i have been out exploring,


here's the problem, when the TS ship went into PTNI Headquarters to deliver, it now can't get back,

it went into the HQ, came out, got near to the West gate,

then stopped, the status is dest: Elysium of Light Complex hub A, and current order IDLE:


i tried stopping the Ship, then start the CAG again, same thing happened,


i then used the cheat option, and docked the TS ship to the HQ in the same sector.

then i restart the CAG, all went well for a few seconds, the ship came out of HQ, headed towards the gate and had "Fly to sector" in the current command, but then freezed again, the ship stopped, and the current status has gone to IDLE,


my next move is to manually dock the ship back to homebase, then start the CAG again, i know it will work, until the ship enters PTNI Headquarters sector again that is?


i will keep this post updated as i continue to look into this,


i was using Bonus pack, but i read that there is a small update using the new release, so i'm using the latest library and CAG install.



UPDATE

i moved the ship into another sector, restarted the CAG, same thing, stuck on IDLE,

i then gave the TS destination to Elysium of Light, as soon as the TS entered Elysium of Light, i gave the stop order, then i restarted the CAG,
surprisingly, the TS started to work, it came up with the command returning to Complex A, it's now in my complex hub,

however now it just stays on CLS Standby, it's completely broken, the ship will not go back out at all.

i have stopped the ship, restarted it, and nothing, the CAG is well and truly crashed,

the the only solution i have found it to take it back to herrons, fire the pilot, hire a new Pilot and zap it back to Elysium of light then start the CAG,

now it's working again.

needless to say, i don't stand no chance of expanding my empire utilizing CAG, if it breaks on just using one ship, then creating an empire is out of the question.

hope someone can advise, obviously something is wrong on my end, because no such reports like this is being posted, but what could cause the CAG to completely crash, and only be corrected by hiring a new PILOT?

UPDATE 2

i managed to get it working again, i realized that CLS was wrong,

CLS on standby, is logistics, not CAG.

i also noticed in the trade menu, that the order has changed,

Internal logistics
external logistics
commercial representative


when i start a new game the default order is usually

commercial representative
Internal logistics
external logistics

my CAG ship switched over to CLS mode all by itself,

i loaded in CAG information, started CAG, all is working now.


i am very confused in what just happened, and i don't even pretend to understand the complex mechanics behind these scripts and there underlying workings,

but my guess is, the CAG crashed, and when i tried to restart it, CLS was started and not CAG, but by loading in CAG saved information, then start CAG, all is fine now.

strange why the CAG, CLS 1 & 2 menu order has changed.


i'm just pleased that an easy fix works, firing and hiring new pilots is a no no for me,

loading CAG info, then start CAG, i can live with that, LOL,

i just have to remember if i see CLS, then i now know what's happened.

UPDATE 4,

i have found the problem,

when i started the new game i use Chea6t reveal all sectors, warp down to Elysium of light, then unreveal sectors.


i just started a new game, only this time i did not reveal all sectors,

so far everything is working great, PTNI Headquarters is no longer causing issues with CAG,

it would seem that revealing all sectors, then unrevealing sectors can actually cause problems down the line (well it has done for me)

tested this again, to make sure, reveal sectors, then unrevealed sectors, the problem returned after 22 minutes SETA x10,


without the reveal sectors cheat, 2 hours at SETA x10, no problems at all.
infik
Posts: 31
Joined: Fri, 16. Mar 07, 11:13
x3tc

Post by infik »

Hello, i have liitle problem with my CAG
all my 3 CAG stop at my station after reach level trader :( and stay at standby staus.

I prefer use it to suply my factories with energy cell , befor lvl trader all run good. Is possible run CAG after lvl or i need keep all to max lvl suplier ?
BlueSwede
Posts: 251
Joined: Sat, 7. May 05, 19:05
x3tc

Post by BlueSwede »

Is is possible to have the CAG trader sell multiple products to a station?
I have a missile complex building Tomahawks, Hammer torpedos and Flail barrages, but when the CAG trader sells a product it only sells one product on each trade run, even if the outpost can buy all 3 types of missiles.
rugaard
Posts: 180
Joined: Wed, 13. May 09, 01:40

Post by rugaard »

ive downloaded and extracted this mod and the library but it still doesnt work
Ch1m3ra
Posts: 14
Joined: Wed, 22. Jul 09, 13:04
x3tc

Post by Ch1m3ra »

I'm new to CAG, and I have a few questions.

1. How does the pricing system work? I have activated it for all stations but the prices just sit on average, even though stock changes.

2. Do CAGs rank up by doing stuff or just over time?

3. How long does it take to rank up? It seems to take ages and they are way less efficient then vanilla traders @ low lvl.

4. Are they more efficient @ high lvl? (In other words can one CAG for example replace 2 vanilla traders?)

Oh and the naming seems to work only half of the time, doesn't really bother me though.

Thx in advance
Coruskane
Posts: 851
Joined: Fri, 13. Jun 08, 13:14
x4

Post by Coruskane »

Ch1m3ra wrote:I'm new to CAG, and I have a few questions.

1. How does the pricing system work? I have activated it for all stations but the prices just sit on average, even though stock changes.

2. Do CAGs rank up by doing stuff or just over time?

3. How long does it take to rank up? It seems to take ages and they are way less efficient then vanilla traders @ low lvl.

4. Are they more efficient @ high lvl? (In other words can one CAG for example replace 2 vanilla traders?)

Oh and the naming seems to work only half of the time, doesn't really
bother me though.

Thx in advance
1) Activating just means the station is checked for ware amounts every so often and the price changed accordingly: *subject to the price interval you have set*. So..in the CAG station administration menu where you activated price setting, select a ware and enter the lower and upper boundaries that you want prices to be adjusted to.

2) Yes. After X amount of flighttime working under CAG they will sit in a station on standby while doing a training course. They will then be promoted (subject to "Take trainings: Yes" in the menu being on)

3) iirc it takes about 10 hours of flighttime to reach highest rank Major Dealer / Logistician. Note that all the pilot ranks of the pilot union (except for Military Personnel), so CAG, CLS1/CLS2 and EST, are interchangeable and so you can train up a batch of pilots just by getting CLS2 pilots to fly between waypoints. I use this for closed-loop complexes, because low level CAGs cannot do anything for a closed-loop as they can only buy resources, not sell products. If you are, however, buying resources then just stick them straight to work for the station on their default settings. Indeed, Apprentice CAG and CLS1/2 are excellent for performing simple tasks like ferrying wares around an empire as they are a) easy to replace b) no salary c) more configurable than vanilla manual-trade loops. Also note, that if you hire a pilot from Macchiel Software Headquarters (The trading station in Herron's Nebula) there is a chance that you will start off with an experienced pilot.

4) yes. At higher level they will use JDs, they will be able to deal with more wares, they will perform multiple sales in one trip and they will interact with other CAG pilots to ensure optimal coverage, they will also avoid enemies. Vanilla buy/sell ware ships will frequently waste time flying to the same station as another pilot, they will get killed more often, they can only deal with one ware each, they will not help perform other tasks when necessary, and they cannot be given blacklists of sectors nor avoid dangerous areas like Xenon sectors.

5) Naming: it kicks in either when you hit "start", or if you are adjusting the option halfway through a cycle then it will activate upon starting a new cycle.

Hth...
tianlongprc
Posts: 132
Joined: Tue, 18. Aug 09, 09:41
x3tc

Post by tianlongprc »

Ok here is my problem. I need a trader that's sole job is to dock at it's home base and then sell what the complex produces and then go back to factory to pick up more and sell. It does not need to do anything else and I would like him to to travel outside the sector or better yet use my network of advance satellites to find the best place to sell the items.


Example:
Mistral Super freighter picks up 15k energy cells from my Complex in Argon Prime and then travels to Ore Belt and sells them and then travels back to Argon prime to get more and sell some where else.


I already use commercial trader, but I do not think it can do what I need it to do, or you have to train them up to the point where they can do it but because my factories are all self-sufficient, I have no way to train the pilot, because I believe the trader first has to start off by buying things for the complex right?
User avatar
ThalonMook
Posts: 1296
Joined: Tue, 3. Feb 04, 12:11
x4

Post by ThalonMook »

Hi,

in your case you can take a Economy and Supply Trader (EST) and let him work as he is a Trader. The he can use the jumpdrive but only 10 jumps. If you need more jumps you have to train him to Major dealer.

If you now change him to CAG he keeps his rank and you can let him sell your products.

Ok I hope it helps.

CU Thalon
Ch1m3ra
Posts: 14
Joined: Wed, 22. Jul 09, 13:04
x3tc

Post by Ch1m3ra »

Thx Coruskane, your help is much appreciated.

C
Xabraxas
Posts: 1
Joined: Wed, 15. Sep 10, 23:17

Commercial Agents for hire

Post by Xabraxas »

Thank you for this great script. Before using it, I had huge problems with my traders (especially the ones selling e-cells) flying to the same stations all the time.

But there is one thing I really would like to see implemented: hiring traders from the trader menu. The thing is that now that i have some serious cash coming in from my complexes, UT's, etc... I find it really tiresome to have to train my CAG up to Trader level just so they could sell complex intermediate products.
Spoiler
Show
Btw. i know about the Herrons Nebula shortcut, but it's just as tiresome when you have to do it over and over.
So why not just add the option to hire traders. My idea would be to add a list of traders (say 20) at random trader levels accessible trough the "Trader settings" menu, that gets refreshed every game hour (or two). The refresh could remove a random amount of traders (the lucky ones who got employed :D ) from the list and replace them with new randomly skilled ones.

I wouldn't mind to pay some nice amount of cash for a trader level CAG, let's say about 800000C or 1250000C for a Dealer or whatever you feel would be a fair price.
Baleur
Posts: 587
Joined: Fri, 28. Oct 05, 13:37
x4

Post by Baleur »

Sorry for a total noob question, but i just need a trader to buy energy cells for my factories (no complex yet), and sell their products..
Do i just put him as Commercial Agent in that system?
CPU: Intel i7 6300k RAM: 32gb GPU: nVidia 1070 6gb VRAM
User avatar
ThalonMook
Posts: 1296
Joined: Tue, 3. Feb 04, 12:11
x4

Post by ThalonMook »

Hi,

yes the Commercial Agent is the right one. But he only sells products after a short training periode. When he begins he only buys recources.

CU Thalon
Requiemfang
Posts: 3206
Joined: Thu, 16. Jul 09, 12:24
x4

Post by Requiemfang »

yeah, training period is the time he buys stuff to supply his homebase with materials. After he gets promoted past apprentice level he'll be able to sell wares
Baleur
Posts: 587
Joined: Fri, 28. Oct 05, 13:37
x4

Post by Baleur »

Thats fine, the most critical thing for me now is to get resources to the factories :)
So i just activate him in that sector and he'll manage the npc stations and my stations? Not just the station set as his homebase?

And what does the "quit working in station" setting do? Does it fire him or does it simply mean that he should pay all stations equal attention?
Thanks for helping a nub who hasnt installed the game in months :lol:
CPU: Intel i7 6300k RAM: 32gb GPU: nVidia 1070 6gb VRAM

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”