[Script][Mar/17/2009] Transfer Freight via Drones - working

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

Tim-O
Posts: 182
Joined: Thu, 15. Dec 05, 22:02
x3tc

[Script][Mar/17/2009] Transfer Freight via Drones - working

Post by Tim-O » Mon, 9. Mar 09, 14:26

Transfer Freight via Drones v beta.07

[ external image ]

This script allows the working transfer of freight via drones.

I've discontinued the development of this script, but I've uploaded it to GitHub to make it easier for others to continue working on it. You can find the GitHub project here: https://github.com/merlinthered/plugin. ... e.transfer

The command is located in the trade commands and differs from the EGO script by its yellow color.

Usage is equal to the EGOSOFT script. However, the behaviour is a little different.


Description:
This command allows you to transfer freight to and from a station or ship over large distances. Intergalactic Trade Software Standards now make it possible for the drones to trade with foreign stations. Due to their size freight drones can only be used by big ships.

Requirements:
Ship of class big ship (except M8) - Using drones on a ship that is smaller than the drone makes no sense...
Trade Command Software Mk2
Freight Drone

Installation:
Copy the contents of the "t" folder into the X3 TC\t folder
Copy the contents of the "scripts" folder into the X3 TC\scripts folder
If ChemODur's string library is already installed, the t files of it can be overwritten with the ones contained in this package. They contain minor fixes for german letters.

Deinstallation:
Cancel all running transfers (collect the drones or give them another command)
Save
Quit X3 and remove the scripts' files from the "scripts" folder (see "Used Files")
Remove the language file from the "t" folder (see "Used Files")

Behaviour:
If more wares than a single drone can carry are selected more drones are used and the selected wares are distributed between them.
A drone loads as much selected ware as possible from the starting ship and moves to its destination. Then it unloads the wares. If the target doesn't have enough free cargo space the drone waits until more space is available. When it's empty it starts loading the wares to transport back from the destination. If the target doesn't have enough of them the drone waits until the stock is refilled! That's why the target's stock is not regarded when selecting the wares to transport back from the destination.
When the selected amount of wares has been loaded the drone starts back to it's starting ship. Then it starts unloading the wares and follows the starting ship within transporter range until everything has been unloaded. If there is not enough space in the starting ship's cargo bay the drone waits until more space is cleared. Then it flies to the ship to be collected. This now happens automatically. M2 owners now no longer have to collect the drones manually.

Screen Shots:
Usage of the script is practically identical to the original script by EGOSOFT. First select the target of the transfer. Then set up the list of wares to transport to and back from the target. "Start Transfer" starts the drones. The screen shots should be pretty self explanatory. If not, try the script or ask here.

[ external image ] [ external image ] [ external image ]

Known Problems:
It's possible that the drones don't transport all wares that have been selected. This is due to the fact that while selecting the wares it is ignored that they have to be distibuted between multiple drones.
E.g. if you have three drones, they have a total cargo bay of 2400 units. If you want to transport 4 units of a ware with a volume of 600, selecting these is no problem in the UI, because 4*600 fits exactly into the 2400 cargo bay of the drones. However, only 3 of them can be transported, because a drone can hold only one of them at a time and the remaining one can not be split to be transported partly in different drones. If something like this happens, the script will not alert you that some of the selected wares could not be transported. A little thinking is needed here ;)
#This case has not yet been tested properly

[ external image ] Download as zip via GitHub
[ external image ] Mirror kindly provided by Mastersouleater

Used Files:

t\8222-L044.xml
t\8222-L049.xml
t\8910-L007.xml <-------String Library by ChemODur!! http://forum.egosoft.com/viewtopic.php?t=233377
t\8910-L044.xml <-------String Library by ChemODur!! http://forum.egosoft.com/viewtopic.php?t=233377
t\8910-L049.xml <-------String Library by ChemODur!! http://forum.egosoft.com/viewtopic.php?t=233377

scripts\lib.chem.strings.xml <-------String Library by ChemODur!! http://forum.egosoft.com/viewtopic.php?t=233377
scripts\plugin.freight.drone.delivery.xml
scripts\plugin.freight.drone.gui.xml
scripts\setup.freight.drone.move.xml
scripts\plugin.freight.drone.target.xml
scripts\plugin.freight.drone.transfer.xml
scripts\plugin.freight.drone.wares.xml
scripts\setup.freight.drone.transfer.xml

Used Resources:

Command Slot
COMMAND_TYPE_TRADE_22 (422) ->"COMMAND_DRONE_WARE_EXCHANGE"

