[SCR] [X3AP] Drone Mining and Trading System v1.2.2 [UPDATED 11/08/2014]

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

zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal » Sun, 2. Feb 14, 23:20

Unfortunately, I can't offer you any advice using the in-game script editor. X-Studio is the recommend method for editing scripts. You might just try changing it from COMMAND_X to the number 430.

so maybe:

Code: Select all

$key = 430
It might work and its much easier than trying to figure out how to look up a constant in MCSI. Thank you for letting me know about the issue, I'll document the incompatibility. Will consider a compatibility patch when Litcube's Universe gets a public beta/release.

Sinnerman49
Posts: 108
Joined: Thu, 20. Sep 07, 17:00
x3

Post by Sinnerman49 » Fri, 14. Feb 14, 06:52

Got it working by changing the command to [COMMAND_TYPE_TRADE_30]

However, Litcube's Universe doesn't include the Mobile Drilling System - what logic does the Drone Miner use to bust large asteroids? Will it use missiles?

I've set it up, and let it loose, but it doesn't seem to want to do anything with me IS, OOS it will move around and it's current order is:

Killing......
Asteroid

So I know it WANTS to get it ;)

zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal » Fri, 14. Feb 14, 20:35

My advice would be to not use the bust asteroids feature in Litcube's Universe until the issue can be sorted out. The script in question is plugin.zanzal.droneminer.bustroid, but I am not on the testing team for LU and don't have the time to join it at the moment.

I'll fix it shortly after LU gets a public release. Until then I recommend busting asteroids manually using missiles.

zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal » Sat, 15. Feb 14, 00:25

Version 1.1.1 is now available. It adds some gate avoidance logic to the Drone Miner. Also available as an optional download, the Freight Drone Production script. For those that might want to produce freight drones at their PHQ, the Freight Drone Production script will allow you to purchase the Blueprint for 1 million cr and it will convert the Freight Drones produced by the PHQ into a ware item so that you don't have to manually dock one onto a ship.

Zaknafein
Posts: 384
Joined: Thu, 31. Mar 11, 20:48
xr

Post by Zaknafein » Sat, 22. Mar 14, 23:05

its been 2,5 months since i posted here on page 1 and i now finally had time again to play a little albion prelude.
i want to thank you for this script, its even better than i imagined! the menu is so nice structured and reasonable coloured. i also like the huge grade of automatism you put in this script, its just config once and then "fire & forget".
i know i was the one who requested an option to reduce the numbers of freight drones: i had it running for like 3 minutes and then tested it with more and more drones and ended up to 60 freight- and 20 fightdrones. its just so nice to look at and really brings life into the sector.

so thats about it, just wanted to say thank you.



/edit oh i forgot, i found a lil "bug" : i play xrm and preinstalled the requirements before i started the script. i installed a "military grade" scanner (triplex scanner). when i started the script the tl went on to buy a "improved" scanner (duplex scanner). it didnt recognize the better one. not a biggie but still worth mentioning i think.

i also have a lil tipp for german players to make this script usable without readtext errors:
open the t-file ("8101-l044") and edit the third line "language id =" from 44 to 49. then rename it to 8101-l049
Ofc ***modified***, modders doing what Egosoft cant.

zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal » Sun, 23. Mar 14, 03:16

Thank you Zaknafein, I've posted an update to address the issues you've reported.

Zaknafein
Posts: 384
Joined: Thu, 31. Mar 11, 20:48
xr

Post by Zaknafein » Sun, 23. Mar 14, 18:35

you didnt change the <language id="44"> to 49 in the 49 t-file , still readtext errors in the updated version.

btw are there any others scripts coming from you? id like to see some more :)
Ofc ***modified***, modders doing what Egosoft cant.

zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal » Sun, 23. Mar 14, 19:22

Thanks for pointing that out. I have hotfixed it so that the current 1.1.2 should now work as intended. As far as other scripts and projects I am working on, I released the Ship Browser a while back.

