[SCRIPT] Salvage Extension Commands v1.2 (02/07/2007)

The place to discuss scripting and game modifications for X³: Reunion.

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

voxol
Posts: 429
Joined: Sun, 30. Oct 05, 14:42
x3

[SCRIPT] Salvage Extension Commands v1.2 (02/07/2007)

Post by voxol »

Salvage Extension Commands
By Voxol.

Requirements:
- Cycrow's Salvage Claim Software - Available at Teladi Equipment Docks
- Bonus Pack (MTC: Manual Trade Commands)

Recommended:
- Bail Signal Extension - increase probability of ships bailing and allow big ships to bail.


--Download--


This plugin provides 3 new commands in your Piracy menu to help automate piracy and salvage operations. This was originally developed to aid in processing the extra capping opportunities afforded by Bail Signal Extension, but is likely useful for anyone wanting a career as a pirate.

Thanks to moggy2 (Xai Corp) for the MTC commands and libs used here.


[Strip Ship of All Wares...]
Utility command. Orders a ship to transport aboard all wares from a target ship. Useful for manually stripping newly capped ships before selling them.


[Best Sell Loot from Homebase...]
This command will order a ship to continuously sell wares, if possible, from its homebase ship. Equipment is not traded, and priority is given to wares using the most cargo space on the homebase. Jumpdrive can be used if the homebase has enough Energy Cells.


[Automated Salvaging]
The crux of this command-set. This will order a ship to continuously and automatically salvage ships, collect astronauts, and/or collect flying wares, depending on the ships loadout, within the sector. The ship can operate alone or from a homebase ship, dumping wares at the homebase as it gets full. Jumpdrive can be used to travel between homebase and operating sector if the homebase has enough Energy Cells available.


:!: There are several different behaviours depending on the way ships are equipped. Please refer to the readme for details.



Readme follows:

Code: Select all

===========================================
Name:		Salvage Extension Commands
Version:	V1.2
Author:		Voxol
Updated:	02/07/2007
===========================================

Requirements:  
- Cycrow's Salvage Claim Software.
- Bonus Pack (MTC: Manual Trade Commands)

Recommended:
- Bail Signal Extension


This plugin provides 3 new commands in the Piracy menu to help automate your piracy empire.  Originally developed to support the increase in capping opportunities provided by Bail Signal Extension, this plugin may have use in other situations.


---------------------------------------------
[Strip Ship of All Wares...]

Requirements: Transporter Device.

This command will order your ship to get within transporter range of another of your ships, then transport across all wares from the target ship, including equipment and any tech wares not currently installed on the host ship.  This is useful to strip a recently capped ship of useful/profitable wares before sending it to be scrapped.


---------------------------------------------
[Best Sell Loot from Homebase...]

Requirements: Best Selling Price Locator, Trading System Extension, Trade Command Software MK1, Transporter Device.

This command orders a ship to sell wares located on its homebase ship, using the Manual Trade Commands Best Sell feature.  

- Requires a homebase to be set, and requires that the homebase be a ship.  Thus, huge ships cannot use this command.
- Priority is given to the ware using up the most space on the homebase.
- Weapons, shields and missiles are not sold.  You will have to sell these yourself, or keep them for equipping your fleet.
- The ship will attempt to keep a supply of Energy Cells if it has a Jumpdrive and 'Navigation Command Software MK1' installed.  In order to store some Energy Cells without selling them, it may convert some to 'Container' wares.  No refueling takes place if the homebase has less than 500 Energy Cells left for itself.
- Energy Cells will only be traded if there is more than 2000 of them on the homebase.
- The ship will follow the homebase while idle waiting for new wares to be loaded or a suitable location to sell existing wares.
- If the ship cannot sell all of its wares it will attempt to transfer them back to the homebase.  If transfer fails the command exits.


---------------------------------------------
[Automated Salvaging]

Requirements: Special Command Software MK1.

This command automates a ships salvage operations within a sector, with the type of salvage operations carried out dependent on the ships loadout.  

In order of priority, the plugin will:  claim ships, enslave astronauts, collect flying wares.

Claiming ships requires: 
- Salvage Claim Software OR System Override Software (can only claim small ships).