Language Files
8222-L044.xml (page id=8222)
8222-L049.xml (page id=8222)
8910-L007.xml (page id=8910) <-------String Library by ChemODur!! http://forum.egosoft.com/viewtopic.php?t=233377
8910-L044.xml (page id=8910) <-------String Library by ChemODur!! http://forum.egosoft.com/viewtopic.php?t=233377
8910-L049.xml (page id=8910) <-------String Library by ChemODur!! http://forum.egosoft.com/viewtopic.php?t=233377
Last edited by Tim-O on Sun, 9. Dec 12, 20:36, edited 13 times in total.

Tim-O
Posts: 182
Joined: Thu, 15. Dec 05, 22:02
x3tc

Post by Tim-O » Mon, 9. Mar 09, 19:42

Changelog:

2009-03-17: v beta 07

- Executing the command no longer terminates any other commands on the ship.

- In the ware selection menu the current stock, transport class and volume of each ware is now displayed

- Used ChemODurs String Library for formatting.

2009-03-13: v beta 06

- Freight drones no longer load installed wares.

2009-03-13: v beta 05

- The script version is now displayed in the upper right corner of the main transfer window. (Yes, I'm bored...)

2009-03-11: v beta 04

- When the drone is sent to buy wares at a foreign station it now waits until the player has enough money instead of loading all the wares and only paying as much as the player can afford.


2009-03-09: v beta 03

Initial English Release
Last edited by Tim-O on Tue, 17. Mar 09, 16:30, edited 2 times in total.

semiliterate
Posts: 357
Joined: Sat, 13. Dec 08, 22:02

Post by semiliterate » Fri, 13. Mar 09, 13:28

no matter what number i give my Mammoth, it refuses to send a more than a single drone to my ore mine to fetch ore. it also, um, took 100 ore back and may have eaten the ore that should have been assigned to other drones.

Tim-O
Posts: 182
Joined: Thu, 15. Dec 05, 22:02
x3tc

Post by Tim-O » Fri, 13. Mar 09, 15:19

This sounds exactly like the behaviour of the original egosoft script. I thought I had these problems fixed with my script. Are you really sure you used my script and not the Ego one? (My script should be the one with the yellow command text). If the problem really occurs with my script then please tell me more about what freight your Mammoth carries, what is in the cargo bay of the mine and how many drones you have on board.


2009-03-13: v beta 06 released

- Freight drones no longer load installed wares.

semiliterate
Posts: 357
Joined: Sat, 13. Dec 08, 22:02

Post by semiliterate » Fri, 13. Mar 09, 16:47

um woops

the directory structure it was in threw me off and i ended up unzipping the scripts to the wrong place. it's here now!

Tim-O
Posts: 182
Joined: Thu, 15. Dec 05, 22:02
x3tc

Post by Tim-O » Tue, 17. Mar 09, 16:30

2009-03-17: v beta 07

- Executing the command no longer terminates any other commands on the ship.

- In the ware selection menu the current stock, transport class and volume of each ware is now displayed

- Used ChemODurs String Library for formatting.

semiliterate
Posts: 357
Joined: Sat, 13. Dec 08, 22:02

Post by semiliterate » Tue, 17. Mar 09, 23:01

not sure if it's something odd happening to my RAR, but the very bottom line (<t id=130...) was missing from the L044 file, causing all wares to show up with a readtext. i just stuck the line from the other language file in and it works fine.

Tim-O
Posts: 182
Joined: Thu, 15. Dec 05, 22:02
x3tc

Post by Tim-O » Wed, 18. Mar 09, 11:42

I just downloaded the file from mediafire and extracted it. The 130 line is there in both language files. Try re-downloading to make sure everything is ok.

semiliterate
Posts: 357
Joined: Sat, 13. Dec 08, 22:02

Post by semiliterate » Wed, 18. Mar 09, 12:53

my word i am stupid.

that was the original version.

okay now this one might actually be a real thing. okay, the freight drones wait for stock to reach proper levels - but what happens when they run out of energy? any chance of an auto-recall, refresh drone? i'm trying to get a freight drone to empty my flail missile complex, you see, and i have no idea what happens if i let it sit there til it runs out of energy.

Tim-O
Posts: 182
Joined: Thu, 15. Dec 05, 22:02
x3tc

Post by Tim-O » Wed, 18. Mar 09, 19:03

If a freight drone runs out of energy, it blows up. There is no way to prevent this. I also think you can't check the current energy level by script. Honestly, I don't intend to make them much more intelligent than they are.
I could eliminate all the waiting and make the drone just take what is there and return. But then again: what happens if the drone can't unload its wares? Just let them in the cargo bay and live with the smaller space for the way back? Destroy them? I don't think that's an option.
In the end, they are just drones. If you want them to do their job, you have to do a little bit of thinking yourself. Make sure everything is there and there is enough cargo space free and you'll be fine. I think the added display of current stock and vol/tc helps a bit there.

By the way: Drones are not the real good way to keep a missile complex empty. Try this script:
http://forum.egosoft.com/viewtopic.php?t=239414 ;)
It lets you use freighters to extend the storage space of the complex. If you want to load your M7M with new missiles just undock one of the extension freighters and transfer the missiles from there to the missile frigate (via Drones if you want). That way you don't have to initiate another drone transfer every other minute.

semiliterate
Posts: 357
Joined: Sat, 13. Dec 08, 22:02

Post by semiliterate » Wed, 18. Mar 09, 22:40

Tim-O wrote:If a freight drone runs out of energy, it blows up. There is no way to prevent this. I also think you can't check the current energy level by script. Honestly, I don't intend to make them much more intelligent than they are.
you can fake it using the known total flight time. it's mainly so that there is an easy way to, well, get a drone to sit there and empty the fab til it's nearly out of energy. but yeah, fair point.

By the way: Drones are not the real good way to keep a missile complex empty. Try this script:
http://forum.egosoft.com/viewtopic.php?t=239414 ;)[/quote]

ah, see - for one thing, my game is already buggy which makes me wary of things saying beta, and for another, i also want the missiles on my TL because it's a resupply ship - it just seemed like a smarter freight drone transfer was in the remit of this script and would be more appropriate for my needs. apart from anything else, i'm down to about thirty thousand credits after building the complex...

but fair dos, i'll give it a try.

Tim-O
Posts: 182
Joined: Thu, 15. Dec 05, 22:02
x3tc

Post by Tim-O » Thu, 19. Mar 09, 15:46

Before I had written the Storage Extension I also used to store my missiles on a TL. I set the TL as homebase for some fighters and gave them the order to buy the wares from the complex. I entered a ridiculously high number when asked for the number of repeats. The fighters then shuttled between the TL and the complex and took the missiles back with them if there were any.

kdalts
Posts: 105
Joined: Fri, 12. Dec 08, 15:38

Post by kdalts » Thu, 7. May 09, 13:41

Well I tried the script.

It send all my drones, collects wares, returns to destination - great. BUT - then the drones just sit back in the frieght bay despite being requested to colled 4,000 units.

So, better than the xtc version - at least the drones collect and return... just need them to fullfill the original order

Tim-O
Posts: 182
Joined: Thu, 15. Dec 05, 22:02
x3tc

Post by Tim-O » Wed, 13. May 09, 10:35

You mean you want them to fly back and get the rest if they couldn't get it all the first time? I let that out because if they didn't get it the first time it is likely that it will take some time until the ware is available again. Drones don't have much power and I wanted to avoid drones exploding while waiting for their freight. Or did I get you wrong and you meant something different?

User avatar
Vandragorax
Posts: 1183
Joined: Fri, 13. Feb 04, 04:25
x4

Post by Vandragorax » Sat, 8. Aug 09, 01:38

I didn't see anyone thank you for this yet, so I just want to say thank you SO much for this script! I seriously mean it!

I was at the point of giving up playing when I had finally saved up and bought my first "capital" ship (a TL for starting up my economy properly) and then I bought a few TS's for cargo loading/unloading only to find out that THEY CAN'T FRIGGIN DOCK?!?!!

"what the hell?!... OK" I thought... "I'll just get some of those new cool looking Freight Drones, they sound like they'll do just the perfect job for my larger ships!"

So off I go and buy a load of Freight Drones, only to find out... THEY CAN ONLY TRANSFER FROM MY OWN STATIONS AND OTHER CAPITAL SHIPS?!?!?! *headdesk* Yes at this point, I was literally banging my head on the desk trying to figure out how the hell Egosoft could be so stupid, and how the hell I was going to make this game fun again faced with the prospect of having freaking stupid TS ships jumping around everywhere behind my capital ships just to bloody reload/refuel/rearm them - or have fleets of M3s for transferring cargo (yeah right! lol). All I wanted was to have my Freight Drones act like cargo runners for my large ship - including to/from NPC stations and what-not!

Then I found this... and all my prayers about how the Freight Drones SHOULD work have been answered! So once again, THANK YOU SO MUCH! This was so quick and easy to install, and works like a dream! I am forever in your debt of allowing me to continue with this game with no more frustrations regarding my capital ships! Big, big kudos to you Tim-O! Sorry for this wall of text, but man you needed to get some thanks for this! :¬D

User avatar
Jaga_Telesin
Posts: 435
Joined: Sat, 16. Sep 06, 22:48
x4

Post by Jaga_Telesin » Tue, 25. Aug 09, 21:10

Then it flies to the ship to be collected. This now happens automatically. M2 owners now no longer have to collect the drones manually.
My freight drones are having problems with this particular step - they never dock back at the ship they launched from. They'll fly to within transporter range and unload, but then sit there with empty freight (1 shield only, installed), and not move.

Great script, I'd consider it essential to gameplay.. if I could get it working 100%. :)

Edit: I think I found the bug not allowing this to complete. If you move the ship that the drone is following/transferring to outside of transporter range, it breaks the current action, and the drone simply reverts to "follow" mode. It will never dock correctly. I just tested with two drones, and for the second one my ship didn't move at all. The drone unloaded and docked correctly. Sounds like some error checking is needed in that routine is all. Otherwise, excellent script.

User avatar
Jaga_Telesin
Posts: 435
Joined: Sat, 16. Sep 06, 22:48
x4

Post by Jaga_Telesin » Tue, 25. Aug 09, 21:24

Found another bug just now, separate post so it can be referenced separately..

When the ship sending out a freight drone is within a short distance of the factory the drone is visiting, the drone will dock, load wares, undock, transfer to main ship, and then sit there like in the first bug I found. It never tries to dock with it's main ship.

Note: I'm using a Split Panther for this testing, which being a M7 should be big enough not to have any size or class issues for the script.

User avatar
Robert Foster
Posts: 562
Joined: Wed, 2. May 07, 15:59
x3

Post by Robert Foster » Wed, 16. Dec 09, 20:33

I am going to try this.
This is something I am looking for.
I hope it works ;)

