[Script][LU] Mk3 Improvement Reloaded Reloaded (v0.6.1b) 2014-10-29

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

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

Raaaak
Posts: 82
Joined: Fri, 29. Mar 13, 11:16
x3tc

[Script][LU] Mk3 Improvement Reloaded Reloaded (v0.6.1b) 2014-10-29

Post by Raaaak » Mon, 15. Sep 14, 00:09

This script is only compatible with the Litcube's Universe mod

First of all I'd like to thank Gnasirator for allowing me to build upon his excellent trade script, and Litcube for making an awesome mod.

And also willfe for inspiring me to finish this up.


Summary

This script is an update of Gnasirator's MK3 Improvement Reloaded to work with and respect the conventions of Litcube's Universe. And some improvements thrown in as well

- Respects PPP
- Registers sector security complaints
- Performance improvements
- More independent than LUV traders, less manual oversight needed


Download

Mk3_Improvement_0.6.1b

Installation

* Unzip file to LU main installation directory.
* If installing for the first time, restart all traders

*Optionally remove all !plugin.autotrade.* scripts in addon/scripts before installing


Features

LU integration
- Respects PPP
- Registers sector security complaints
- Requests and respects station trade locks
- Automatic renaming
- Restarts after E/I

Features from Mk3 Improvement Reloaded not already present in LUV
- robust rest ware selling, not affected by manual restarts of trade command or enemy attacks.
- improved fuel management, should never run out
- cargo manager enables storage of wares in ships cargo bay
- automatic shield upgrades at experience lvl 16+
- Smart illegal ware handling, only trades them where legal
- Upgrades ship as needed

Performance improvements
- Responds to [SIGNAL_TARGETED] instead of actively scanning for enemies
- Some redundant code removed

General changes and improvements
- Uses and sets autojump and autorefuel settings instead of custom jump handling.
- Improved move to start sector for traders. As long as they have a jumpdrive they will fuel up and jump there.
- Jumps at range 0 if shorter (at level 12+)
- buys and uses jumpdrive as soon as trade range > 0, instead of waiting for level 12


Known bugs / limitations

-Does not respect the LU ware blacklist
should not need it with the smart illegal ware handling

-No functional sector blacklist
PPP + Sector security checks combined with no war or unjumpable sectors should make it redundant

-Economy helper mode for high level trades is currently non functional

-Engine/Rudder/Cargo bay upgrade costs are reported incorrectly in the trade log (LU bug I believe)


Usage

Equip the ship with Trade Software Mk3 and optionally a jumpdrive, no other software needed.
Point it at a sector, at level 8 convert to UT, and then forget about it. You should never have to look at it again outside of exceptional circumstances.
Last edited by Raaaak on Wed, 29. Oct 14, 11:53, edited 9 times in total.

Raaaak
Posts: 82
Joined: Fri, 29. Mar 13, 11:16
x3tc

Post by Raaaak » Mon, 15. Sep 14, 00:11

[RESERVED]

Sparky Sparkycorp
Moderator (English)
Moderator (English)
Posts: 8074
Joined: Tue, 30. Mar 04, 12:28
x4

Post by Sparky Sparkycorp » Mon, 15. Sep 14, 00:18

Wow, an unexpected and nice development :)

Fun-X
Posts: 184
Joined: Sun, 19. Jun 05, 06:34
x4

Post by Fun-X » Mon, 15. Sep 14, 19:59

I installed it on a clean LU vanilla 1.3.4. I deleted the !plugin.autotrade.* scripts stuff first.

Anyway it seems to work well. Thanks.

For others who are installing, if you want confirmation that it was actually installed, just load Trade Mk3 on a ship and start running it, it will put a message in the message log with the author being Raaaak with the current version number.

I did have an issue that when starting up a trader, it sometimes did not autojump to its new location, instead stating that it was trying to deliver energy cells. If I noticed that it was stuck, I would just manually jump to a starting sector and run ST again, and all was well.

Sorry, I did not have a save game.

Raaaak
Posts: 82
Joined: Fri, 29. Mar 13, 11:16
x3tc

