Mon Apr 16, 2012 1:52 pm
First you need to create the units.
This involves adding new unit files to the units directory, deleting the existing unit cache, and adding new unique entries to the unit alias file. The new units files will need to refer to existing models, or you will have to add new models in the same way.
Using existing models causes problems - mainly on how replacements are handled. All Merchants ships currently use CMN models - which is probably why you can't build replacements until you build a transport.
This will work for ships that are subsequently added to the force pool.
However ships that have previously been added to the force pool will have been forgotten as there was no ID to add them to. So you need to work out which techs have added ships that now exist and add the correct number to the force pool. This has to be done for every country you add ships to and for every this unit you add.
Having done this there are some caveats.
i) Everybody in the game has to have the changes. If a player tries to look at an added unit in the unmodded game then it will CTD.
ii) If a future patch also adds units, or models, you will then have to resolve any collisions of IDs that result.
An alternative is to add some foreign units to their force pool - such adding 5 TUR_MER1. This avoids the ID and CTD problems, but suffers from replacements being the wrong type.
A third option is foreign shipbuilding - instead of adding units to their force pool you have scripts where they pay another nation who builds the unit for them, they then get a unit of that nation's attributes built for them. It still has the replacement issue, but as it is a foreign build ship it isn't a problem as there would be no local ability to build replacement parts.