[SCR] OK Traders v1.7.1 (04-12-14)

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

Post Reply
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod » Mon, 20. May 13, 01:20

I've uploaded version 1.1.0:

1.1.0
- Change the OK trade command ID from 42 to 48 to resolve a conflict. Note that following upgrade from 1.0.0 existing OK traders will temporarily show "Unknown command!" until their current action completes and the scripts restart.
- Automatically enable autojump and set min jumps to 0 when starting the OK trade command.
- Detect danger and return to homebase. Display subtitle messages when a trader detects danger.
- Reroute to new destination if current trade mission is invalidated, for example if destination ware price becomes unacceptable with respect to homebase selling price
- Buy wares without first returning to homebase if ship has sufficient jump energy to get there and home again, or if the ship isn't jump capable
- Add a minimum stock level percentage trade threshold with default of 10% (sell when above 10% stock, buy when below 90% stock).
- Improve displyed command action details
- Fix amount of ware on order calculation to include amount in cargobay

User avatar
joelR
Posts: 2008
Joined: Mon, 9. Jul 07, 23:33
x3tc

Post by joelR » Mon, 20. May 13, 05:16

Shimrod wrote: - Buy wares without first returning to homebase if ship has sufficient jump energy to get there and home again, or if the ship isn't jump capable
Thanks for this.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Mon, 20. May 13, 06:03

This script is a breath of fresh air, Shimrod. :)

I have been using OK Traders for a few days to replace CAG for a complex, and they do the job nicely. Much easier to understand and set up than CAG; just turn them on, follow the easy menu, and start them up.

Nice.


* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
One thing I noticed: After I start an OK Trader, his orders are no longer visible. If I return to his settings menu, the defaults automatically populate rather than his current orders. It would be nice to be able to see his current orders so that I can check, then cancel, to make sure that I set it correctly.
Last edited by DrBullwinkle on Mon, 20. May 13, 10:43, edited 1 time in total.

Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod » Mon, 20. May 13, 10:40

Sure, if the command is already running on a ship, it'd be straightforward enough to populate the menu selections from the ware entry list already stored in the trader's local variable.

It's quite difficult to test new features and regression test the old ones in this script as they're pretty situational. Unlike Smart for example where I can simply spawn an enemy of the right type for it to shoot, or a quite easily set up a fleet vs fleet battle to monitor. I've had traders flying around with 500 engine tunings on SETA, and to test enemy avoidance I moved the ship into the heart of a Xenon sector and started the command.

However nothing beats real usage so I plan to continue my XTC game with 1.1.0 loaded for a while before working on feature enhancements to help flush out potential problems, though if I do fix any bugs I'll try to roll out patch releases quickly. At the same time if you notice anything weird do let me know about it.

Vayde
Posts: 849
Joined: Fri, 6. Feb 04, 21:02
x3tc

Post by Vayde » Mon, 20. May 13, 21:59

I'll give the new version a few credits and a station or two and see how it ticks :)
Still life in the old dog yet...

Revolution Rising
Posts: 57
Joined: Sun, 29. Jul 12, 00:19
x4

Post by Revolution Rising » Tue, 21. May 13, 01:15

I LOVE this script, I am kinda new at the game and CAG had me about to throw it out the window. This script saved the whole deal ;) It's a lot more newb friendly.

I wonder how hard it is to make a script to have ships automatically equip themselves from stations, instead of having to look at every single sector looking for guns, shields etc..

I've been using Mistrals and Mistal SF's but finding the 25MJ shields and PRG's is hard in Boron space - usually need 5 for a Mistral and 4 for a SF. Most of the time there's only 3-4 on a station if I'm lucky. :!:

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Tue, 21. May 13, 01:40

Revolution Rising wrote:I wonder how hard it is to make a script to have ships automatically equip themselves from stations, instead of having to look at every single sector looking for guns, shields etc..
Player Workshops or Yalamandis Shipyard

Revolution Rising
Posts: 57
Joined: Sun, 29. Jul 12, 00:19
x4

Post by Revolution Rising » Tue, 21. May 13, 02:17

Auto Repair ? :)

Edit: Actually I found Marine Repair, seems to be being updated as of last month, so will give that a go. Automating ships, but having them hit other ships and not automatically repair is rather annoying.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Tue, 21. May 13, 05:53

As you discovered, Marine Repairs and Training is a big help.

There is no general-purpose auto-repair, although many scripts include auto-repair of some sort. Off the top of my head, that includes: (There are probably others that I forgot to include.)
.

PS: We should probably move this Q&A elsewhere, and let Shimrod have his thread back!

Revolution Rising
Posts: 57
Joined: Sun, 29. Jul 12, 00:19
x4

Post by Revolution Rising » Tue, 21. May 13, 06:16

DrBullwinkle wrote: PS: We should probably move this Q&A elsewhere, and let Shimrod have his thread back!
Thanks for the info.

Yeah I realised that after my last post (sorry Shimrod), the reason I put it here however was the OK Traders were getting damaged (about 1 per day real time) so figured he might include some form of it ;)

Thanks for the Post Vayde too good info.

Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod » Tue, 21. May 13, 23:03