Post by Raaaak » Mon, 15. Sep 14, 21:35

Does it have the order 'delivery - energy cells' or something like that?

Then it's not a bug but desired fall back behaviour. It tries to find a good power plant to refuel at, if it realizes it doesn't have enough jump fuel to get there it instead docks at the closest safe station and requests a delivery.
If you give it a while a NPC ship will dock at the same station and transfer jump fuel, at a price premium.

Seon
Posts: 210
Joined: Sun, 4. Feb 07, 00:22
x4

Post by Seon » Mon, 15. Sep 14, 23:29

I don't know if I did something wrong while installing this, or something else... I deleted all the files before installing this, but now my traders don't send a log message when I tell them to start ST/UTing... Everything else seems to be working fine right now, except for the log message.

Fun-X
Posts: 184
Joined: Sun, 19. Jun 05, 06:34
x4

Post by Fun-X » Tue, 16. Sep 14, 06:27

yes that is the message. But the weird part is that it had enough energy to make the jump...

Like I said, not a big deal. Just manual jump to destination and then run again....

Raaaak
Posts: 82
Joined: Fri, 29. Mar 13, 11:16
x3tc

Post by Raaaak » Tue, 16. Sep 14, 06:27

No need to worry Seon, it sounds like the script is working properly.
Traders only write a message to the log book the very first time they are started.

Raaaak
Posts: 82
Joined: Fri, 29. Mar 13, 11:16
x3tc

Post by Raaaak » Tue, 16. Sep 14, 20:53

Fun-X wrote:yes that is the message. But the weird part is that it had enough energy to make the jump...

Like I said, not a big deal. Just manual jump to destination and then run again....
Oh, I remember that bug now. It should be quite rare.
What happens is that the trader wants to refuel at a spp out of jump range, and docks at some local station to order fuel instead. If that station happens to be selling fuel it will refuel automatically without the script noticing.

You can either wait until the delivery is complete, leaving the ship with some extra e-cells, or order it to move manually.

Fixing it will have to wait until LU 1.3.5 where the script command to find a spp will stop ignoring any range limits I give it.

Fun-X
Posts: 184
Joined: Sun, 19. Jun 05, 06:34
x4

Post by Fun-X » Wed, 17. Sep 14, 01:30

ok cool.

User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube » Thu, 18. Sep 14, 19:04

Hey, Raaaak.

Just a thought:


If you want this script to be supported by an EI, you need to add two lines to the very top of the script.

Here's an example of the UT:

Code: Select all

$ScriptName = get script name
= [THIS]-> call script 'Lib.Gen.SetEIAutoStartParameters' : Args=null ScriptName=$ScriptName
The args parameter in that script is just an array of arguments.

another example found in the very beginning of deploy satellite:

Code: Select all

$ScriptName = get script name
$Args = create new fixed size array, size= 5, arguments= $SatelliteWare, $HomeSector, $Configuration, $MaxJumps, $RememberLastLocation, null, null, null
= [THIS]-> call script 'Lib.Gen.SetEIAutoStartParameters' : Args=$Args ScriptName=$ScriptName

Edit: I should clarify what I meant by "supported by EI". The part where EI goes and autostarts all your tasks, so after an EI, the user doesn't have to run his 100 UTs again.

Raaaak
Posts: 82
Joined: Fri, 29. Mar 13, 11:16
x3tc

Post by Raaaak » Thu, 18. Sep 14, 23:11

Thanks Litcube, I'll look into that after doing the more critical updates. Which will have to be tomorrow, because I'm too tired to continue today.

Raaaak
Posts: 82
Joined: Fri, 29. Mar 13, 11:16
x3tc

Post by Raaaak » Sun, 21. Sep 14, 23:07

Version 0.5.0 has been released

change log
* script commands updated for LU 1.3.5, traders now respect trade ranges without ugly work arounds
* LU bug in Lib.Cmd.Trade.GetStationBestPrice fixed
* Mid to High level traders are slighly better at finding good trades.
* Trade range 1 is available from the start, instead of being unlocked at level 6
* Minimum fuel level of 35 jumps removed, since traders now respect jump ranges.
* To avoid constant refuelling Sector Traders no longer jump.


