[BNW] Help with Ethnic Units Worker Graphics

NO_Body

Chieftain
Joined
Oct 25, 2017
Messages
19
Recently, Since there are so many custom units available here, i have been trying to make my own fantasy theme like the Ethnic Units mod.
So far i have managed to update most units i needed with Dwarf Graphics.

Anyhow, i Cant seam to figure out how to make the Worker unit Work.

This is as far as i managed to figure out:
Code:
UPDATE Units SET UnitArtInfoCulturalVariation = 1 WHERE Type = 'UNIT_WORKER';

-- DARF WORKER
INSERT INTO "ArtDefine_UnitInfos" ('Type','DamageStates','Formation')
    SELECT    ("ART_DEF_UNIT__WORKER_DARF"), "1", "LooseCivilian"
    FROM "ArtDefine_UnitInfos" WHERE (Type = "ART_DEF_UNIT__WORKER");
INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
    SELECT    ("ART_DEF_UNIT__WORKER_DARF"), ("ART_DEF_UNIT_MEMBER_DARF_WORKER"), "8"
    FROM "ArtDefine_UnitInfoMemberInfos" WHERE (UnitInfoType = "ART_DEF_UNIT__WORKER");
INSERT INTO "ArtDefine_UnitMemberCombats" ('UnitMemberType', 'EnableActions', 'DisableActions', 'MoveRadius', 'ShortMoveRadius', 'ChargeRadius', 'AttackRadius', 'RangedAttackRadius', 'MoveRate', 'ShortMoveRate', 'TurnRateMin', 'TurnRateMax', 'TurnFacingRateMin', 'TurnFacingRateMax', 'RollRateMin', 'RollRateMax', 'PitchRateMin', 'PitchRateMax', 'LOSRadiusScale', 'TargetRadius', 'TargetHeight', 'HasShortRangedAttack', 'HasLongRangedAttack', 'HasLeftRightAttack', 'HasStationaryMelee', 'HasStationaryRangedAttack', 'HasRefaceAfterCombat', 'ReformBeforeCombat', 'HasIndependentWeaponFacing', 'HasOpponentTracking', 'HasCollisionAttack', 'AttackAltitude', 'AltitudeDecelerationDistance', 'OnlyTurnInMovementActions', 'RushAttackFormation')
    SELECT    ("ART_DEF_UNIT_MEMBER_DARF_WORKER"), "Idle Death BombardDefend Run", "DisableActions", "MoveRadius", "ShortMoveRadius", "ChargeRadius", "AttackRadius", "RangedAttackRadius",
            "MoveRate", "ShortMoveRate", "TurnRateMin", "TurnRateMax", "TurnFacingRateMin", "TurnFacingRateMax", "RollRateMin", "RollRateMax", "PitchRateMin", "PitchRateMax", "LOSRadiusScale", "TargetRadius", "TargetHeight", "HasShortRangedAttack", "HasLongRangedAttack", "HasLeftRightAttack", "HasStationaryMelee", "HasStationaryRangedAttack", "1", "ReformBeforeCombat", "HasIndependentWeaponFacing", "HasOpponentTracking", "HasCollisionAttack", "AttackAltitude", "AltitudeDecelerationDistance", "OnlyTurnInMovementActions", "RushAttackFormation"
    FROM "ArtDefine_UnitMemberCombats" WHERE (UnitMemberType = "ART_DEF_UNIT_MEMBER_WORKER");
INSERT INTO "ArtDefine_UnitMemberCombatWeapons" ('UnitMemberType', 'Index', 'SubIndex', 'ID', 'VisKillStrengthMin', 'VisKillStrengthMax', 'ProjectileSpeed', 'ProjectileTurnRateMin', 'ProjectileTurnRateMax', 'HitEffect', 'HitEffectScale', 'HitRadius', 'ProjectileChildEffectScale', 'AreaDamageDelay', 'ContinuousFire', 'WaitForEffectCompletion', 'TargetGround', 'IsDropped', 'WeaponTypeTag', 'WeaponTypeSoundOverrideTag')
    SELECT ("ART_DEF_UNIT_MEMBER_DARF_WORKER"), "Index", "SubIndex", "ID", "VisKillStrengthMin", "VisKillStrengthMax", "ProjectileSpeed", "ProjectileTurnRateMin", "ProjectileTurnRateMax", "HitEffect", "HitEffectScale", "HitRadius", "ProjectileChildEffectScale", "AreaDamageDelay", "ContinuousFire", "WaitForEffectCompletion", "TargetGround", "IsDropped", "WeaponTypeTag", "WeaponTypeSoundOverrideTag"
    FROM "ArtDefine_UnitMemberCombatWeapons" WHERE (UnitMemberType = "ART_DEF_UNIT_MEMBER_WORKER");
INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
    SELECT    ("ART_DEF_UNIT_MEMBER_DARF_WORKER"), "0.16", "ZOffset", "Domain",
            ("orc_worker.fxsxml"), "CLOTH", "FLESH"
    FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_WORKER");
It ether turns invisible, or it doesn't work at all, aka stays the regular worker.
(The Civ Art style is called "DARF" the orc worker is just a unit i used for testing)
and i believe the dual __ is part of the ART_DEF_UNIT__WORKER name, it was that way in the CIV V folder.


I'm not that good at programing, so far i learned by looking at other codes from the game/mods.
Also since i'm here, I suspect the "Settlers" will also be difficult to edit, so any pointers on that?
 
Last edited:
Sorry, I realize this was posted some time ago, but in case you haven't figured it out, or someone else happens upon this thread... The problem is that UNIT_WORKER has UnitArtInfoEraVariation enabled in the Units table. You can't have BOTH era and cultural variation, and the era setting trumps cultural. (Note you could roll your own function in Lua to do era variation without using the built-in method and get both that way.) Settlers, being the only base unit in the game that actually uses cultural variation, are fine to add new cultural unit art.

TL;DR: You need to set <UnitArtInfoEraVariation> to 0 and <UnitArtInfoCulturalVariation> to 1 for UNIT_WORKER in the <Units> table to get cultural variation to work.
 
Top Bottom