MasterKulon

Chieftain
Joined
Jun 9, 2011
Messages
8
I am making a combat unit that has one build charge for any improvement that a builder can make (comparable to the Roman Legion). Everything seems functional so far, but I am getting a visual problem. The unit starts with only one guy visible, and he turns invisible after using the build charge. However, the unit is still alive and can move and attack as normal. I think the number of visible models is linked to the number of build charges rather than unit health, but I don't know how to fix this. Any advice would be appreciated. Here is my code:

Code:
-----------------------------------------------
-- Types
-----------------------------------------------  
   
INSERT INTO Types
        (Type,                                        Kind            )
VALUES    ('TRAIT_CIVILIZATION_CUSTOM_UNIT',        'KIND_TRAIT'    ),
        ('UNIT_CUSTOM_UNIT',                        'KIND_UNIT'        ),
        ('ABILITY_CUSTOM_UNIT',                    'KIND_ABILITY'    );

-----------------------------------------------
-- Tags
-----------------------------------------------  
   
INSERT INTO Tags
        (Tag,                        Vocabulary        )
VALUES    ('CLASS_CUSTOM_UNIT',    'ABILITY_CLASS'    );

-----------------------------------------------
-- TypeTags
-----------------------------------------------      

INSERT INTO TypeTags
        (Type,                        Tag                        )
VALUES    ('UNIT_CUSTOM_UNIT',        'CLASS_CUSTOM_UNIT'    ),
        ('ABILITY_CUSTOM_UNIT',    'CLASS_CUSTOM_UNIT'    );

INSERT INTO TypeTags (Type,        Tag)
SELECT     'UNIT_CUSTOM_UNIT',    Tag
FROM     TypeTags
WHERE     Type = 'UNIT_WARRIOR';

-----------------------------------------------
-- Traits
-----------------------------------------------
       
INSERT INTO Traits
        (TraitType,                                Name                            )
VALUES    ('TRAIT_CIVILIZATION_CUSTOM_UNIT',    'LOC_UNIT_CUSTOM_UNIT_NAME'    );

-----------------------------------------------
-- CivilizationTraits
-----------------------------------------------
       
INSERT INTO CivilizationTraits
        (CivilizationType,                TraitType                            )
VALUES    ('CIVILIZATION_CUSTOM_CIV',    'TRAIT_CIVILIZATION_CUSTOM_UNIT'    );

-----------------------------------------------
-- Units
-----------------------------------------------  
   
INSERT INTO Units    (
        UnitType,
        Name,
        Description,
        TraitType,
        BaseMoves,
        Cost,
        PurchaseYield,
        AdvisorType,
        Combat,
        RangedCombat,
        Range,
        BaseSightRange,
        ZoneOfControl,
        Domain,
        FormationClass,
        PromotionClass,
        Maintenance,
        MandatoryObsoleteTech,
        PrereqTech,
        PrereqCivic,
        BuildCharges
        )
SELECT    'UNIT_CUSTOM_UNIT',    -- UnitType
        'LOC_UNIT_CUSTOM_UNIT_NAME',    -- Name
        'LOC_UNIT_CUSTOM_UNIT_DESCRIPTION', -- Description
        'TRAIT_CIVILIZATION_CUSTOM_UNIT', -- TraitType
        BaseMoves,
        Cost,
        PurchaseYield,
        AdvisorType,
        Combat,
        RangedCombat,
        Range,
        BaseSightRange,
        ZoneOfControl,
        Domain,
        FormationClass,
        PromotionClass,
        Maintenance,
        MandatoryObsoleteTech,
        PrereqTech,
        PrereqCivic,
        1
FROM    Units
WHERE    UnitType = 'UNIT_WARRIOR';

-----------------------------------------------
-- UnitUpgrades
-----------------------------------------------
       