Enslaving astronauts requires: 
- Transporter Device
- Cargo Bay Lifesupport.

Collecting wares requires: 
- Transporter Device
- Trading System Extension.


In addition...

When claiming ships: 
- If the host ship has a ship set as homebase, then the newly claimed ship will be ordered to dock if possible or follow the homebase.
- If the host ship does not have a ship set as homebase, and has 'Trading System Extension' installed, then the newly claimed ship will be ordered to dock if possible or follow the host ship.
- If either of the above occurs, if the lead ship has 'Special Command Software MK1' and 'Transporter Device' installed, the newly capped ship will be stripped of all wares (if possible) by the lead ship.

When collecting wares/astronauts:
- If the homebase is a ship and the homebase has 'Trading System Extension' installed, then the host ship will dump its cargo at the homebase when it is 75% or more full.
- If the host ship has a Jumpdrive and 'Navigation Command Software MK1' installed, it will attempt to stock enough Energy Cells to jump to its operating sector and back to the homebase, provided the homebase has more than 500 Energy Cells available at all times.


============================================

Change log:
1.2
- Fixed infinite loop when autosalvaging ships.
- Added docking if possible for autosalvaged ships.
- Removed requirement for host ship to be big in order to have autosalvaged ships follow/dock at it.
- Added use of stock System Override Software, though only small ships can be claimed.

1.1
- Added dumping wares at homebase when 75% full.

1.0
- Initial release.

============================================


Technical:

Text file: 8370.

Command slots:
<t id="659">COMMAND_TYPE_PIRACY_59</t>
<t id="660">COMMAND_TYPE_PIRACY_60</t>
<t id="661">COMMAND_TYPE_PIRACY_61</t>

Enjoy!
Last edited by voxol on Mon, 2. Jul 07, 18:16, edited 3 times in total.
User avatar
Tenlar Scarflame
Posts: 3359
Joined: Mon, 30. May 05, 04:51
xr

Post by Tenlar Scarflame »

This looks like exactly what I need... I think the pirate's life just got a little jollier :pirat:
My music - Von Neumann's Children - Lasers and Tactics

I'm on Twitch! 21:15 EST Sundays. Come watch me die a lot.
voxol
Posts: 429
Joined: Sun, 30. Oct 05, 14:42
x3

Post by voxol »

In case you downloaded this before this message was posted, please redownload. Several minor bugfixes.
Erilaz
Posts: 161
Joined: Mon, 8. May 06, 13:49
x4

Post by Erilaz »

This is great, just what I needed.

Downloaded after your message warning about the minor fixes. However, there's a few things I noticed:

-Continuous null messages in the Player log. Also, I'm not really interested in seeing a message for every mosqito missile picked up. Can we set it to be a little less verbose?

-What does it mean when it says "Docking bays full?" Had a TP assigned to an Elephant but the TL only had 4/14 ships docked there.

-The TP has SCS and when I used it's console to order it to "Claim ship" ("Claim ship..."?), it did nothing, but the player ship went on a mission to claim the ship (might have used the wrong console but I seriously doubt it, since that would have been a first). No amount of setting the orders on the player ship to none helped as my speed remained at full although I could fly as if the autopilot was off. Then when I double clicked a station to land there hoping to reset my ship, it flew to the unclaimed ship and claimed it.

If this was still all in the old file and I downloaded too soon after your message or something, my appologies.

This is a great idea and a much needed addition to the new bailing system, so I'm keen to use it.
voxol
Posts: 429
Joined: Sun, 30. Oct 05, 14:42
x3

Post by voxol »

Erilaz wrote: -Continuous null messages in the Player log. Also, I'm not really interested in seeing a message for every mosqito missile picked up. Can we set it to be a little less verbose?
Hmm, ok the null messages are probably me leaving some debug text in there, I will investigate. EDIT: Fixed.
Erilaz wrote: -What does it mean when it says "Docking bays full?" Had a TP assigned to an Elephant but the TL only had 4/14 ships docked there.
Err, again, do you mean message log or betty? This ones got me stumped, but I will investigate. One thing to note, you cannot dock a TP at an Elephant (or any ship) without modding... EDIT: OK, checked the 'Best Sell Loot from Homebase' script, and there isnt anywhere where the logbook is written to or that betty is called, so I suspect this is an unrelated issue. Let me know if you are certain its this plugin.
Erilaz wrote: -The TP has SCS and when I used it's console to order it to "Claim ship" ("Claim ship..."?), it did nothing, but the player ship went on a mission to claim the ship ...
LOL, ok, I'm pretty sure this is because Cycrow wrote the "Claim ship" command to only work on the player ship, so even if its run on another ship it sends all the script commands to the player ship. Your best bet is either: (a) just use 'Automated Salvaging', or (b) bring up the issue of remote usage with Cycrow in the SCS thread (link in OP).