Question though., If I suddenly get into a dog fight with the enemies,
Will these drones stay put docked within my ship I am piloting.?

I do not want them to all of a sudden fly out and start fighting.
because then I will have more problems than I really want.
I Am Currently Playing ( TRANSCEND-II )
I am a Asteroid Miner and I love to Mine - Brine, Nividium, Oil, Tellurium, Plutonium, Tridium, Metal, Tritanium and Gallium Crystals.
Proud owner of Protools|HD3 system.

Tim-O
Posts: 182
Joined: Thu, 15. Dec 05, 22:02
x3tc

Post by Tim-O » Sun, 31. Jan 10, 11:23

Sorry for answering so late. I haven't been playing the game for about half a year now. And as a result I didn't check the forums any more. I don't know if I will have time to fix the bugs in the near future but thank you for pointing them out.
Jaga_Telesin wrote:
Then it flies to the ship to be collected. This now happens automatically. M2 owners now no longer have to collect the drones manually.
My freight drones are having problems with this particular step - they never dock back at the ship they launched from. They'll fly to within transporter range and unload, but then sit there with empty freight (1 shield only, installed), and not move.

Great script, I'd consider it essential to gameplay.. if I could get it working 100%. :)

Edit: I think I found the bug not allowing this to complete. If you move the ship that the drone is following/transferring to outside of transporter range, it breaks the current action, and the drone simply reverts to "follow" mode. It will never dock correctly. I just tested with two drones, and for the second one my ship didn't move at all. The drone unloaded and docked correctly. Sounds like some error checking is needed in that routine is all. Otherwise, excellent script.
I had this problem, too. But the reason was this: The drone unloaded its cargo into the ship, which then didn't have enough space left to fit the drone itself into. When I unloaded some wares, the drone docked. Perhaps you checked this already, but you never know... ;)
Jaga_Telesin wrote:Found another bug just now, separate post so it can be referenced separately..

