1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Using "Improvement" Graphics as Unit Graphics

Discussion in 'Civ4 - Creation & Customization' started by LPlate2, Jul 8, 2020.

  1. LPlate2

    LPlate2 Warlord

    Joined:
    Dec 27, 2018
    Messages:
    112
    Hi,

    There's a couple of graphics, which were uploaded to the database as improvement graphics, which I want to use as units;
    @dacubz145's Flag Pole, which I'm using as to stake a claim to territory, which is outside of the cultural borders claimed by a city and
    @Himan's rotating rune veil node, which I'm trying to base several glyph/rune units on, one of which grants visibility of the adjacent tiles.

    The xml for the flag art unit is,
    Spoiler :
    Code:
            <UnitArtInfo>
                <Type>ART_DEF_UNIT_STAKE_CLAIM</Type>
                <Button>Art/Interface/Buttons/Unit/claimterritory.dds</Button>
                <fScale>0.2</fScale>
                <fInterfaceScale>0.5</fInterfaceScale>
                <bActAsLand>0</bActAsLand>
                <bActAsAir>0</bActAsAir>
                <NIF>Art/Units/Flag/flagpole.nif</NIF>
               <KFM/>
                <ShadowDef>
                    <ShadowNIF>Art/Units/Flag/flagpole.nif</ShadowNIF>
                    <ShadowAttachNode>BIP Pelvis</ShadowAttachNode>
                    <fShadowScale>1</fShadowScale>
                </ShadowDef>
                <iDamageStates>0</iDamageStates>
                    <fBattleDistance>0.35</fBattleDistance>
                    <fRangedDeathTime>0.31</fRangedDeathTime>
                    <bActAsRanged>0</bActAsRanged>
                <AudioRunSounds>
                    <AudioRunTypeLoop>LOOPSTEP_OCEAN2</AudioRunTypeLoop>
                    <AudioRunTypeEnd>ENDSTEP_OCEAN2</AudioRunTypeEnd>
                </AudioRunSounds>
                <SelectionSound>AS3D_UN_OCEAN_END1</SelectionSound>
                <ActionSound>AS3D_UN_OCEAN_END1</ActionSound>
            </UnitArtInfo>

    Most of the CIV4ArtDefines_Improvement.xml copies straight across to the CIV4ArtDefines_Unit.xml There was no kfm with the improvement art downloads, so I had to insert a blank kfm line.

    Essentially it works, but there's a slight ghost image, so that there appears to be two flags, when you zoom in.
    With the rotating rune, again it works and rotates but there again appears to be a ghost image (two rings at base of obelisks).

    What would I need to do to fix this?


    -----
    On a separate query, how can I get the civilization's colour to show on units' graphics?
    I tried replacing all of the black in my flag graphic with transparency but it still comes up as black.
     

    Attached Files:

  2. SaibotLieh

    SaibotLieh Emperor

    Joined:
    Sep 25, 2009
    Messages:
    1,481
    My guess would be that your shadow definition is the problem, since you define the unit nif as its own shadow. Maybe try this instead:
    Code:
    <ShadowNIF>Art/Units/01_UnitShadows/UnitShadow.nif</ShadowNIF>
    
    For the team colour, the NiTexturingProperty of the mesh needs to be set up accordingly. Try the attached version of the flag, I think it should work that way.

    Hope this helps. :)
     

    Attached Files:

    Leoreth likes this.
  3. LPlate2

    LPlate2 Warlord

    Joined:
    Dec 27, 2018
    Messages:
    112
    Thanks, that sorted both issues.
     
    SaibotLieh likes this.

Share This Page