I have no idea what I'm doing. Unique unit?

Ghiaman1334

Chieftain
Joined
Feb 13, 2017
Messages
15
So I'm new to the modding scene. I've never done any kind of programming, coding, code editing or anything of the like in my life. But I decided to throw my hat in the ring and try for making a basic mod using the ModBuddy in the Development tools.
I'm following the guides I can find and using my intuition, whilst trying not to modify too much from the original standard 'feline' template.
This template doesn't have a unique unit, however, and seeing as this seems like a no-brainer, this is the one thing I've attempted to do.
I have no idea what I'm doing.
Anyone able to help?
I only realised just now that this is why the mod won't work or show up at all - the code's not complete as this bit means literally nothing to it and does nothing and probably isn't even closed off with the whole </___> thing.
 
In your GameDefines:
Code:
--------------------------------------------------------------------------------------------------------------------------
-- LeaderTraits
--------------------------------------------------------------------------------------------------------------------------  
INSERT INTO LeaderTraits  
        (LeaderType,            TraitType)
VALUES    ('LEADER_CATLADY',    'TRAIT_LEADER_CATLADY_UNIT_CAT');
 

--==========================================================================================================================
-- Unit Cat
--==========================================================================================================================

--------------------------------------------------------------------------------------------------------------------------
-- Types
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO Types  
        (Type,                        Kind)
VALUES    ('UNIT_CAT',            'KIND_UNIT');

--------------------------------------------------------------------------------------------------------------------------
-- Units
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO Units
        (UnitType,                    Name,                         Description,                     TraitType,                                Combat, BaseMoves, Cost, AdvisorType, BaseSightRange, ZoneOfControl, Domain, FormationClass, PurchaseYield, PromotionClass, Maintenance, MandatoryObsoleteTech, PrereqTech)
SELECT     'UNIT_CAT',                'LOC_UNIT_CAT_NAME',    'LOC_UNIT_CAT_DESCRIPTION',    'TRAIT_LEADER_CATLADY_UNIT_CAT',    Combat,    BaseMoves, Cost, AdvisorType, BaseSightRange, ZoneOfControl, Domain, FormationClass, PurchaseYield, PromotionClass, Maintenance , MandatoryObsoleteTech, PrereqTech
FROM Units WHERE UnitType = 'UNIT_CATAPULT';

--------------------------------------------------------------------------------------------------------------------------
-- UnitUpgrades
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO UnitUpgrades
        (Unit,                    UpgradeUnit)
SELECT     'UNIT_CAT',            UpgradeUnit
FROM UnitUpgrades WHERE Unit = 'UNIT_CATAPULT';

--------------------------------------------------------------------------------------------------------------------------
-- UnitAiInfos
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO UnitAiInfos
        (UnitType,                AiType)
SELECT     'UNIT_CAT',            AiType
FROM UnitAiInfos WHERE UnitType = 'UNIT_CATAPULT';

--------------------------------------------------------------------------------------------------------------------------
-- UnitReplaces
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO UnitReplaces
        (CivUniqueUnitType,        ReplacesUnitType)
VALUES    ('UNIT_CAT',        'UNIT_CATAPULT');

--------------------------------------------------------------------------------------------------------------------------
-- TypeTags
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO TypeTags
        (Type,                    Tag)
SELECT     'UNIT_CAT',            Tag
FROM TypeTags WHERE Type = 'UNIT_CATAPULT';

In your Config:
Code:
INSERT INTO PlayerItems  
        (CivilizationType,                    LeaderType,                    Type,                                Icon,                                    Name,                                        Description,                                        SortIndex)
VALUES     ('CIVILIZATION_PERSIA',            'LEADER_CATLADY',        'UNIT_CAT',                      'ICON_UNIT_CAT',                      'LOC_UNIT_CAT_NAME',                    'LOC_UNIT_CAT_DESCRIPTION',                    10);

In your Text
Code:
        <!--Unit Cat-->
        <Row Tag="LOC_UNIT_CAT_NAME" Language="en_US">
            <Text>Cat</Text>
        </Row>
        <Row Tag="LOC_UNIT_CAT_DESCRIPTION" Language="en_US">
            <Text>Is usually furry.</Text>
        </Row>
        <Row Tag="LOC_PEDIA_UNITS_PAGE_UNIT_CAT_CHAPTER_HISTORY_PARA_1" Language="en_US">
            <Text>Placeholder</Text>
        </Row>

This doesn't address art, but that's another issue entirely.
 
Since you are starting I recommend you to use this tool to check out the available properties and values.

For instance search for RedCoat, then, when you find what you need, search in untis.xml and unitabilities.xml files of the base game.

That part is the properties but to make it run you will some more, but start with that.
 
Back
Top Bottom