I haven't had much interest in picking up X3 in the last month or so, but Roguey's X3AP mod may change that. Since his mod is brand new I am still waiting for it get some plots before I jump in. Once it does I'll probably pick up modding again.

Although I have some ideas for improvements for my mods, I am pretty much in bug fix mode until my interest returns.

hlking
Posts: 106
Joined: Sat, 19. Feb 11, 12:24
x4

Post by hlking » Sat, 26. Apr 14, 21:40

Hey dude, I just wanted to drop by and give you a HUGE thank you, and ask you a question.

I've been playing around with this script for a little while and it's amazing. This script makes a mining career viable and also a lot of fun, just like how I always wanted it to be! :)


Now for the question:

I've added a new "medium tier" ore to the game, to fill up the blank spot between Silicon and Nvidium ( in terms of profit ). I've managed to add the ore to some sectors, and it works just fine to manually mine it, but sadly your script does not recognize the ore and simply ignores it.

So, basically I was wondering if there's a way to modify your script to make it work with my new ore? I took a look at your scripts in the script editor, but it's way too advanced for me to be able to figure it out on my own.

Any advice would be much appreciated!



Either way, THANK YOU for this. It really made X3 so much more enjoyable!

zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal » Sun, 27. Apr 14, 22:51

Glad you liked it. The main issue you will encounter adding a new mineral is that the interface chooses what minerals are to be mined, so if you want to make your new mineral and have it work like the others then its a bunch of work writing menu code. Most of the changes you'll need to make are in plugin.zanzal.droneminer.menu.

At the top you will need to add new field things like:

Code: Select all

$IDX_CUSTOMMINERAL = 49         // Analogous to $IDX_ORE = 6
$IDX_CUSTOMMINERALCOUNT = 48
$IDX_CUSTOMMINERALSALES = 47
$IDX_CUSTOMMINERALSTOCK = 46
These are entries in $var[] which is a 50 element array. You might consider putting custom stuff at the end of the array to make it compatible with future versions of drone miner.

Then modify copious amounts of menu code to add your own stuff, for example anywhere you see $IDX_ORE or $ore.setting or $ore.stock* you'll need to include your version.

Most Important - At the very bottom of the script you'll see something like:

Code: Select all

skip if $ice.setting == 0
  append {Ice} to array $minerals
This is what tells the script what minerals are valid targets. You'll also want to look at:

plugin.zanzal.drone.*
plugin.zanzal.droneminer.*

For each script you'll want to check for $IDX_ORE, $IDX_ORESTOCK, $IDX_ORECOUNT, $IDX_ORESALES at the top of the script. If they are present then you'll need to make changes accordingly similar to how you did the menu.

I recommend using the X-Studio/X-Studio-2 to make these changes. The in-game script editor will take months.


Minimalist approach - you could in theory just force your mineral to be mined by adding a line by itself at the bottom of plugin.zanzal.droneminer.menu.xml:

Code: Select all

append {Customium} to array $minerals
Adding it to the end of the $minerals array will tell the script to mine that mineral. If you did that the script would include your mineral all of its mining operation. If you want to sell that mineral you'd need to modify plugin.zanzal.droneminer.trading.xml line 45 and insert:

Code: Select all

append {Customium} to array $all.minerals
{Customium} is just a silly placeholder for your new mineral type.

You might try the minimalist approach first and see where that gets you. If the script works well with just adding the mineral to the appropriate array then it might be worth making all the menu and sales/count tracking changes as well.

hlking
Posts: 106
Joined: Sat, 19. Feb 11, 12:24
x4

Post by hlking » Mon, 28. Apr 14, 17:55

Dude, thank you so much for taking your time to help me out, I really appreciate it!

I will try to modify the script tomorrow using your suggestions. I'm still very new to scripting ( still working on writing a simple script that will spawn my new asteroids ), but I will give the "minimalist approach" a spin first, and I'll see how it goes.

If it all goes well, I will then try to make the menu/sale part work, like you suggest.

I'll report back if I'm successful!

Thank you a lot once again! :)