When the ship sending out a freight drone is within a short distance of the factory the drone is visiting, the drone will dock, load wares, undock, transfer to main ship, and then sit there like in the first bug I found. It never tries to dock with it's main ship.

Note: I'm using a Split Panther for this testing, which being a M7 should be big enough not to have any size or class issues for the script.
Perhaps the reason is the same? I normally use the drones on other ships while I'm not in the sector. In these cases I let the ship fly exactly to the location of the factory (-hub) and the issue the drone command. In these cases, everything works fine.
Robert Foster wrote:I am going to try this.
This is something I am looking for.
I hope it works

Question though., If I suddenly get into a dog fight with the enemies,
Will these drones stay put docked within my ship I am piloting.?

I do not want them to all of a sudden fly out and start fighting.
because then I will have more problems than I really want.
The script has no effect on the behaviour of your drones while they are docked. When they are, they are another ware in your cargo hold behaving exactly in the way Egosoft intended. That means, they won't start fighting because they aren't fighting drones. But this doesn't have anything to do with my script ;)
BlackDemon wrote:I didn't see anyone thank you for this yet, so I just want to say thank you SO much for this script! I seriously mean it!
Thank You, man. I really appreciate that!

california3201
Posts: 22
Joined: Thu, 19. Nov 09, 00:44
x4

Just what I need

Post by california3201 » Sun, 14. Mar 10, 23:53

Were is the download button

Post Reply

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