[SCR] [X3:TC/AP] [v1.8.9.8] [11/16/2019] MK3 Improvement Reloaded

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
Simoom
Posts: 1110
Joined: Sat, 30. Oct 10, 14:14
x4

Post by Simoom »

Thank you so much for your reply! :)

I downloaded your script and began testing it out. I will let you know if I find any bugs or if I feel it needs any improvements.

I was looking at Lucikes' EST script actually (someone suggested it to me before), which I think is a very solid concept as well. I am very used to the CAG interface and the EST is very similar.

I do agree that the Improved MK3 script would "overlap" with EST in functionality if a Ware Blacklist/Whitelist function were implemented, but the reasons I think it's still a feature worth considering for the Improved MK3 is as follows:

1) If Egosoft ever decides to pick up EST or Improved MK3 for the official Bonus Pack, it's likely it will only pick one of the two (due to similar functionality). Considering that the MK3 trader has been around since Reunion, I doubt Egosoft will let EST replace MK3 - however, having the Improved MK3 replace the version we currently have seems a more likely possibility. In this case, the ability to assign only a set number of traders to deal with a particular ware can be a functionality welcomed by those who want to have more precise control over the game's economy (since the only alternative would be using CLS 2 to trade, and that is a LOT more trouble to set up than EST).

2) Even with the ware blacklist/whitelist option, the Improved MK3 should still be a lot less cumbersome than EST to configure (EST has very detailed settings for profit margins, cargo settings, etc.).

That's just my opinion, anyway. Not going to be pushy about it - by the sounds of it Improved MK3 should already satisfy most of my needs. :)
gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator »

You're right. It's always better to have some functionality available for those who need it.

And don't get me wrong, I do find the feature useful. But I don't have much free time right now. So if I find some time, I will definitely test it out and play a little with the idea.
But don't expect anything too soon.

On the other hand, please feel free to do some experimenting on your own and ask me, if you have some questions. I think the new code structure should make it a lot easier to learn and understand the way the script works.

Basically, each script represents a method with parameters and a return value.
User avatar
Simoom
Posts: 1110
Joined: Sat, 30. Oct 10, 14:14
x4

Post by Simoom »

gnasirator wrote:You're right. It's always better to have some functionality available for those who need it.

And don't get me wrong, I do find the feature useful. But I don't have much free time right now. So if I find some time, I will definitely test it out and play a little with the idea.
But don't expect anything too soon.

On the other hand, please feel free to do some experimenting on your own and ask me, if you have some questions. I think the new code structure should make it a lot easier to learn and understand the way the script works.

Basically, each script represents a method with parameters and a return value.
I will try - I have never tried scripting before so it may be a while before I make heads or tails of anything. :P

In other news, really loving your script so far:

1) The "sale remaining ware" function seems to be functioning perfectly without issue. I switched over from the old MK3 and had to re-issue the trade commands, but upon receiving the new trade command they all went and sold their old wares.

2) You seem to have lowered the E-cell reserve - IMO this is a welcome change. The old MK3 uses around 15% of the cargo bay for E-cells (I think), which is fine for freighters with small cargo bay, but for freighters with large cargo bay they often carry way too much E-cells (a freighter with 14000-15000 cargo will often keep almost 2500 E-cells for jump drive, which is just excessive). It looks like you set a hard limit of 750 E-cells for UT's and... for ST's they seem to adjust the E-cell reserve based on the jump range of the trade command? :) Pretty smart.

3) The improved Emergency Jump routine is amazing - I had a MK3 trader attacked by a Xenon Q earlier today. Instead of launching all his Fighter Drones, he only launched 3 (I am guessing he releases them in small batches rather than waste them all at once) - and the drones were set on "Attack All" command rather than "Protect...", which is the much smarter choice since it forces the enemy to divert their attention. Not only did the MK3 trader escape - he escaped with full shield. This would have never happened with the old MK3.