hlking
Posts: 106
Joined: Sat, 19. Feb 11, 12:24
x4

Post by hlking » Fri, 2. May 14, 04:53

Alright, I think I've finally managed to get it to work. I've been playtesting for a day now and everything seems to be working just fine. Was quite the pain to do it though, since X-Studio gave me errors when I tried to save I had to do most of the stuff manually.

Either way, it works now and I'm really happy.

Thank you again for helping me out and for this awesome script, mate!

Coinkidoink
Posts: 6
Joined: Thu, 29. May 14, 20:30

Post by Coinkidoink » Thu, 29. May 14, 20:35

I'm a bit of a newbie still, and i'm having some issues trying to get this mod to do what i want it to do. Basically i have a TL Elephant running around mining and set to offload at a home base. This home base is a Split Trading Port that i have plonked down, however when it comes time to do the offloading part the script ends with a error on "returnhomefailed".

Is this because the TL apparently can't dock there? I just assumed it would send drones to offload. If so, is the only option i have the PHQ? I'm not really near any sort of situation where i can get that setup where i want.

zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal » Sat, 31. May 14, 04:55

Thank you for reporting that. The unload concept was originally intended to allow you to use the TL to gather materials for a factory or PHQ, but even then you need a mod for the factory hub in order for TLs to dock at them.

I never thought anyone would assign a TL to a home base that didn't have a capital ship docking port to it so there is no logic to unload minerals using drones. Looking at the script it wouldn't be difficult to expand the logic to support that situation, but I don't really have the time to implement and debug it right now. I'll play around with it tonight to see if it is trivial and if it is then I may go ahead and implement something.

zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal » Sat, 31. May 14, 06:12

I've got a beta version you can try if you want to be a beta tester. Keep in mind, that this version could break your game. I don't think it will, but don't overwrite your saves until you know for sure it is working fine. You may also want to back up your saves just in case.

Download Link: <removed>

NOTE: If you don't need this feature don't download this - wait for tested version. Thank you.

EDIT: Removed download link due stability issues.
Last edited by zanzal on Sun, 1. Jun 14, 10:54, edited 1 time in total.

Coinkidoink
Posts: 6
Joined: Thu, 29. May 14, 20:30

Post by Coinkidoink » Sat, 31. May 14, 14:06

Sure, i'll see how it works :)

Coinkidoink
Posts: 6
Joined: Thu, 29. May 14, 20:30

Post by Coinkidoink » Sat, 31. May 14, 15:20

With the same scenario as before, the elephant TL and the split trading post. The TL now moves towards the station when it's full, but the game crashes as it gets somewhat close to it, maybe when it decides to launch freight drones? It does not actually get to launch any tho before the game crashes as far as i can tell.

zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal » Sun, 1. Jun 14, 10:57

Thank you for taking the time to test it and report back. I am afraid I can't locate the source of the crash. Since I do not have the time to properly debug it, I am going to have to suggest not using Drone Miners with a homebase that doesn't have a capital docking port. I'll put a note on the description page so that others can avoid this problem. I also recommend going back to version 1.1.2 if you have not already.

I will address this issue in the 1.1.3 release though when I have the chance to properly test everything.

Coinkidoink
Posts: 6
Joined: Thu, 29. May 14, 20:30

Post by Coinkidoink » Sun, 1. Jun 14, 14:33

That's fine! The reason i tried to homebase them this early in the game was because they kept blundering into the warzones and getting blown up by the Terrans. Maybe you could look into a blacklisting of sectors instead if that's easier for 1.1.3?

I'll keep them as traders for now and babysit them/issue glorious revenge on their killers until i'm ready for the PHQ, thanks for the great mod :)

Nemesis_87
Posts: 730
Joined: Sat, 19. Mar 11, 16:26
x3tc

Post by Nemesis_87 » Fri, 15. Aug 14, 23:21

Looks interesting and will try it when i get a chance, have a question though

I play XRM as a terran, So can i change the settings to buy fighter drones to 0? Or can i set it to go buy keris drones instead?

Thanks

Post Reply

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