Trade range 1 being available from the beginning will make decent training areas easier to find. But a single really good sector will still be better due to jumpdrive restrictions for low level traders.


This version has been thoroughly tested and should be stable, but there are a few things to watch for. Please tell me your experiences with the following:

* Traders fleeing from attackers, they are good enough at avoiding enemies that I have never had this happen in my tests.

* Jumping into pirate sectors. I've seen a UT jump into Spaceweed Grove, which was filled with pirates at the time.
Since it managed to travel across the sector twice without being attacked I suspect this is the LU sector security system not considering them a danger since they were not actively hostile to my trader.

Sparky Sparkycorp
Moderator (English)
Moderator (English)
Posts: 8074
Joined: Tue, 30. Mar 04, 12:28
x4

Post by Sparky Sparkycorp » Mon, 22. Sep 14, 00:27

Raaaak wrote:Version 0.5.0 has been released
Thanks :)
Raaaak wrote: I've seen a UT jump into Spaceweed Grove, which was filled with pirates at the time.
Since it managed to travel across the sector twice without being attacked I suspect this is the LU sector security system not considering them a danger since they were not actively hostile to my trader.
Did you see the posts by Falcrack? Might be of interest.

http://forum.egosoft.com/viewtopic.php? ... start=4530

Joelnh
Posts: 429
Joined: Wed, 3. Mar 10, 00:12
x3tc

Post by Joelnh » Mon, 22. Sep 14, 01:43

nice looking script.... will they also repair the ship if it gets damaged?

can you add a notification when a ST reaches 8th so they can be upgraded to UT?

Raaaak
Posts: 82
Joined: Fri, 29. Mar 13, 11:16
x3tc

Post by Raaaak » Mon, 22. Sep 14, 07:40

@Joelnh

Traders will not repair their ships, that could cost a lot of money you'd maybe rather spend somewhere else at the time. Instead they will dock at a shipyard and send you a message is heavily damaged, which is defined as <80% hull, 99% if max level IIRC.

A notification at level 8? Good idea, I'll put that in the next version.

Joelnh
Posts: 429
Joined: Wed, 3. Mar 10, 00:12
x3tc

Post by Joelnh » Mon, 22. Sep 14, 10:57

Raaaak wrote:@Joelnh

Traders will not repair their ships, that could cost a lot of money you'd maybe rather spend somewhere else at the time. Instead they will dock at a shipyard and send you a message is heavily damaged, which is defined as <80% hull, 99% if max level IIRC.

A notification at level 8? Good idea, I'll put that in the next version.
Excellent, that sounds better....ship repairs can cost alot.
having them dock allows you to track which pilots are being foolish....hehe

Sparky Sparkycorp
Moderator (English)
Moderator (English)
Posts: 8074
Joined: Tue, 30. Mar 04, 12:28
x4

Post by Sparky Sparkycorp » Mon, 22. Sep 14, 10:59

Sounds good to me too. I'd rather spend my time going to them to break out to repair laser than spend wodges of credits on the repair fees :)

Joelnh
Posts: 429
Joined: Wed, 3. Mar 10, 00:12
x3tc

Post by Joelnh » Mon, 22. Sep 14, 11:44

too bad you can't make the trader do the repairs, like a punishment.... in real life it would work, in a game... probably not so much.

unless, you can fine them if they damage the ship.... dock their wages.

will they sell any ware in the cargo hold?
for example, if you stop the ST trader to restart as UT. will he check his cargo and sell any wares.

Raaaak
Posts: 82
Joined: Fri, 29. Mar 13, 11:16
x3tc

Post by Raaaak » Tue, 23. Sep 14, 03:42

All wares in cargo bay and not installed or blacklisted are considered tradeable.

I did some extra testing and the traders were very good at avoiding pirates, as long as the pirates were actually hostile.

Post Reply

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