I do have one concern though - with the old MK3, I was running 15 LT's + 50 UT's, none of them ever went on standby (though plenty of them were running "crappy deals", like selling a few Crystals or Ore). With the Improved MK3, about 2/3 of my trader fleet now spends most of the time on Standby - I am not sure if it's due to the aggressive profit margin setting? The thing is after running the Improved MK3 for a whole day, I am noticing a lot of factories starting to be starved of resources (particularly E-cells) - and there are plenty of SPP's with full stash of E-cells selling at 12 credits. But for some reason most of my MK3's remain on Standby despite the deals being plainly there (often in the sector they are in, or right next to it).

Would you know why they may be acting this way?
gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator »

they seem to adjust the E-cell reserve based on the jump range of the trade command?
Exactly :)


What size are your trader's cargo bays? I hope you're not using small TP/TM like ships only? It could be that they simply won't be able to transport ecells profitably.
I set the threshold to 1 cr, basically. So after deducting all expenses (including fuel AND salary) traders have to make a profit, then they are fine to go.
That obviously seems not to be the case?

If I am wrong here, I'd ask you to send me your save game including a list of your mods or better links to their downloads.
Because looking myself is always easier than trying to figure out the problem remotely.
User avatar
Simoom
Posts: 1110
Joined: Sat, 30. Oct 10, 14:14
x4

Post by Simoom »

gnasirator wrote:What size are your trader's cargo bays? I hope you're not using small TP/TM like ships only? It could be that they simply won't be able to transport ecells profitably.
I set the threshold to 1 cr, basically. So after deducting all expenses (including fuel AND salary) traders have to make a profit, then they are fine to go.
That obviously seems not to be the case?

If I am wrong here, I'd ask you to send me your save game including a list of your mods or better links to their downloads.
Because looking myself is always easier than trying to figure out the problem remotely.
My entire trading fleet uses maxed out Hayabusa (also tweaked their speed a little using the Cheat Package to make them more efficient in Terran space), so cargo bay definitely isn't the issue.

Due to the size of the Terran sectors, I have 15 LT's flying Terran sectors only (set to Uranus --> Jump Range 7, which covers all of Terran space. War Sectors are blacklisted of course). I am noticing a lot factories are lacking E-cells - other wares don't seem to be a problem but that could just be because E-cells run dry before the other stuffs do. I am ignoring Water and Protein Paste shortages because those are actually due to Terrans not having enough of those factories to supply the demand.

Not sure if my traders are ignoring E-cells because other wares are more profitable - but I read through this topic and the Improved MK3 supposedly prioritizes in keeping factories going? Do the factory actually have to be completely out of E-cells before this routine kicks in, or will factories that buy E-cells at 18/19 be considered critical?

I'll link a copy of my most recent Save File here (let me know if it works): http://www.filedropper.com/x01

I don't have much in terms of mods - right now it's just your Improved MK3 and Cycrow's X3 Cheat Package (for tweaking things I need).
gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator »

okay great. I'll check it out!

edit: got it.

Did you use my installer (.exe) to automatically unpack the improved mk3 script?
If not, please use it, reinstall my script and THEN download this:

http://code.google.com/p/x3tcscripts/do ... k3_fix.rar

please unpack this folder into your x3/addon folder.

Important! Follow these steps AFTER loading your game for the first time:
1) wait ~2min in sinza.
2) save
3) Quit the game.
4) go to folder addon/scripts and DELETE setup.fix.mk3.xml
5) If you want a tidy scripts folder, you CAN also delete the two scripts:
- a.restart.allMy.Mk3.xml
- a.get.all.my.xml

That should bring your traders back online!


Background:
It really is a bug but it only occurs if someone with already experienced traders switches to improved mk3 script. The trader's salaries could then sometimes be calculated too high. But only, if the traders already had earned LOTS of money.
So the fix resets the flight.number local var and then restarts all traders which then calculate their new avg. life time profits correctly to get a realistic salary.

If you start a new game, this will not be a problem at all.
Think, I'll release a hotfix about this soon. maybe tomorrow.
Everyone, who wants the hotfix now, can download the file above and extract ONLY the plugin.autotrade files in it.
SirSigfrid
Posts: 1
Joined: Sun, 5. May 13, 15:35
xr

Post by SirSigfrid »

Thks for your script. Nevertheless, I found a small bug in the french file : 1500-L033.xml.

<language id="44"> instead of <language id="33">
gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator »

