The custom ship file:
At the section where <!ENTITY ...> lines are found, near the top of the file, add these two lines:
Code: Select all
<!ENTITY baPlayerDroneBase "0xD9123300">
<!ENTITY dsPlayerShip "0xD912A300">
Code: Select all
<ShipClass UNID="&scOsaka;"
manufacturer= "Nakura Shipyards"
class= "Osaka"
.
- snip -
.
>
Code: Select all
attributes="playership"
dockscreen="&dsPlayerShip;"
inherit="&baPlayerDroneBase;"
Code: Select all
<StaticData>
<shipCPUs>2</shipCPUs>
<shipCost>2900</shipCost>
<shipDesc>"Buy me!"</shipDesc>
<shipEquip>
(
(&itRecoillessCannon; 1)
(&itClass2Deflector; 1)
(&itReactiveArmor; 4)
)
</shipEquip>
</StaticData>
<DockingPorts>
<Port x="0" y="40">
<Port x="0" y="-40">
<Port x="40" y="0">
<Port x="-40" y="0">
</DockingPorts>
<shipCPUs> affects how many CPUs you need to control the ship. If it is Nil or undefined, you see the WARNING message before you change ships. This is because ships with no shipCPUs defined almost certainly have no <DockingPorts> defined.
<shipCost> is how much it costs in credits to buy a ship from a shipyard. This isn't needed if the ship cannot be found for sale.
<shipDesc> is the description the player reads while browsing the ship at a shipyard. Again, unnecessary if not for sale. Whatever description is used for the starting ship select screen can be copied and pasted here.
<shipEquip> is the list of items needed to rebuild a wrecked ship with a shipwright. If undefined, the ship can be rebuilt for free by the shipwright if it is on its builtTable list.
<shieldSize> is for larger ships that are too big to fit within the standard Domina shield bubble. The larger the value, the bigger the shield will be. The only acceptable values are 128, 160, and 256.
The ship must have <DockingPorts> before you can dock with it.
All of the changes do not affect ships already spawned in a saved game, only newly spawned ships.
How to compute a ship's worth.
In this mod, the value shipyards use is all installed armor and devices plus 1000. When buying a ship, any ammo the ship can spawn with is also added to the cost. Using the Osaka as an example, recoilless cannon is 300, class II deflector is 1000, and four reactive armor segments is 600. All equipment together is worth 1900. Add 1000 for the ship itself and the final total is 2900.
* * *
PlayerDrones\Ships\Ships.xml
Adding custom ships to the lists of what can be bought, sold, or rebuilt requires editing the 8,000+ line monstrosity ships.xml. You will need to define and add the new ship's UNID in the file, then add it into one of the various <StaticData> lists within the portable shipwright item.
For the Osaka, you add the following line near the top of the ships.xml file with all of the other UNIDs:
Code: Select all
<!ENTITY scOsaka "0xD314F401">
Within the <StaticData> of the portable shipwright are various lists, one for rebuilding wrecked ships and more for ships sold at shipyards.
If you want the shipwright to rebuild a wrecked Osaka, add this line within <buildTable>:
Code: Select all
(&scOsaka; &scOsaka;)
Code: Select all
&scOsaka;
* * *
Do not forget to save any changes made.