Thanks for the feedback!
voxol
Posts: 429
Joined: Sun, 30. Oct 05, 14:42
x3

Post by voxol »

OK, I've updated getting rid of the debug text written to logbook. Tiny edit so I havnt bothered giving it a new version number. Just redownload if you downloaded it before this post :roll:
Erilaz
Posts: 161
Joined: Mon, 8. May 06, 13:49
x4

Post by Erilaz »

Ah that's great thanks. The autoclaiming works wonders and the rest of the stuff is getting picked up (I genereally don't do slaves, but maybe later; Would a TP pick up astronauts without Cargo Life Support?)

I guess my only thing now is the reporting side.

Yes, the "Docking bays full" was still talking about the player log. It appeared once, in the same fashion as the "Mosquito Missile." Not sure what it's trying to do.

Would it be too much hassle to add a ship name and sector where these things are collected? Or possibly a message author like "Automated Salvaging - <sectorname>"? Would be helpful if more than one of these are running, which is hopefully, what's going to happen. If I could make a suggestion: when the Auto-Salvaging ship transfers a load to the lead ship, we just get one list or whatever, to cut down on the log hungry part.

AutoS doesn't log the claiming of new ships, which is a tad more important to my eyes. Not sure if Betty has anything to say on the matter, cos I was claiming on the other side of the sector and when I looked again, a buzzard and buster were heading towards the TL to be scraped (that works really well by the way). Didn't want half masted ships with no shields flying around following the TL without me knowing about it.
LOL, ok, I'm pretty sure this is because Cycrow wrote the "Claim ship" command to only work on the player ship
Er, oops. Hmmm, yes. That's not one of yours.

Thanks a bunch for the updated file, will replace it tonight.
voxol
Posts: 429
Joined: Sun, 30. Oct 05, 14:42
x3

Post by voxol »

Erilaz wrote: Ah that's great thanks. The autoclaiming works wonders and the rest of the stuff is getting picked up (I genereally don't do slaves, but maybe later; Would a TP pick up astronauts without Cargo Life Support?)
No, astronauts will not be picked up by a ship without cargo lifesupport. I've thought of a cool use for all these extra slaves actually, so you might want to start collecting for the next update of Bail Signal Extension...
Erilaz wrote: I guess my only thing now is the reporting side.

Yes, the "Docking bays full" was still talking about the player log. It appeared once, in the same fashion as the "Mosquito Missile." Not sure what it's trying to do.

Would it be too much hassle to add a ship name and sector where these things are collected? Or possibly a message author like "Automated Salvaging - <sectorname>"? Would be helpful if more than one of these are running, which is hopefully, what's going to happen. If I could make a suggestion: when the Auto-Salvaging ship transfers a load to the lead ship, we just get one list or whatever, to cut down on the log hungry part.

AutoS doesn't log the claiming of new ships, which is a tad more important to my eyes. Not sure if Betty has anything to say on the matter, cos I was claiming on the other side of the sector and when I looked again, a buzzard and buster were heading towards the TL to be scraped (that works really well by the way). Didn't want half masted ships with no shields flying around following the TL without me knowing about it.
This most recent version shouldnt log *anything*, if it does it means more debug text I missed. I cant really see the point of logging every little thing picked up. I see your point about salvaged ships though without any shields. No sure the best way to handle that. I could certainly make them dock if possible, but there is limited space especially on a TL so its a minor improvement at best. Suggestions welcome.

Also, I actually missed out a feature I meant to add, that your ship collecting flying wares can dump them on the homebase when it is full. Then it would be true piracy automation.
voxol
Posts: 429
Joined: Sun, 30. Oct 05, 14:42
x3