thanks! fixed for next release.
User avatar
alt3rn1ty
Posts: 3528
Joined: Thu, 26. Jan 06, 19:45
x4

Post by alt3rn1ty »

gnasirator this looks very nice

I used to always look out for the latest of Lucikes scripts ( in particular EST ) but I am going to give this a shot instead.

The overview sounds nice for included features, especially the restart which was always annoying that your UT's could not make a decision if fuel was unavailable and they get stuck with a cargo hold full of wares waiting for you to get them up and running again ..

The original MK3 also stops a trader if they reach a level as Sector trader where they could become Universal Traders .. It gives the message could not sell wares, but actually when you inspect the freight, they have sold everything so I believe the original script is just trying to tell you a Sector Trader can now be a UT, but does not give you a dedicated message for that circumstance.

Does your MK3 in that case continue as Sector Trader ? ( for me personally that would be ideal, because if I plan on changing any particular trader to UT I periodically check on them, whereas all my other traders I would rather they just continue being ST's without further interaction from me )

And second question : "Rest ware selling" is a bit ambiguous ( at rest, resting / all the rest, quantity left over ) .. I am guessing this feature attempts to sell any leftover goods which due to unforeseen circumstance ( another trader got their first ) that your trader will sell what it can, and continue to sell the same goods at another station until it gets rid of the order it could not deliver.
gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator »

Hey,

you guessed it all right!

STs continue after max level. I never tested it in particular but I don't know why they shouldn't.

And rest ware selling means selling of leftover wares. You can even dump loads of unneeded stuff into a big TS's cargo bay and by starting it as a LT/UT you can send it off to sell it.
User avatar
alt3rn1ty
Posts: 3528
Joined: Thu, 26. Jan 06, 19:45
x4

Post by alt3rn1ty »

:) Excellent, well I only got AP recently, and after following a heap of DrBullwinkles recommends and following through on them eventually found your mod ( now bookmarked ) ..

I have a couple of setups, one is for XTC, and the other is a new AP setup

My very first Sector trader in the AP setup has been started with your mod so will let you know if it does not continue past its "Ready to go UT" stage.

Thank you for this.
gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator »

I have to say, though, that this script doesn't officially support XTC.
Only vanilla and XRM are tested and should work.

XTC could / should, too but I can't guarantee.

A fresh ST should simply level up until he reaches level 10 and continue trading this way. Sooner or later he'll have lots of downtime due to lack of profitable trade routes.

Please keep me informed if anything unusual happens!
User avatar
alt3rn1ty
Posts: 3528
Joined: Thu, 26. Jan 06, 19:45
x4

Post by alt3rn1ty »

Nothing unusual in AP, I just got my Mistral Sector Trader up to level 8 ( checked whether he now had the Universal Trader option available and he did ) .. And he continued Sector Trading without my intervention :).

I have now fit him with Phased Repeater Guns all round, changed him to Universal Trader ( I need more cash building rapid for more profitsss ), and my empire begins.

More Sector traders next, and I can breath a sigh of relief they will not need a mother every step of the way, followed by stations, and I need to get some Lasertowers for the AP Plot continuation.

This mod is just the job, sorts out the problems with MK3, and I love how they pick up on selling excess wares. Even if you call one in mid-trade run to jump to you, exchange equipment ( add lasers etc ), then tell it to Start Universal Trader again .. It then proceeds to sell the excess and get back into scanning the universe for more trades.
I did that in Cloudbase Southwest, and as soon as I launched it into Universal Trader mode again, not only did it resolve the excess ware onboard from the interrupted trades, but it took advantage of all the weapons on sale in that sector and after a couple of runs I was 1 million credits up on just before I called him in.

Just what you would expect a highly trained trader to be able to do.

I am also looking forward to the better awareness of enemies, and not losing quite so many UTs over time.

Thanks again gnasirator, brilliant mod.
User avatar
Simoom
Posts: 1110
Joined: Sat, 30. Oct 10, 14:14
x4

Post by Simoom »

gnasirator wrote:Did you use my installer (.exe) to automatically unpack the improved mk3 script?
If not, please use it, reinstall my script and THEN download this:

http://code.google.com/p/x3tcscripts/do ... k3_fix.rar

