Hello makrisgialos,
don't add the code to existing Civ5 files : editing vanilla files is bad and can lead to huge problems from incompatibility with mods to CPU meltdown
You need to make a small mod to get your unit working safely. You can make as many files as Firaxis did (spliting units and unitclasses in 2 files for example) or just put everything in 1 file.
This part defines the class of the new unit. Each time you create a new unit you need to create a new class for it
Here are set the stats of the unit.
From my example you will need to balance some data to your own needs :
(what you have to balance is in red, what you can keep stays in black)
<
PrereqTech> set the technologie prereq. For a vanilla tech tree Dynamite could be a good choice as Chrisbburn did
<
Combat> The melee strength of the unit. Should be between the Frigate and the Battleship.
<
RangedCombat> The range strength of the unit. Should be between the Frigate and the Battleship.
<
Cost> How much the unit will cost to build
<
FaithCost> Same but in faith, it's 2x the cost (or less or more if you wish
)
<RequiresFaithPurchaseEnabled> With this setting the religion must allow the purchase with Faith. If it's not defined then Faith Purchase is enabled in all cases (I think).
<
Moves> How many tiles the unit can move
<
Range> How far the unit can fire. Vanilla settings are 3.
<
ObsoleteTech> At which Tech the unit is obsolete, for vanilla settings it should be when the Battleship unlocks.
<Unit_ClassUpgrades>
In which unitclass your Protected Cruiser will upgrade. For vanilla settings it should be the Battleship.
<Unit_FreePromotions>
Which promotions the unit will get at start. At minimum should be the battleship's promotions.
<Unit_AITypes>
Tells the AI how to use the unit. Same settings as the Battleship.
<Unit_Flavors>
Tells the AI how much value it gives the unit to build it. Same settings as the Battleship.
<IconTextureAtlases>
The table defines the icons and flag for the unit (not the strategic view icon)
The lines
<UnitFlagAtlas>UNITS_PALLADA_FLAG_ATLAS</UnitFlagAtlas> and
<IconAtlas>PROTECTED_CRUISER_ATLAS</IconAtlas>
in the Units table work with the IconTextureAtlases.
<Language_en_US>
replace all
YOUR HELP TEXT HERE. with your own text. My best friend for the pedia part is wikipedia
CODE FOR THE ARTDEFINES The following tables tell the game which arts to use and how (with which templates for the animations). You don't need to change anything at all here. The template I used is from the frigate because the protected cruiser fires from the side
<ArtDefine_UnitInfos>
<ArtDefine_UnitInfoMemberInfos>
<ArtDefine_UnitMemberInfos>
<ArtDefine_UnitMemberCombats>
<ArtDefine_UnitMemberCombatWeapons>
If you want a resource prereq for your unit (coal is the best and more accurate choice) then add those lines :
Code:
<Unit_ResourceQuantityRequirements>
<Row>
<UnitType>UNIT_PROTECTED_CRUISER</UnitType>
<ResourceType>RESOURCE_COAL</ResourceType>
</Row>
</Unit_ResourceQuantityRequirements>
Again you can put all of this in 1 XML file and you write 1 SQL for the strategicview.
Both files must be loaded/activated via a mod that you can do with Modbuddy.
I could make the mod for you but I think it's better if you do it. You will learn how to make your own mod and in the future it will be easier for you.
Kael's guide will tell you all you need for this (90% of the work is done with the code I gave you).
If you need more help just ask
ah and ... don't edit the vanilla files !