Repairs and equipping (shields, tunings, jumpdrive) are certainly something I'd consider in future though it's not an immediate priority.

Note that in 1.1.0 the trader will detect incoming hostiles within its max scan range and move to homebase, so assuming it has a jumpdrive, energy and not already in home sector, it should jump away before taking any damage.

So far in my game I've not had any casualties, and the warning subtitle message displays the sector name so I know which sector to blacklist or clean out if it recurs.

johntarmac
Posts: 393
Joined: Fri, 5. Mar 04, 19:47
x3tc

Post by johntarmac » Sat, 25. May 13, 12:02

Just started using this to free up my CAGs for CLS duties and it's working very well.

Cheers

Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod » Sun, 2. Jun 13, 14:37

I've uploaded a new version. The main feature is they can now operate as free traders. The free trader balance of profit or loss since the command was started is displayed in the menu. Note that when it buys its first wares/energy it will start out in the red.

There is no micromanagement involved. To make a free trader, start the command on a ship without a homebase. To make a station trader, assign a homebase then start the command.

1.2.0
- OK Trade can now be enabled on ships without homebases. They act as free traders and roam the galaxy in search of profit.
- When a ship is already running the command, the trade menu will display the ships's current settings or profit/loss so far in the case of a free trader.

Edit: Thought I'd found a problem...
Update: It turned out the homebase just had no money :doh: , everything is ok!
Last edited by Shimrod on Sun, 2. Jun 13, 17:28, edited 4 times in total.

User avatar
joelR
Posts: 2008
Joined: Mon, 9. Jul 07, 23:33
x3tc

Post by joelR » Sun, 2. Jun 13, 16:29

Thanks shimrod. Great addition.

What happens if I homebase a free trader after issuing the command?

Mythrantar
Posts: 173
Joined: Fri, 17. Jun 05, 06:35
xr

Post by Mythrantar » Sun, 2. Jun 13, 16:38

Thanks for the great mod! Maybe a silly question but here it is anyway: what makes an non-homebased OK Trader a better choice than a classic sector trader or a universe trader?

Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod » Sun, 2. Jun 13, 16:41

The script's sanity check should terminate the command if a homebase is assigned to a free trader, or a homebase is cleared on a homebased trader. If the ship is performing a blocking action though it might not immediately realize this.
Thanks for the great mod! Maybe a silly question but here it is anyway: what makes an non-homebased OK Trader a better choice than a classic sector trader or a universe trader?
The goal with OK Traders is for it to work without any micromanagement, levelling, training, and perform at their best right out of the box. I don't use UT and CAG for these reasons.

There is no common code between OK Traders and CAG/UT, so they'll also react differently to threats and changing trading conditions. I haven't made a side by side feature comparison, no doubt CAG/UT have more options.
Last edited by Shimrod on Sun, 2. Jun 13, 17:22, edited 1 time in total.

User avatar
vukica
Posts: 1744
Joined: Sun, 10. Aug 08, 18:05
x4

Post by vukica » Sun, 2. Jun 13, 17:17

Shimrod wrote:The script's sanity check should terminate the command if a homebase is assigned to a free trader, or a homebase is cleared on a homebased trader. If the ship is performing a blocking action though it might not immediately realize this.

On AP I'm finding the 'buy x units of y' command isn't working for homebased traders when they buy ore, for no apparent reason. I'm experimenting with using the 'buy x units of y to a max. price of z cr' cmd as an alternative, as this is used in !trade.getware. Hopefully will cure it... Nope, didn't cure it.

Edit: I was just being an eejot. The homebase had no money!
Thanks for the great mod! Maybe a silly question but here it is anyway: what makes an non-homebased OK Trader a better choice than a classic sector trader or a universe trader?
so it is working now?

The goal with OK Traders is for it to work without any micromanagement, levelling, training, and perform at their best right out of the box. I don't use UT and CAG for these reasons.

There is no common code between OK Traders and CAG/UT, so they'll also react differently to threats and changing trading conditions. I haven't made a side by side feature comparison, no doubt CAG/UT have more options.
Split say NEED MORE FIREPOWER!!

Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod » Sun, 2. Jun 13, 17:19

Yes, it's fine, I just forgot to add money to the homebase station when I spawned the test environment. There's no known problem with 1.2, though if any problems manifest be sure to let me know and I'll fix.

User avatar
vukica
Posts: 1744
Joined: Sun, 10. Aug 08, 18:05
x4

Post by vukica » Sun, 2. Jun 13, 19:06

Shimrod wrote:Yes, it's fine, I just forgot to add money to the homebase station when I spawned the test environment. There's no known problem with 1.2, though if any problems manifest be sure to let me know and I'll fix.
ok, thanks!
Split say NEED MORE FIREPOWER!!

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Sun, 2. Jun 13, 23:28

Shimrod wrote:- When a ship is already running the command, the trade menu will display the ships's current settings or profit/loss so far in the case of a free trader.
Nice. Thank you.
  • Minor note: When I updated my v1.1 OK Traders to v1.2, their previous "No Trade" orders changed to "Sell". However, after I reset them, their orders seem to "stick".

Post Reply

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