INSERT INTO UnitUpgrades (Unit,    UpgradeUnit)
SELECT     'UNIT_CUSTOM_UNIT',    UpgradeUnit
FROM     UnitUpgrades
WHERE    Unit = 'UNIT_WARRIOR';

-----------------------------------------------
-- UnitAiInfos
-----------------------------------------------
       
INSERT INTO UnitAiInfos (UnitType,    AiType)
SELECT     'UNIT_CUSTOM_UNIT',        AiType
FROM     UnitAiInfos
WHERE     UnitType = 'UNIT_ROMAN_LEGION';
       
-----------------------------------------------
-- UnitReplaces
-----------------------------------------------
       
INSERT INTO UnitReplaces
        (CivUniqueUnitType,        ReplacesUnitType    )
VALUES    ('UNIT_CUSTOM_UNIT',    'UNIT_WARRIOR'        );

-----------------------------------------------
-- UnitAbilities
-----------------------------------------------

INSERT INTO UnitAbilities
        (UnitAbilityType,            Name,                                Description                                    )
VALUES    ('ABILITY_CUSTOM_UNIT',    'LOC_ABILITY_CUSTOM_UNIT_NAME',    'LOC_ABILITY_CUSTOM_UNIT_DESCRIPTION'    );

-- Improvement_ValidBuildUnits
-- Allow unit to build any improvement a builder can
INSERT INTO Improvement_ValidBuildUnits (ImprovementType, UnitType)
SELECT ImprovementType, 'UNIT_CUSTOM_UNIT'
FROM Improvement_ValidBuildUnits
WHERE UnitType = 'UNIT_BUILDER';
 
Last edited:
Have you tested if adding more build charges creates more visible units? I can't recall how it works with Legions or Toa, but do you lose a "member" of the unit when they build an improvement?

As far as the starting number of units, there's a setting when creating the artdef which determines that (Unit>Members , if I recall). Have you already created an artdef for your unique unit in the Asset Editor?
 
Adding more build charges does create more visible units, and using a charge removes a member if there are less than four charges remaining. I had not made an artdef yet, but I can't open the asset editor (This is my first time modding Civ 6, and I only have a little bit of experience from modding Civ 5). It crashes on startup. I can't see the log in the startup window because it closes seconds after a window appears saying it crashed. Are crash logs for the asset editor stored somewhere?
 
Hm... I have heard that the Asset Editor can be buggy. Maybe it crashes because it hasn't had its file path set properly? In the modbuddy Tools>Options you can find the 'Civilization 6 SDK Asset Paths' and you want to make sure that goes to the proper folder. Oh, and if you haven't downloaded the SDK Assets, you'll want to do that to. It tripped me up when I started since I didn't realize it was a different download. You can find that also on steam if you don't already have it.
 
The SDK Assets are downloaded, and path is set to the "Sid Meier's Civilization VI SDK Assets" folder in the directory with all my steam installs ("steamapps\common").
 
If your OS is not in English, you can't use it, apparently an issue with how .NET Frameworks deals with translation packages. No idea if it's something Fireaxis could solve, but even if it was...
So if you are in that case you can either set your OS in English, have a virtual machine with an English OS or get fudged for asset editing.
 
Last edited:
My OS is in English. I have heard the Asset Editor uses a lot of memory. In addition to RAM, does it also need hard drive memory for the initial startup? I currently only have 12GB free on my hard drive, so if it is trying to install anything I may not have enough space.
 
At first, I was gonna say "it can't possible need that much space", but then I checked the folder properties on my side and it's like 36 gb. So yeah, that might be the problem, haha.
 
I have 39GB free now and it still crashes, so I guess hard drive memory isn't the problem. As for RAM, I've tried closing all other applications before opening the asset editor and that doesn't work either.
 
I still haven't been able to open the Asset Editor, but I managed to fix my problem. I directly copied the Warrior element from Units.artdef and found a parameter called DoNotDisplayCharges. I set that to true and there are now four members no matter the number of remaining build charges.
 
Top Bottom