please unpack this folder into your x3/addon folder.

1) wait ~2min in sinza.
2) save
3) Quit the game.
4) go to folder addon/scripts and DELETE setup.fix.mk3.xml
5) If you want a tidy scripts folder, you CAN also delete the two scripts:
- a.restart.allMy.Mk3.xml
- a.get.all.my.xml

That should bring your traders back online!
No I didn't use the .EXE - I manually installed the mod by copying the files over, I wasn't sure if that could have caused the issue (since the traders seemed to be working fine aside from not wanting to trade E-cells, I presumed all was well)
Background:
It really is a bug but it only occurs if someone with already experienced traders switches to improved mk3 script. The trader's salaries could then sometimes be calculated too high. But only, if the traders already had earned LOTS of money.
So the fix resets the flight.number local var and then restarts all traders which then calculate their new avg. life time profits correctly to get a realistic salary.

If you start a new game, this will not be a problem at all.
Think, I'll release a hotfix about this soon. maybe tomorrow.
Everyone, who wants the hotfix now, can download the file above and extract ONLY the plugin.autotrade files in it.
Okay! Thanks for the explanation & the hard work! I'll test this out right away. ^_^
User avatar
Simoom
Posts: 1110
Joined: Sat, 30. Oct 10, 14:14
x4

Post by Simoom »

Holy crap - the fix worked alright! ALL my traders just went active and are now on their way to buy! :)

Thanks so much! I will continue to test and give you feedback on this awesome script!
User avatar
alt3rn1ty
Posts: 3528
Joined: Thu, 26. Jan 06, 19:45
x4

Post by alt3rn1ty »

gnasirator I think I found a minor problem ... although I am not entirely sure its a problem with Mk3 Improved, but actually expected behaviour.

Reference weapons a trader can fit into turrets - Not really your area with this mod but read on for a funny story ...

That Mistral which is now a UT, I sent him on his way equipped with 6 PAC, and 6 PRG ( I also have Smart Turrets installed for AP ( v4.5 ), and enabled Smart Turret Defence on all turrets with the objective of the UT having a choice of each weapon for all 6 slots )

I noticed tonight that he has along the way making trades sold all 6 PRG ( I guess I should have seen that coming really on a trader with excess wares ) ..

.. But the thing is he also sold 5 of the PACs. So now he only has 1 PAC onboard.

Unless that was Smart Turrets which put the 5 PACs offline in the cargo, and then the trader has gone ahead and sold what it now sees as excess weapons - Which is why I think this is probably going to be expected behaviour.


In hindsight I now realise there is a measure which I could have used to prevent this happening .. I noticed earlier that going into ships additional commands you can add wares that the trader will keep onboard ( "Hint: MK3 Traders can use Advanced Drones" <<-- Side note: Those are actually "Fighter Drones MKII" I think, when adding wares in AP "Advanced Drones" are not listed ) ..

I believe I should have took the hint and told the Mistral to keep hold of 6 PACs and 6 PRGs :)

I think that tip of making use of the Add Wares to keep weapons might be worth a mention in the mod description as a heads up of expected behaviour in those circumstances with turret swapping scripts installed ( Probably applies for MARS too ).
gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator »

@Simoom: glad, that it worked. don't forget to delete the setup script again :)

@alt3rn1ty:
Thanks for the hint, I'll change the t-file accordingly. About the rest: you guessed it all right, nothing to add from my side :)

edit:
okay, got the fixed version out at page #1.
User avatar
alt3rn1ty
Posts: 3528
Joined: Thu, 26. Jan 06, 19:45
x4

Post by alt3rn1ty »

gnasirator wrote:~ okay, got the fixed version out at page #1.
;) Noticed the Tip fix too, thank you, thats reading correct here in game.
User avatar
Simoom
Posts: 1110
Joined: Sat, 30. Oct 10, 14:14
x4

Post by Simoom »

gnasirator wrote:@Simoom: glad, that it worked. don't forget to delete the setup script again :)
Yup I followed your instruction carefully this time. :) Improved MK3 been running 3 days without any problem now - all NPC factories are working happily and I don't notice any ware shortages.
gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator »

Great news!
Hope it stays that way :)

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