Post by voxol »

v1.1 released
- Added dumping wares at homebase for 'Automated Salvaging'.


An example use: You can have a TL in a safe sector close to the operating sector. Then have 2 M6s and a patrol. The patrol ships wander around the sector destroying/disabling enemies. One M6 moves around the sector collecting wares and astronauts and salvaging ships. The claimed ships are immediately sent to the TL in a safer sector where they are stripped, and the wares/slaves collected are dumped at the TL as the M6 becomes full. Finally you have the other M6 assigned to best sell ill-gotten wares from the homebase, using jumpdrive where necessary.

All 100% automated (getting awefully close to rivaling a trading career in terms of Cr. reward and automation).
User avatar
Tenlar Scarflame
Posts: 3359
Joined: Mon, 30. May 05, 04:51
xr

Post by Tenlar Scarflame »

wow. this is pretty intense. big piracy is now possible! :twisted:
My music - Von Neumann's Children - Lasers and Tactics

I'm on Twitch! 21:15 EST Sundays. Come watch me die a lot.
voxol
Posts: 429
Joined: Sun, 30. Oct 05, 14:42
x3

Post by voxol »

Lol, just realised, hadnt even considered this, but back when I was a trader I would have killed for a centralised place to store all my factory produced wares and have traders automatically sell whatever they could from it. With this plugin and a TL, its simple.

Really never planned on this script to be useful for normal trading as well!
User avatar
Tenlar Scarflame
Posts: 3359
Joined: Mon, 30. May 05, 04:51
xr

Post by Tenlar Scarflame »

oh HO! Voxol you genius. I tried to set that up in my old trading game and couldn't get it to work either. Looks like I'll be a weapons dealer AND a pirate... :D
My music - Von Neumann's Children - Lasers and Tactics

I'm on Twitch! 21:15 EST Sundays. Come watch me die a lot.
voxol
Posts: 429
Joined: Sun, 30. Oct 05, 14:42
x3

Post by voxol »

Tenlar Scarflame wrote:Looks like I'll be a weapons dealer AND a pirate... :D
Ah, but theres a problem, the Best Sell Loot command wont sell equipment (i.e. weaps, shields, missiles). But they are so easy to sell manually in unlimited quantities to any EQ that doesnt stock them, anyway.
reinhart_menken
Posts: 229
Joined: Sat, 27. Jan 07, 05:23

Post by reinhart_menken »

Is it possible that you can set it up or add a new command that sells all equipments (weapons, shields, missles) that goes aboard the ship after the command has been given? Meaning, keep all the junk that was on the ship before issuing the command, but sell everything afterwards.

This would be unceasingly useful because "rescued" equipments are exactly the things that I want to sell and it's too much work to have to manually sell everything you rescued or stripped from a ship.

I'm guessing you could do something like the XTM's template design, whereas the ship that's set as template will have it's equipments "saved" by the script (presumably) and then other ships will be equipped according to the template; you could just have the script "save" all the equipments a ship has and sell everything until it's back to what was saved. I'm not familiar with X3 scripting so I don't know if it's feasible.

How about an automatic claimed-ship-and-equipment-selling command? Could set the script to recognize claimed ships by setting their names a certain way when they're automatically claimed using your script.

Anyways, the script at it's current condition is great already :) Just thought I might offer some suggestions if you're interested.
voxol
Posts: 429
Joined: Sun, 30. Oct 05, 14:42
x3

Post by voxol »

reinhart_menken wrote: Is it possible that you can set it up or add a new command that sells all equipments (weapons, shields, missles) that goes aboard the ship after the command has been given? Meaning, keep all the junk that was on the ship before issuing the command, but sell everything afterwards.

