Back to Index Page generated: May 8, 2024, 6:16:03 AM

Expansion Towbar

Content

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description Introduces Salvaging: make money from derelict ships, earn high salvager rankings. Introduces Salvaging: make money from derelict ships, earn high salvager rankings.
Identifier oolite.oxp.Norby.Towbar oolite.oxp.Norby.Towbar
Title Towbar Towbar
Category Activities Activities
Author Norby Norby
Version 1.1 1.1
Tags salvaging, towing, derelicts salvaging, towing, derelicts
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
  • oolite.oxp.Svengali.Library:1.7.1
  • oolite.oxp.Svengali.Library:1.7.1
  • Conflict Expansions
    Information URL http://wiki.alioth.net/index.php/Towbar n/a
    Download URL https://wiki.alioth.net/img_auth.php/e/e1/Towbar-1.1.oxz n/a
    License CC BY-NC-SA 3 CC BY-NC-SA 3
    File Size n/a
    Upload date 1666742875

    Documentation

    Also read http://wiki.alioth.net/index.php/Towbar

    Readme.txt

    Towbar Equipment
    ----------------
    v1.1, by Norby
    
    Make money from derelict ships.
    
    Pilots often eject when lost a fight and left behind an almost destroyed ship.
    You do not need to destroy ships any more for bounty due to you will get instantly when the pilot ejects.
    
    Your HUD can show the Derelict status of your target if Detectors OXP or NumericHUDv3.11 OXP installed or you insert the insertintohudlegends.plist file from the Towbar OXP into your hud.plist.
    
    If you approach a derelict ship in 100m (or hurtle into) with low speed difference (below 10) then the towbar will lock it, see in the aft view (F2).
    
    You can tow ships with maximum 1.6 times more mass than your ship, others can be mined with Ship Miner only (see below).
    Can not use Injectors without a special equipment and pitch rate very low when towing (the $TowbarSlowTurn variable in towbar.js can be set to false on computers where controls goes jerky when tow a ship).
    Pull into a dock in the current system to sell the hull as a large amount of alloys.
    
     Ship		Mass	Alloys	Approximated credits
     Adder   	11	3	100
     Moray    	40	12	400
     Cobra Mk I	47	14	500
     Fer-de-Lance	51	15	500
     Asp     	59	18	600
     Cobra Mk III	186	56	1800
     Boa     	192	58	1900
     Python  	222	67	2200
     Anaconda	430	80	2600
    
    The payment calculated from the alloy price at the station where you sell it, plus 0-2t Computers depending on the ship size.
    Largest ships can give maximum 80t alloys only due to the inner space.
    
    Alloys will not added to the market because the ship sold to a dealer who pay instantly but disassemble later (and to avoid fill up the 127t limit of the market), but cargo will be added.
    If the market is full with this cargo then the remains will be sold at half price or discarded if you set $TowbarLimit127t to true in towbar.js.
    
    
    You will get a few hundred credits for each saved equipments and weapons also.
    All saved cargo worth the current price at the station. Some ships (with high version numbers in ShipVersion OXP so the durable ones) hold much more valuable cargo than others.
    
    You can get the following compliments:
    
     Credits Compliment
     1000-	 Nice work.
     3000-	 Well done!
     5000-	 Excellent!
    
    Usage:
    Be careful when attacking a ship: slow your fire when the exhaust plume changing (or throwing sparks with CustomShields OXP) to avoid blowing it and stop immediately when you see the Escape capsule. Then touch the derelict ship slowly to lock it to the towbar.
    
    Reduce the pitch and yaw movements when towing due to there are a small but increasing chance to break the towbar or the towed ship, heavier ship break sooner. A few tips:
    - Approach the derelict ship in the direction of your next movement, usually head to the Station to reduce turning with mass.
    - Stop your ship before turn to cause less pressure to the towbar.
    
    Do not go to a sightseeing tour: the status of the ship degrading over time when moving, so you can earn more credits if you deliver faster. You will be informed about flying parts to remember this. Losing less at low speeds but your haul are in safe only if your ship is stopped.
    
    If the towbar is destroyed then you can buy another and go back to the ship, just find the "D" (derelict) beaconCode on your Advanced Space Compass. Telescope OXP show it also in the main scanner from any range.
    If you are too slow then pirates will blow up the ship for the cargo, hunters for the bounty or Thargoids for sure.
    Not all derelict ship in the system has beaconCode due to the signal transmitter placed when the towbar locked on.
    
    You can change the towed ship if your ship approach another (likely larger) derelict ship.
    If you initiate a hyperjump then the towbar will release the towed ship. This means that you must sell the ship in the same system where you get it.
    You can release the towed ship by prime Towbar (Shift+N) and press activate (n). The just released ship can be relocked by another activate (within 200m).
    
    The towed ship is vulnerable, suggested to avoid combat situations until delivered.
    Largest towed ships facing into your aft weapon so you can not fire backward or you will destroy it.
    If you must then release it by double "h" keypress (start and stop a hyperjump) and pick up later. Before this you must set a target system and has enough fuel for the jump.
    
    Do not engage fight when towing a ship to avoid too many steering which break the towbar.
    If you must then release the towed ship and pick up after the battle.
    
    Build up your reputation by salvaging more ships, missions will require qualification.
    
     Cost: 100.0 Cr.
     Techlevel: 1
    
    
    Laser Reductor
    --------------
    
    Reduce your Laser power to minimal if targeted ship is derelict to save it from exploding after forced to eject.
    You will get a "Derelict!" message with a "bloop" sound when your target is ejected to warn you to stop your fire.
    
    Your first 10 hit will be reduced only, which mean a full second with a continuously fired beam laser. Most pilots are able to release the fire button within a second after warning sound started, if you not then increase the $TowbarMaxReduct variable in towbar.js.
    
    When you step over this limit a "Laser Reductor disabled" message arrive and you can destroy your target to finish your mission.
    You can turn off reductor also by prime (Shift-N) and activate (n) Towbar when no towed ship nor derelict within 200m.
    
    Suggested to install "Derelict" display into you HUD by either Detectors OXP, NumericHUDv3.11 or following instructions in  insertintohudlegends.plist file to get another visual warning.
    
     Cost: 100.0 Cr.
     Techlevel: 5
    
    
    Ship Miner
    ----------
    
    Complex robots can transfer the valuable parts of the towed ship to your cargo store but this take some time.
    
    Mining go ahead in the following order:
    1. Cargo: stronger ships tend to hold more valuable packages. Fuel transferred in this step also.
    2. Computers: from the built-in electronics, usually 1 or 2t depending on the ship size.
    3. Machinery: from mining equipments and lasers, in equal value.
    4. Alloys: dismantle the hull into pieces but only the smaller ones can fit into the scoop (max. 10t).
    
    Mining will stop by default when cargo transfer done assuming you want to tow the ship into a station.
    To continue prime Towbar (Shift+N) and press mode (b), but this suggested only if you do not plan to tow the ship back to any dock.
    * Set back to "Offline" or "Cargo only" setting if you plan to tow a ship again.
    * The "Cargo only" mode is suggested due to can lose cargo from the towed ship when moving but cannot from your store.
    * The "Up to full" mode will mine until there are free space in your ship, others are leaved in the mined ship.
    * The "Salvager" mode will drop out all inner parts into the space to finish the whole mining and increase your salvager reputation regardless of your store is full.
    
    Cargo check need some time in ships with 0t cargo also due to the cabin safe can contain valuables.
    Mining will be stopped in steering, speed changing, injecting and torus travel so processing when stopped or travel straight at constant normal speed.
    
    Parcels 
    
    Sometimes you can found parcels when finished cargo transfer. Urgent ones need to deliver to the main station within a few minutes.
    The message what you get and your ship's manifest screen (F5F5) show the remaining time. Do not use autodock (Shift+C) due to it need 20 minutes regardless from looks like instantly and you will arrive too late. 
    
    Your parcel reputation will not decrease if you do not arrive in time due to you are not who undertaken delivery (parcels will be removed from manifest screen when expired to avoid penalty).
    Install Display reputation OXP to track your progress, you will get more payout for the same work if you earn higher reputation.
    
    To find shortest route of normal parcels you should buy Advanced Navigational Array equipment, go to the galactic chart (F6F6), hold down "^" (Shift+6) then click on a destination (marked with green diamond). Hold with Ctrl also to show fastest route if time is not enough. Press F1 then "`" to review your timelimit in your communications log in hours. Manifest screen (F5F5) show it in days but in the galactic chart (F6F6) you see times of routes in hours.
    
    Traps
    
    
    Some ships are equipped with a self-destruct trap and a mistake during Fuel transfer can end up with a blast also. These can cause large damage to your ship depending on the size of the towed ship. After you gained more and more salvaging experience you can prevent these problems more and more times. With ShipVersion OXP you usually can mine ships safely below and at your salvager level.
    
    Towbar will not autolock if a trap can kill you due to the target is too large or your energy is low. You can override this by priming and activating Towbar but you risk to start a new game. There is always a small chance to fall into a trap, sometimes an Elite Salvager can make mistakes also so avoid overriding and wait until your energy and shields are recharged, buy Shield Boosters or a larger ship with more energy banks.
    
    Ship mining is not 100% safe, towed ships can explode from the meddling in rare cases which surely destroy the miner.
    
    
    Finished mining counted as the ship is salvaged which increase your reputation, so you can save towing time if money is less important.
    The "Empty" word in the ship name mean the cargo is transferred already, the "Mined" word mean finished mining.
    Your HUD can show these words also with NumericHUDv3.11 or by following the instructions in insertintohudlegends.plist.
    Derelict ships get light blue lollipop in the scanner when targeted, Empty get blue and Mined get dark blue.
    
    If you want to sell the parts in other system then you must mine the ship before jump due to there is not possible to construct a tool which can avoid the explosion of a badly damaged ship in hyperspace.
    
    You should mine also if you are very far away from any dock to avoid losing many parts on the long way, but if the Station is near then you can get more credits by towing.
    
    If you mining a heavy ship which has more than 1.6 times in mass than your ship then you anchored and cannot move regardless of your speed settings. If you touch the controls during mining a heavy ship then released immediately to avoid breaking the towbar. 
    
    Ship Miner can fit into large ships over 130t only and the mined parts need many cargo space, except if you found valuable cargo (Gold, Platinum or Gem-stones).
    
     Cost: 20000.0 Cr.
     Techlevel: 5
    
    
    Ship Miner Assistant
    --------------------
    
    Additional transporter bots can help to reduce mining time and increase safety.
    The possibilities of flying or destroying parts are about the half of the original.
    Also can catch large parts when towing before flying out from the towed ship.
    
     Cost: 20000.0 Cr.
     Techlevel: 11
    
    
    Towbar Compatible Injectors
    ---------------------------
    
    Enable Injectors when towing a ship. 
    Costly due to need stronger towbar holders and new exhaust tubes to the gases evade the towed ship.
    The towed ship losing more parts if the speed is higher so you can earn the same money only but can save time.
    Torus Drive is the only exception from the speed rule so suggested to use as soon as possible.
    Do not steer your ship when injecting otherwise towbar will be unstable more times faster.
    
     Cost: 20000.0 Cr.
     Techlevel: 11
    
    
    Towbar Repair Bot
    -----------------
    
    Can fix a broken towbar, but one time only.
    Repair will start automatically when needed and take about a minute.
    Can not repair a destroyed towbar which can happen almost as often as break so better if always apply Towbar Stabilizer and start repair in the last resort only.
    
     Cost: 1000.0 Cr.
     Techlevel: 5
    
    
    Towbar Stabilizer
    -----------------
    
    Use when towbar being unstable to prevent damages and the possible explosion of the towed ship.
    Occupy an empty pylon, launch as a mine.
    Buy more if you plan to tow heavy ships for long range.
    Can not fix a broken or destroyed towbar, nor resurrect the towed ship after an explosion caused by the unstable towing, so use before these problems occurs.
    
     Cost: 200.0 Cr.
     Techlevel: 5
    
    
    Tug Drone
    ---------
    
    Launch as a fire and forget missile to a derelict ship and you are done with the work.
    Guided by the local authorities which charge 50% commission but pay instantly when hit the target.
    
    Will drop out the cargo and pay for the ship only so you must scoop if not transported with Ship Miner before launched the Tug Drone.
    GalCop defend Tugs but need to known by all pirates that Tugs never transport cargo to reach a tolerable safety level (is not worth to attack it).
    
    Deep Space Dredger OXP provide Salvage Missile which can autopilot a derelict ship with cargo.
    In this case you must escort it until reach a Dredger which is much harder because pirate ambushes, but can pay more due to avoid commission.
    
    Tug Drone can fit into large ships only (over 130t).
    Do not target small ships which pay less than the cost of the Tug Drone.
    You must aim exactly to the target (with red box) to launch the drone, green target lock is not enough.
    
    The rotating ship model cannot be displayed in the sell salvage screen during flight, and your ship is moving while you read it so press enter shortly to reduce the blind fly time.
    
     Cost: 1000.0 Cr.
     Techlevel: 5
    
    
    
    Salvager License
    ----------------
    
    GalCop regulate ship salvaging at main stations: you must buy a license from your first incomes (deducted automatically).
    You can get payments for the cargo only before you pooled the full 20000 credits for the yearly license.
    
    After you got the Salvager License you must pay tax from the ship hull and equipments based on the government.
    
     Government		Tax
     Anarchy		0 %
     Feudal			5 %
     Multi-Governmental	10 %
     Dictatorship		15 %
     Communist		20 %
     Confederacy		25 %
     Democracy		30 %
     Corporate State 	35 %
    
    Other places than the the main station works without licensing but charges 50% commission.
    Dredgers in Deep Space Dredger OXP and Salvage Gang in Anarchies OXP buy without commission due to processing the ship locally but pay low price for the alloys of the hull.
    Cargo never taxed nor commissioned.
    You must buy new license in every year.
    
    
    Salvager Missions
    -----------------
    
    Your reputation counted as how many ships salvaged either by delivered or fully mined it.
    When you reached certain levels you can get Salvager Missions:
    
     Ships	Name		Level	Payout	Need Salvager License
     0	First Aid	Easy	1000	No
     2	Second Hand	Easy	2000	No
     10	Ten Commands	Easy	10000	Yes
     20	Twenty Sisters	Medium	20000	No
     30	Thirty Pirates	Medium	30000	Yes
     40	Forty Robbers	Medium	40000	Yes
     50	Fifty Percent	Hard	50000	No
     100	Hundred Tonnes	Hard	100000	Yes
     200	200 Seconds	Hard	200000	No
    
    
    Salvager Rankings
    -----------------
    
    You can step up in your Salvager career by towing or mining derelict ships or achieve salvage missions.
    As your reputation increasing you can get better rankings which shown in the Manifest screen (F5-F5).
    With higher rank you can neutralize more complex traps in towed ships.
    
     Ships	Rankings
     2	Novice Salvager
     4	Assistant Salvager
     8	Poor Salvager
     16	Below Average Salvager
     32	Average Salvager
     64	Above Average Salvager
     128	Competent Salvager
     1000	Trustworthy Salvager!
     3000	Infallible Salvager!
     6000	Elite Salvager!
    
    Payout Policy OXPs
    ------------------
    
    Towbar now supports pluggable salvaged equipment Payout Policies, done through dedicated OXPs.
    
    A Payout Policy OXP MUST:
    
    - create a function that takes an EquipmentInfo (which might contain a weapon) object as parameter and returns its salvage price IN CREDITS;
    - in the OXP's startUpComplete event handler, append a reference to that function to the array worldScripts.towbar.$TowbarEquipmentPayoutHandlers array, define a property display for that function and assign a short and distinctive string to it - the first 6 characters will be used to identify the policy implemented by the function in the policy selection screen;
    - repeat for as many policies as wished (but bear in mind that all the policies short names will have to fit in a single line).
    
    The display value "Std" is reserved for the default (buit-in) Towbar Payout Policy.
    
    Dependencies
    ------------
    Oolite v1.77 or later.
    BGS OXP from http://wiki.alioth.net/index.php/BGS if you want to see nice background on the salvage screen.
    
    Configutarion:
    -------------
    
    This configuration can be modified in-game through Station Interfaces (F4) Config for AddOns:
    
    - TalkingShip: when true, Towbar will use the Comms to send its message to the player; otherwise the messages go to the Console;
    - StartMode: start mode fo SHip Miner: 0=Offline, 1=Cargo Only, 2=Full, 3=Salvager
    - Appearance: the Towbar equipment appearance: 0=Retractable, 1=Fixed, 2=Tractor Beam
    - EqPayout: the salvaged equipment Payout Policy to use
    
    
    Some configurations can only be changed by editing towbar.js:
    
    - $TowbarDebug = false; //will spawn a derelict ship right after launch
    - $TowbarLimit127t = false; //can limit markets to the original capacity
    - $TowbarMaxReduct = 10; //how many hits will be reduced by Laser Reductor on a derelict ship
    - $TowbarNPCMissile = true; //NPCs with enhanced IQ: fire a missile before eject as last resort
    - $TowbarSlowTurn = true; //set to false if it's causing jerky controls when towing a ship
    
    License
    -------
    This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License version 3.0.
    If you are re-using any piece of this OXP, please let me know by sending an e-mail to norbylite@gmail.com.
    Towbar applause sound source: http://soundbible.com/1260-Auditorium-Applause.html
    Towbar break sound source: bgs-c_hullbang.ogg in BGS OXP.
    Towbar fireworks sound source: http://soundbible.com/693-Fireworks-Finale.html
    Towbar hit derelict sound source: boop.ogg in Oolite.
    Towbar lock on sound source: bgs-m_fx_shipyard1.ogg in BGS OXP.
    
    Changelog
    ---------
    
    2022.10.25, v1.1
    
    - Adds descriptive label for the beacon added to the ship when towbar locks on it for towing.
    - Fix mission texts to mention the name of the actual station near which the mission ship is located (instead of always the main station).
    - Only outputs message about releasing towed ship when tobear is damaged when a ship is towed (towbar might be damaged when not in use).
    - Fix repair costs for Towbar and Towbar COmpatible Injectors to discount the full price (which are proportional to the ship's mass).
    - Healthy ships (i.e, undamaged ships and usable derelicts) don't lose stuff (cargo and equipment) when towed.
    - Checks if Library OXP is installed before attempting to register the configuration options.
    - Moves Tug Drone towed-ship processing to towbar worldscript.
    - Do not look for the market commodities if in interstellar space.
    
    2020.11.04. v1.0
    
    - Just ups the version number to 1.0
    
    2020.11.03. v0.110
    
    - Fixes bug in the verification of player ship's mass before offering the mission after towbar is bought.
    - Towbar equipment salvage payout pricing looks at the equipment's scriptInfo property 'towbar_max_salvage_price' to limit the salvage price of equipments (useful for money-sinks like Shield Cycler Manual Configurator Standard and Advanced).
    
    2020.10.03. v0.109 
    
    -Towbar and Towbar Compatible Injectors have prices proportional to the ship's mass.
    -Don't start the mission after the player buys towbar if the player's ship has less than 30t.
    -Re-enables injectors after releasing the towed ship when hitch-riding a wormhole.
    -Reduces the amount retained for the Salvager's License when salvaging at main station without a license from 100% to 60%.
    -Uses $disableEquipemnt and $enableEquipment from Rapair Bots if available to disable/enable the injectors when towing without towbar compatible injectors.
    -Stations with GalCop allegiance behave as main station.
    -Player may choose to pay the full balance to the Salvager's License if enough credits are available.
    
    
    2020.09.14. v0.108 
    
    -Deals with carried ships when salvaging a Carrier.
    
    
    2020.09.04. v0.107 
    
    -Fixes bug that halted salvaging processing.
    -Fixes bug that prevented Appearance parameter saved value from taking effect after loading from save file.
    -More messages re-written to better English (thanks to Nite Owl).
    
    
    2020.08.31. v0.106 
    
    -Fixes a bug in the fallback code for Laser Reductor.
    -Doesn't blindly remove equipments defined by other OXPs.
    
    
    2020.08.29. v0.105 
    
    -Fixes bug in cargo pod script that looks at the pod's cargo space instead of the player ship's when scooped.
    -Implements salvaged equipment payout policy selection in-game through Stations Interfaces (F4) Config for AddOns.
    -Laser Reductor looks at EquipmentInfo.weaponInfo.damage to know the energy of the hit to be reduced (uses a fallback for core game versions that don't allow scripts retrieval of weaponInfo).
    -Creates TalkingShip, StartMode and Appearance  parameters in Stations Interfaces (F4) Config for AddOns.
    -Implements TalkingShip, with messages in better English thanks to Nite_Owl.
    -Removes the "Incoming Message" speech intro for Comms messages.
    
    
    2020.08.06. v0.104 
    
    -Use commodity name instead of commodity display name as cargo identification in cargo pods re-spawned when you scooped more than your available cargo space can hold (with display name as identification, the cargo couldn't be put into the player's ship manifest when the cargo pod was scooped later).
    -Adjusted Laser Reductor to take into account the damage rate defined for the current weapon (should work better with high powered laser other than Military Laser).
    -Debug code to spawn derelicts just out the station when launching now spawn near the station where the player's ship is docked instead of the main station.
    -Tweaked code the awards/remove EQ_DTADER to reduce the number of times it's added/removed while targeted.
    -Upped Oolite minimum version to 1.81, removed code for older versions.
    -Fixed bug that used commodity display name instead of name in lost-in-transit cargo pods.
    -Fixed bug that removed rotation when reducing yaw and pitch while towing (affected ILS rotation-sync).
    -Fixed bug in salvaged ship payout when the ship's cargo is beyond the local market capacity.
    -Re-factored salvaged equipment pricing into a function, to make it easier to overwrite the pricing policy through other OXPs.
    -Included port and starboard weapons (if any) in the salvaged ship payout.
    -Reduced payout for salvaged ship's equipment and weapons for better game balance.
    -Some de-referencing for performance.
    
    
    2020.06.23. v0.103 
    
    -Abort sound was not playing if the tug drone can't be launched.
    
    
    2020.05.05. v0.102 
    
    -Better integration with Email System, preventing unnecessary emails being sent.
    
    
    2020.02.23. v0.101 
    
    -Fixed two invalid reference errors in the towbar mission script.
    -Some minor spelling/grammar corrections.
    
    
    2016.08.14. v0.99 
    
    -Increased payout for equipments and weapons during ship salvaging.
    -Towbar is not shown by default, just when tow a ship (retractable).
    -Mission failed screen appear correctly at load game when must finish without rest.
    -NPC will not fire missile at point-blank range before eject, thanks to Astrobe.
    -Fixed multiplied parcels, thanks to Cmd Northgate.
    -Removed "x. find" from parcel messages, suggested by Cmd Northgate.
    -Fixed Constrictor hunt problem, thanks to Captain Obvious.
    -First mission compatible with Escort Deck, thanks to Vincentz.
    -Fixed for very long ships like Worker's Commuter in Commies OXP, thanks to TheOldGamer.
    -Density of small-cargo1 raised to help scoop it with small ships, thanks to Bogatyr.
    -Tug Drone got collision handler, thanks to Hullblazer.
    -Ship Miner default mode changed to salvager as suggested by gt52.
    
    
    2015.03.15. v0.98 
    
    -Player get score if force a pilot to eject.
    -Small fixes for Oolite 1.81 and without BGS.
    
    
    2014.09.21. v0.97 
    
    -The first mission will fail if jump out from the system, thanks to Bogatyr.
    -Cleanup after first mission: Moray removed, thanks to Falcon777.
    -Trumbles modified to do not take over cargo, thanks to Falcon777.
    
    
    2013.12.26. v0.96 
    
    -Bugfix in Tug Drone (thanks to slomoe).
    -Smaller large cargo box.
    
    
    2013.12.14. v0.95 
    
    -Parcels and urgent parcels can be found during ship mining.
    -Minor tweaks in mining and a bugfix with Trumbles.
    -Audio and message warning if hit a derelict ship to stop fire in time.
    -Laser Reductor limitation adjustable in $TowbarMaxReduct.
    -Illegal cargo added into some ships with bounty.
    
    
    2013.12.08. v0.94 
    
    -Laser Reductor fixed and can be turned off.
    
    
    2013.10.26. v0.93 
    
    -Timed bomb implemented into some derelict ships.
    -Traps are leveled up with ShipVersion.
    -Towbar will not autolock if a trap can be fatal.
    -NPCs will stop attacking derelict ships.
    
    
    2013.10.22. v0.92 
    
    -Trap ships and Fuel mining added (thanks to popsch).
    -Injectors fixed when the towed ship destroyed by others.
    
    
    2013.09.24. v0.91 
    
    -Give back Injectors after mission ship is delivered.
    -Set $TowbarSlowTurn to false on computers where controls goes jerky when tow a ship.
    -XML support in insertintohudlegends.plist.
    -Effectdata.plist for Telescope OXP to show large cargo models.
    
    
    2013.09.06. v0.9  
    
    -Laser Reductor, Ship Miner, Ship Miner Assistant and Tug Drone added.
    -First Salvager Mission added.
    -Towbar primeable to release and to change mining mode.
    -Salvager Rankings displayed in F5-F5 screen (idea get from Display reputation OXP).
    -Deep Space Dredger and Salvage Gang buy ships without commission.
    -Can lose or destroy alloys, cargo and equipments during towing and steering also.
    -Flying out more t alloys and cargo in one large object instead of many 1t pieces.
    -Flying equipments now scoopable as 1 or more t Machinery.
    -The ship.script.$TowbarShipHealth is scalable from 0 to 1 (max. loss to no loss).
    -Pitch rate less reduced with light towed ships.
    -HUD can show the Derelict, Empty and Mined status of the current target.
    -Pay bounty instantly when the target derelicted.
    -Refund available for all equipments of this OXP.
    
    
    2013.08.21. v0.8  
    
    -Chance to break the towbar or the towed ship (thanks to DaddyHoggy).
    -Towbar break sound included, source: bgs-c_hullbang.ogg in BGS OXP.
    -Towbar Stabilizer, Repair Bot and Towbar Compatible Injectors added.
    -Towed ship get "D" (derelict) beaconCode.
    -Build up reputation in missionVariables.
    -Salvager License and tax system added.
    -Flying alloys, cargo and equipments added.
    -Ship moved to right in the sell salvage screen (thanks to Svengali and cim).
    
    
    2013.08.18. v0.7  
    
    -Injectors offline and pitch rate very low when towing.
    -Payment lowered.
    
    
    2013.08.17. v0.6  
    
    -Lock on sound added. Source: bgs-m_fx_shipyard1.ogg in BGS OXP.
    -Some ships carry much more valuable cargo than others.
    
    
    2013.08.16. v0.5  
    
    -Give money for cargo also.
    
    
    2013.08.15. v0.2  
    
    -Give money for equipments.
    
    
    2013.08.14. v0.1  
    
    -First test files.
    

    Equipment

    Name Visible Cost [deci-credits] Tech-Level
    HUD no 0 100+
    HUD no 0 100+
    HUD no 0 100+
    Laser Reductor yes 1000 5+
    Refund Laser Reductor yes 0 5+
    Ship Miner yes 200000 5+
    Ship Miner Assistant yes 200000 11+
    Refund Ship Miner Assistant yes 0 11+
    Refund Ship Miner yes 0 5+
    Towbar yes 1000 1+
    Towbar Compatible Injectors yes 200000 11+
    Refund Towbar Compatible Injectors yes 0 11+
    Towbar Repair Bot yes 10000 5+
    Refund Towbar Repair Bot yes 0 5+
    Towbar Stabilizer yes 2000 5+
    Refund Towbar Stabilizer yes 0 5+
    Refund Towbar yes 0 1+
    Tug Drone yes 10000 5+
    Refund Tug Drone yes 0 5+

    Ships

    Name
    Alloys
    more-alloys2
    more-alloys3
    more-alloys4
    more-alloys5
    Cargo
    more-cargo2
    more-machinery1
    more-machinery2
    Wreckage
    more-wreckage2
    more-wreckage3
    more-wreckage4
    more-wreckage5
    Machinery
    one-machinery2
    Cargo
    Towbar
    Towbar Stabilizer
    Tug Drone

    Models

    This expansion declares no models.

    Scripts

    Path
    Scripts/largeonly.js
    "use strict";
    this.name        = "largeonly";
    this.author      = "Norby";
    this.copyright   = "2013 Norbert Nagy";
    this.licence     = "CC BY-NC-SA 3.0";
    this.description = "This equipment is usable only for ships over 130t like the Cobra III or Rocket Miner.";
    this.version     = "1.0";
    
    this.allowAwardEquipment = function(eqKey, ship, context)
    {
    //	player.consoleMessage( eqKey+" "+ship+" "+context );//debug
    	if (ship.mass >= 130000) {
            return true;
        } else {
            log(this.name, "Ship "+ship.displayName+" has mass "+ship.mass+", can not install "+eqKey+" with context "+context);
            return false;
        }
    }
    
    Scripts/more-in-one.js
    "use strict";
    this.name        = "more-in-one";
    this.author      = "Norby";
    this.copyright   = "2013 Norbert Nagy";
    this.licence     = "CC BY-NC-SA 3.0";
    this.description = "This box contain more t cargo in one.";
    this.version     = "1.1";
    
    this.$cargo = 2; //how many cargo inside
    this.$cargoname = "alloys"; //cargo type
    this.$cargounit = "t"; //cargo unit
    
    this.shipWasScooped = function( scooper ) {
        var _player = player;
        var _pship = _player.ship;
    
        if( scooper == _pship ) {
            if (worldScripts["detectors"]) //need remove energy value from the end of the name before scoop message
                this.ship.displayName = this.ship.script.$Detectors_Origname;
            log("towbar, more-in-one", "Scooped "+this.$cargo+this.$cargounit+" of "+this.$cargoname);
            var t = this.$cargo;
            if (_pship.cargoSpaceAvailable < t && this.$cargounit === "t")
                t = _pship.cargoSpaceAvailable;
            if (this.$cargoname in system.mainStation.market) _pship.manifest[this.$cargoname] += t;
            if (t < this.$cargo)  { //spawn the remain
                var cdname = displayNameForCommodity(this.$cargoname);
                if( t < 1 )
                    _player.consoleMessage( "Your store is full, can not get "+this.ship.displayName+".", 5);
                else {
                    this.ship.displayName =  t+"t "+cdname;
                    _player.consoleMessage( "Your store is full, get "+this.ship.displayName+" only.", 5);
                }
                if(this.$cargounit === "t") 
                    var a = _pship.spawnOne("more-cargo");
                else 
                    var a = _pship.spawnOne("small-cargo"); //some kg gold and co can fit into a small pod
                if( a && a.isValid ) {
                    if( !a.script ) a.script = "oolite-default-ship-script.js";
                    if( a.script ) {
                        a.script.$cargo = this.$cargo - t;
                        a.script.$cargoname = this.$cargoname;
                    }
                    a.displayName = (this.$cargo-t)+this.$cargounit+" "+cdname;
                } else {
                    var a = _pship.spawn("cargopod", Math.min(64, this.$cargo - t));
                    if( a ) for(var i=0; i<a.length; i++) {
                        if( a[i] && a[i].isValid ) {
                            a[i].setCargo(this.$cargoname);
                            a[i].displayName = "1"+this.$cargounit+" "+cdname;
                            a[i].bounty = 0;//to avoid * mark with detectors oxp
                        }
                    }
                }
            }
        }
    }
    
    Scripts/towbar.js
    notYetParsed
    Scripts/towbar_conditions.js
    "use strict";
    this.name           = "towbar_conditions";
    this.author         = "Dybal";
    this.copyright      = "(C) 2020 Dybal";
    this.licence        = "CC-by-SA 4.0";
    this.description    = "Towbar condition script";
    this.version        = "1.0";
    
    
    //----------------------------------------------------------------------------------------
    this.updateEquipmentPrice = function _Towbar_updateEquipmentPrice(equipment, price) {
        // price would be equipment.plist's 1000 for Towbar and 2000000 for Towbar Injectors, or a fraction of that for repairs
        var ws = worldScripts["towbar"];
        var actual_price = 0;
        if (equipment === "EQ_TOWBAR") {
            // keep discount for repairs
            actual_price = (price / 1000) * (player.ship.mass / 1000) * 3; // mass is in kg, convert to ton
        } else if (equipment === "EQ_TOWBARINJ") {
            // keep discount for repairs
            actual_price = (price / 2000000) * (player.ship.mass / 1000) * 60; // mass is in kg, convert to ton
        }
        log(this.name, player.ship.displayName+" masses "+(player.ship.mass/1000).toFixed(1)+" t, "+equipment+" costs "+formatCredits(actual_price, true, true));
        return actual_price * 10; // price in decicredits
    };
    
    Scripts/towbareq.js
    "use strict";
    this.name        = "towbareq";
    this.author      = "Norby";
    this.copyright   = "2013 Norbert Nagy";
    this.licence     = "CC BY-NC-SA 3.0";
    this.description = "Primed commands: release/relock, ship miner mode change";
    this.version     = "0.97";
    
    //equipment events
    this.activated = function() {
    	var r = worldScripts["towbar"];
    //	r.$Towbar_ParcelAdd();//debug
    	if( r.$TowbarShip ) r.$Towbar_Release();
    	else {
    		if(!system) return; //find derelict ship in 200m
    		var st = system.filteredEntities(this, r.$Towbar_IsDerelict, player.ship, 200);
    		if( st.length > 0 ) r.$Towbar_SteerTo( st[0] ); //Towbar lock on
    		else {
    			var lr = "not installed";
    			switch( player.ship.equipmentStatus("EQ_LASERREDUCTOR") ) {
    				case "EQUIPMENT_OK":
    					if( r.$TowbarLaserReductorOn ) {
    						r.$TowbarLaserReductorOn = false;
    						lr = "OFF";
    					} else {
    						r.$TowbarLaserReductorOn = true;
    						lr = "ON";
    					}
    					break;
    				case "EQUIPMENT_DAMAGED":
    					r = "Damaged";
    					break;
    			}
    			player.consoleMessage("No ship on Towbar, Laser Reductor is "+lr);
    		}
    	}
    }
    
    this.mode = function() {
    	if( player.ship.equipmentStatus("EQ_SHIPMINER") == "EQUIPMENT_DAMAGED" ) {
    		player.consoleMessage("Ship Miner damaged");
    		return;
    	}
    	if( player.ship.equipmentStatus("EQ_SHIPMINER") != "EQUIPMENT_OK" ) {
    		player.consoleMessage("Buy Ship Miner first");
    		return;
    	}
    
    	var r = worldScripts["towbar"];
    	r.$TowbarMiner++;
    	if( r.$TowbarMiner > 3 ) r.$TowbarMiner = 0;
    	var set = "";
    	switch( r.$TowbarMiner ) {
    		case 0: set = "Offline";
    		break;
    		case 1: set = "Cargo only";
    		break;
    		case 2: set = "Up to full";
    		break;
    		case 3: set = "Salvager";
    	}
    	player.consoleMessage("Ship Miner: "+set);
    	r.$Towbar_Mining(); //start or continue
    }
    
    Scripts/towbarmissions.js
    notYetParsed
    Scripts/towbarstabilizer.js
    "use strict";
    this.name        = "towbarstabilizer";
    this.author      = "Norby";
    this.copyright   = "2013 Norbert Nagy";
    this.licence     = "CC BY-NC-SA 3.0";
    this.description = "Use when towbar being unstable.";
    this.version     = "0.9";
    
    
    this.shipSpawned = function() {
    	if( player.ship.equipmentStatus("EQ_TOWBAR") == "EQUIPMENT_OK"
    		&& worldScripts["towbar"].$TowbarPitchC > 0 ) {
    		worldScripts["towbar"].$TowbarPitchC = 0;
    		player.consoleMessage("Towbar stabilized.");
    	} else {
    		player.ship.awardEquipment("EQ_TOWBARSTAB_MINE");
    		player.consoleMessage("Towbar stabilizer can not help now.");
    	}
    	this.ship.remove(true);
    }
    
    Scripts/tugdrone.js
    "use strict";
    this.name        = "tugdrone";
    this.author      = "Norby";
    this.copyright   = "2013 Norbert Nagy";
    this.licence     = "CC BY-NC-SA 3.0";
    this.description = "Tug Drone can tow instead of you.";
    this.version     = "0.9";
    
    this.$TugDrone_Distance = 0;
    this.$TugDrone_Timer = null;
    this.$TugDrone_Target = null;
    
    
    this.playAbortSound = function() {
        var TugDrone_Sound = new SoundSource;
        TugDrone_Sound.sound = "witchabort.ogg"; //sound if cannot start
        TugDrone_Sound.loop = false;
        TugDrone_Sound.repeatCount = 1;
        TugDrone_Sound.play();
    }
    
    this.shipCollided = function(otherShip) {
        if( this.$TugDrone_Target && this.$TugDrone_Target.isValid
             && otherShip == this.$TugDrone_Target )
            this.$TugDrone_Hit(); //payout
    }
    
    this.entityDestroyed = function() {
        if( this.$TugDrone_Timer ) {
            this.$TugDrone_Timer.stop();
            delete this.$TugDrone_Timer;
        }
        if( this.$TugDrone_Target && this.$TugDrone_Target.isValid
            && this.$TugDrone_Distance < 300 ) //need saved distance due to this.ship is invalid when destroyed
            this.$TugDrone_Hit(); //within 300m assuming to hit the target, go to payout
    }
    
    this.shipSpawned = function() {
        var ship = player.ship.target;
        if( !ship ) {
            player.ship.awardEquipment("EQ_TUGDRONE_MISSILE");
            player.consoleMessage("Tug Drone cannot start: need more exact aim",5);
            this.ship.remove(true); //remove drone
            this.playAbortSound();
    //        log("TugDrone", "No target");
        } else if( ship.isValid && ship.isDerelict &&
            player.ship.position.distanceTo( ship.position ) < player.ship.scannerRange ) {
            this.$TugDrone_Timer = new Timer(this, this.$TugDrone_Timed, 0, 0.25);//distance meter
            player.consoleMessage("Tug Drone launched.",3);
            this.$TugDrone_Target = ship;
    //        log("TugDrone", "Launched to "+ship.displayName+" "+ship);
        } else {
            player.ship.awardEquipment("EQ_TUGDRONE_MISSILE");
            player.consoleMessage("Tug Drone cannot start: need derelict ship in scanner range",5);
            this.ship.remove(true); //remove drone
            this.playAbortSound();
    //        log("TugDrone", "Not launched to "+ship);
        }
    }
    
    this.$TugDrone_Hit = function() {
        var ship = this.$TugDrone_Target;
        var wst = worldScripts.towbar;
    
        if( this.$TugDrone_Timer ) {
            this.$TugDrone_Timer.stop();
            delete this.$TugDrone_Timer;
        }
        if (wst && ship && ship.isValid && ship.isDerelict) {
            log(this.name, "Processing "+ship.displayName);
            this.ship.remove(true); //remove drone
            wst.$Towbar_TugDrone_Processing(ship);
        }
    }
    
    this.$TugDrone_Timed = function() { //distance meter
        if( this.$TugDrone_Target && this.$TugDrone_Target.isValid && this.ship && this.ship.isValid ) {//save distance
            this.$TugDrone_Distance = this.ship.position.distanceTo( this.$TugDrone_Target.position );
    //        log("TugDrone", this.$TugDrone_Distance+"m from target: "+ship);
        }
    }