This would be unceasingly useful because "rescued" equipments are exactly the things that I want to sell and it's too much work to have to manually sell everything you rescued or stripped from a ship.
Yes its certainly possible, but I didnt include for a reason. You can sell equipment very quickly and easily in unlimited quantities for a good price at any EQ that doesnt stock that equipment. No need to go looking for best price and somewhere that stocks it. If the Best Sell command was used on equipment it would only be able to sell equipment to EQs that stock it, so is very restricted.
reinhart_menken wrote: I'm guessing you could do something like the XTM's template design, whereas the ship that's set as template will have it's equipments "saved" by the script (presumably) and then other ships will be equipped according to the template; you could just have the script "save" all the equipments a ship has and sell everything until it's back to what was saved. I'm not familiar with X3 scripting so I don't know if it's feasible.
LOL, yes I'm quite familiar with that script :roll: . As I said above.
reinhart_menken wrote: How about an automatic claimed-ship-and-equipment-selling command? Could set the script to recognize claimed ships by setting their names a certain way when they're automatically claimed using your script.

I had thought about automatically selling claimed ships, but there is no way AFAIK to find out the selling price of a damaged ship. Very annoying (if anyone has any info for this I would be most appreciative).
reinhart_menken wrote: Anyways, the script at it's current condition is great already :) Just thought I might offer some suggestions if you're interested.

Thanks! Keep 'em coming!
Erilaz
Posts: 161
Joined: Mon, 8. May 06, 13:49
x4

Post by Erilaz »

No, astronauts will not be picked up by a ship without cargo lifesupport. I've thought of a cool use for all these extra slaves actually, so you might want to start collecting for the next update of Bail Signal Extension...
Oh, will we want a lot of them? :o

I could certainly make them dock if possible, but there is limited space especially on a TL so its a minor improvement at best. Suggestions welcome.
Docking them would be one option and a good one. It would be quite an improvement actually, if I knew they were being captured or docked. Then they wouldn't overfill. There's some areas that can't really be considered truely safe, unless the ships have to travel a fair distance at the capped speed. There's also the bonus of using your TL as "bait" or border patrol camping at the gates. No enemies get past unless you have a shot at it ;)

Personally, I wouldn't want automated selling of ships. I'd want to pick through them and decide what to do with them. Since, I might have a range of ships to choose from and we're not necessarily just talking falcons in our rescue / towing / clean up service now ;)
Also, there's the gloat factor. :twisted:
mintyboy
Posts: 3
Joined: Fri, 14. May 04, 11:04
x3

Post by mintyboy »

Voxol, I've got a possible bug to report.

When I set my fully tricked out Falcon, with a TL set as homebase, to AutoSalvage (OOS, btw) my game just hangs.

Possible infinite loop, or just my crappy PC?

Apart from that, everything else seems to be fine. Especially the "Strip wares" command, which works a treat.
voxol
Posts: 429
Joined: Sun, 30. Oct 05, 14:42
x3

Post by voxol »

mintyboy wrote: Voxol, I've got a possible bug to report.

When I set my fully tricked out Falcon, with a TL set as homebase, to AutoSalvage (OOS, btw) my game just hangs.

Possible infinite loop, or just my crappy PC?

Apart from that, everything else seems to be fine. Especially the "Strip wares" command, which works a treat.
Does sound suspiciously like an infinite loop. Could you let me know what tech upgrades your Falcon and your TL has on board?

Meantime I'll see if I can reproduce it.
'If you want to make a little money, write a book. If you want to make a lot of money, create a religion'
-- L. Ron Hubbard
Erilaz
Posts: 161
Joined: Mon, 8. May 06, 13:49
x4

Post by Erilaz »

Yeah, I get the same thing. Hangs the moment I turn on Auto-Salvaging OOS.

Can't tell you offhand what the TS and TL had, but they were pretty well decked out... Transporter devices, Triplex Scanners, FCS 1 & 2, TCS 1 & 2, etc. Pretty much, the works.

There was a claimable Falcon floating around in that sector too. Had to go to the sector personally to "oversee" the claiming.
voxol
Posts: 429
Joined: Sun, 30. Oct 05, 14:42
x3

Post by voxol »

v1.2 posted
- Fixed infinite loop when autosalvaging ships.
- Added docking if possible for autosalvaged ships.
- Removed requirement for host ship to be big in order to have autosalvaged ships follow/dock at it.
- Added use of stock System Override Software, though only small ships can be claimed.

Last update for a while, unless there are any more bugs of course.
'If you want to make a little money, write a book. If you want to make a lot of money, create a religion'
-- L. Ron Hubbard

Return to “X³: Reunion - Scripts and Modding”