1. Firaxis celebrates the "Asian American and Pacific Islander Heritage Month", and offers a give-away of a Civ6 anthology copy (5 in total)! For all the details, please check the thread here. .
    Dismiss Notice
  2. Old World has finally been released on GOG and Steam, besides also being available in the Epic store . Come to our Old World forum and discuss with us!
    Dismiss Notice

Trying to convert a Civ 4 unit to Civ 5 - Help needed

Discussion in 'Civ5 - Creation & Customization' started by KingErikII, Aug 4, 2020.

  1. KingErikII

    KingErikII Chieftain

    Joined:
    Apr 28, 2015
    Messages:
    52
    Gender:
    Male
    Location:
    Norway
    I am trying to convert a Civ 4 unit to Civ 5, namely the Maceman. I imported maceman.nif to NifSkope, and then exported it to .obj. Now I have the file open in Blender 2.79, and I am not sure what to do now.
    upload_2020-8-4_23-55-49.png
     
  2. KingErikII

    KingErikII Chieftain

    Joined:
    Apr 28, 2015
    Messages:
    52
    Gender:
    Male
    Location:
    Norway
  3. KingErikII

    KingErikII Chieftain

    Joined:
    Apr 28, 2015
    Messages:
    52
    Gender:
    Male
    Location:
    Norway
    This is how far I can get. I have rotated the model so it is standing, and joined it with the two mace meshes. I have also created a new UV map, copied the old one into the new one, and set the original map for the texture. However, it appears the texture is missing, so I don't know how to proceed now. The texture does work properly in NifSkope.
    upload_2020-8-5_13-40-18.png
     
  4. KingErikII

    KingErikII Chieftain

    Joined:
    Apr 28, 2015
    Messages:
    52
    Gender:
    Male
    Location:
    Norway
    I have gotten a lot further, but I get an error when trying to export to .br2:

    upload_2020-8-7_15-30-30.png


    I chose to use the Civ 5 Warrior as the template unit:

    upload_2020-8-7_15-30-36.png

    I don't think I understand the Weight Painting step:

    upload_2020-8-7_15-38-50.png


    upload_2020-8-7_15-38-58.png


    upload_2020-8-7_15-38-31.png
     
    Last edited by a moderator: Aug 7, 2020
  5. KingErikII

    KingErikII Chieftain

    Joined:
    Apr 28, 2015
    Messages:
    52
    Gender:
    Male
    Location:
    Norway
    Another update:
    I don't know how, but I was able to export the file to .br2, save it as .gr2 in Nexus Buddy 2, and now it shows up properly (?) in Granny Viewer:
    upload_2020-8-7_15-51-39.png
     
  6. KingErikII

    KingErikII Chieftain

    Joined:
    Apr 28, 2015
    Messages:
    52
    Gender:
    Male
    Location:
    Norway
    The model does not work in game yet:
    upload_2020-8-7_16-22-41.png

    I tried to create a .fxsxml file too, based on the default Civ 5 Warrior, but I am not sure if it looks right. This is the code:

    Code:
    <Asset>
        <Mesh file="maceman.gr2"/>
        <Animation file="Warrior_IdleA.gr2" ec="1000"/>
        <Animation file="Warrior_FidgetA.gr2" ec="1040"/>
        <Animation file="Warrior_IdleA_Trans_IdleB.gr2" ec="1020"/>
        <Animation file="Warrior_IdleB.gr2" ec="2000"/>
        <Animation file="Warrior_FidgetB.gr2" ec="2040"/>
        <Animation file="Warrior_IdleB_Trans_IdleA.gr2" ec="2020"/>
        <Animation file="Warrior_Fortify.gr2" ec="1500"/>
        <Animation file="Warrior_Fortify_Idle.gr2" ec="1520"/>
        <Animation file="Warrior_Fortify_Idle_Fidget.gr2" ec="1540"/>
        <Animation file="Warrior_Fortify_Idle_Trans_Combat_Ready_Idle.gr2" ec="1560"/>
        <Animation file="Warrior_Fortify_Idle_Trans_IdleA.gr2" ec="1580"/>
        <Animation file="Warrior_Combat_Ready.gr2" ec="1600"/>
        <Animation file="Warrior_Shuffle.gr2" ec="1450"/>
        <Animation file="Warrior_Combat_Ready_Idle.gr2" ec="1620"/>
        <Animation file="Warrior_Combat_Ready_Idle_Trans_IdleA.gr2" ec="1640"/>
        <Animation file="Warrior_Run.gr2" ec="1400"/>
        <Animation file="Warrior_Stop_Run.gr2" ec="1440"/>
        <Animation file="Warrior_Stop_Run_IdleB.gr2" ec="2440"/>
        <Animation file="Warrior_Charge_Run.gr2" ec="1120"/>
        <Animation file="Warrior_Charge_Attack.gr2" ec="1140"/>
        <Animation file="Warrior_AttackA.gr2" ec="1100"/>
        <Animation file="Warrior_AttackB.gr2" ec="2100"/>
        <Animation file="Warrior_Attack_City.gr2" ec="1160, 1180"/>
        <Animation file="Warrior_Victory.gr2" ec="1800"/>
        <Animation file="Warrior_Bombard_Defense.gr2" ec="1280"/>
        <Animation file="Warrior_Bombard_Defense_Idle.gr2" ec="1285"/>
        <Animation file="Warrior_Bombard_Defense_Idle_Trans_IdleA.gr2" ec="1290"/>
        <Animation file="Warrior_DeathA.gr2" ec="1200"/>
        <Animation file="Warrior_DeathA_Idle.gr2" ec="1220"/>
        <Animation file="Warrior_DeathB.gr2" ec="2200"/>
        <Animation file="Warrior_DeathB_Idle.gr2" ec="2220"/>
        <Texture file="Unit_Environment_Dull.dds"/>
        <Texture file="Unit_Environment_Sharp.dds"/>
        <Texture file="Unit_Irradiance.dds"/>
        <Texture file="maceman_128.dds"/>
        <Texture file="maceman_128_gloss.dds"/>
        <TimedTrigger file="FX_Triggers_Warrior.ftsxml"/>
        <BoneUsage>
            <Bone name="bone_CLUB"/>
            <Bone name="Base HumanSpine2"/>
            <Bone name="Base HumanRPalm"/>
        </BoneUsage>
        <AnimGraph file="RUN_CHARGE_SHUFFLE_TO_SHUFFLE_RUN_CHARGE.dge"/>
        <AnimGraph file="IDLE_OFFSET_CONTINUE_TRUE_GRAPH.dge"/>
        <AnimGraph file="FORTIFY_FIDGET_GRAPH.dge"/>
        <AnimGraph file="ENTER_FORTIFY.dge"/>
        <AnimGraph file="LEAVE_BOMBARD_DEFEND_TRANS_IDLE_A_GRAPH.dge"/>
        <AnimGraph file="DEATH_FINAL_GRAPH.dge"/>
        <AnimGraph file="BOMBARD_DEFEND_LOOP_GRAPH.dge"/>
        <AnimGraph file="ENTER_BOMBARD_DEFEND_GRAPH.dge"/>
        <AnimGraph file="DEATH_GRAPH.dge"/>
        <AnimGraph file="LEAVE_COMBAT_READY.dge"/>
        <AnimGraph file="ENTER_COMBAT_READY_GRAPH.dge"/>
        <AnimGraph file="FORTIFY_LEAVE_GRAPH.dge"/>
        <AnimGraph file="COMBAT_READY_GRAPH.dge"/>
        <AnimGraph file="FORTIFY_GRAPH.dge"/>
        <AnimGraph file="TRANSITIONS_FOR_IDLES.dge"/>
        <AnimGraph file="STOP_RUNNING.dge"/>
        <AnimGraph file="IDLE_GRAPH.dge"/>
        <AnimGraph file="FIDGETS_GRAPH.dge"/>
        <AnimGraph file="MELEE_ATTACKS.dge"/>
        <StateMachine file="1_OMNI_STATE_01.fsmxml"/>
        <AnimGraph file="RUN_CHARGE_SHUFFLE_LOOP.dge"/>
        <AnimGraph file="ATTACK_TO_RUN_CHARGE_SHUFFLE.dge"/>
        <AnimGraph file="ATTACK_CITY_TO_RUN_CHARGE_SHUFFLE.dge"/>
        <AnimGraph file="START_RUN_CHARGE_SHUFFLE.dge"/>
        <AnimGraph file="SHUFFLE_STOP_GRAPH.dge"/>
    </Asset>
    
    
     
  7. KingErikII

    KingErikII Chieftain

    Joined:
    Apr 28, 2015
    Messages:
    52
    Gender:
    Male
    Location:
    Norway
    Another problem:
    If I import the .gr2 file I just created into Nexus Buddy 2, and then try to export it to .nb2, I get this error:
    upload_2020-8-7_16-37-1.png

    I feel like I am close to getting the model working properly, but now I have no idea what to do.
     
  8. SLGray

    SLGray King

    Joined:
    May 18, 2015
    Messages:
    999
    Gender:
    Male
    Location:
    United Sates
    Is this replacing the warrior? If not, you will need to give it a code name in the coding and make sure that all files are connected to the correct images.

    P.S. Did you click the details and see what it said?
     
  9. KingErikII

    KingErikII Chieftain

    Joined:
    Apr 28, 2015
    Messages:
    52
    Gender:
    Male
    Location:
    Norway
    Oh, it's not replacing the warrior. I am not sure what the details in the message say either. Also, how do I make sure the images are connected to the model properly?

    Edit: Oh, and what do you mean by "code name"? The unit is already a separate, "fully" functioning unit (it having the atlas and flag of the Warrior does make it a bit confusing, yeah), just with no working model yet. So where should I give the unit a "code name"?

    Edit 2: Here's the ArtDefines code for my Maceman unit (I know writing the path to the .fxsxml file is redundant, but I like doing it so I know where everything is):

    Code:
        <!-- UNIT_MACEMAN ************************************************** -->
        <ArtDefine_UnitInfos>
            <Row>
                <Type>ART_DEF_UNIT_MACEMAN</Type>
                <Formation>DefaultMelee</Formation>
                <DamageStates>1</DamageStates>
            </Row>
        </ArtDefine_UnitInfos>
        <ArtDefine_UnitInfoMemberInfos>
            <Row>
                <UnitInfoType>ART_DEF_UNIT_MACEMAN</UnitInfoType>
                <UnitMemberInfoType>ART_DEF_UNIT_MEMBER_MACEMAN</UnitMemberInfoType>
                <NumMembers>12</NumMembers>
            </Row>
        </ArtDefine_UnitInfoMemberInfos>
        <ArtDefine_UnitMemberInfos>
            <Row>
                <Type>ART_DEF_UNIT_MEMBER_MACEMAN</Type>
                <Scale>0.14</Scale>
                <Model>Art/Maceman/maceman.fxsxml</Model>
                <MaterialTypeTag>CLOTH</MaterialTypeTag>
                <MaterialTypeSoundOverrideTag>FLESH</MaterialTypeSoundOverrideTag>
            </Row>
        </ArtDefine_UnitMemberInfos>
        <ArtDefine_UnitMemberCombats>
            <Row>
                <UnitMemberType>ART_DEF_UNIT_MEMBER_MACEMAN</UnitMemberType>
                <EnableActions>Idle Attack RunCharge AttackCity Bombard Death BombardDefend Run Fortify CombatReady Walk AttackCharge</EnableActions>
                <ShortMoveRadius>12.0</ShortMoveRadius>
                <ShortMoveRate>0.35</ShortMoveRate>
                <TargetHeight>8.0</TargetHeight>
                <HasRefaceAfterCombat>1</HasRefaceAfterCombat>
                <ReformBeforeCombat>1</ReformBeforeCombat>
            </Row>
        </ArtDefine_UnitMemberCombats>
        <ArtDefine_UnitMemberCombatWeapons>
            <Row>
                <UnitMemberType>ART_DEF_UNIT_MEMBER_MACEMAN</UnitMemberType>
                <Index>0</Index>
                <SubIndex>0</SubIndex>
                <WeaponTypeTag>METAL</WeaponTypeTag>
                <WeaponTypeSoundOverrideTag>SWORD</WeaponTypeSoundOverrideTag>
            </Row>
        </ArtDefine_UnitMemberCombatWeapons>
        <ArtDefine_StrategicView>
            <Row>
                <StrategicViewType>ART_DEF_UNIT_MACEMAN</StrategicViewType>
                <TileType>Unit</TileType>
                <Asset>SV_Warrior.dds</Asset>
            </Row>
        </ArtDefine_StrategicView>

    Edit 3:
    Here's the full Nexus Buddy 2 error:

    Code:
    See the end of this message for details on invoking
    just-in-time (JIT) debugging instead of this dialog box.
    
    ************** Exception Text **************
    System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index
       at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
       at System.Collections.Generic.List`1.get_Item(Int32 index)
       at NexusBuddy.FileOps.NB2Exporter.exportNB2Model(IGrannyFile grannyFile, Int32 modelId) in D:\mod\gitprojects\Nexus-Buddy-2\NexusBuddy\NexusBuddy\FileOps\NB2Exporter.cs:line 265
       at NexusBuddy.NexusBuddyApplicationForm.exportNB2CurrentModelButtonClick(Object sender, EventArgs e) in D:\mod\gitprojects\Nexus-Buddy-2\NexusBuddy\NexusBuddy\NexusBuddyApplicationForm.cs:line 1733
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ButtonBase.WndProc(Message& m)
       at System.Windows.Forms.Button.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    
    
    ************** Loaded Assemblies **************
    mscorlib
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.4180.0 built by: NET48REL1LAST_B
        CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
    ----------------------------------------
    NexusBuddy2
        Assembly Version: 0.0.0.0
        Win32 Version: 0.0.0.0
        CodeBase: file:///C:/Users/erik/Desktop/Civ%205%20modding/Nexus%20Buddy%202/NexusBuddy2.exe
    ----------------------------------------
    System.Windows.Forms
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.4150.0 built by: NET48REL1LAST_C
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.4001.0 built by: NET48REL1LAST_C
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Drawing
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.3752.0 built by: NET48REL1
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    Firaxis.Framework.Granny
        Assembly Version: 1.0.0.0
        Win32 Version: 1.0.0.0
        CodeBase: file:///C:/Users/erik/Desktop/Civ%205%20modding/Nexus%20Buddy%202/Firaxis.Framework.Granny.DLL
    ----------------------------------------
    System.Core
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.4180.0 built by: NET48REL1LAST_B
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
    ----------------------------------------
    Firaxis.Framework
        Assembly Version: 1.0.0.0
        Win32 Version: 1.0.0.0
        CodeBase: file:///C:/Users/erik/Desktop/Civ%205%20modding/Nexus%20Buddy%202/Firaxis.Framework.DLL
    ----------------------------------------
    System.Configuration
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.4190.0 built by: NET48REL1LAST_B
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    ----------------------------------------
    System.Xml
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.3752.0 built by: NET48REL1
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------
    System.DirectoryServices
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.3752.0 built by: NET48REL1
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.DirectoryServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.DirectoryServices.dll
    ----------------------------------------
    Firaxis.Framework.Granny.ImplWin32
        Assembly Version: 1.0.0.0
        Win32 Version:
        CodeBase: file:///C:/Users/erik/Desktop/Civ%205%20modding/Nexus%20Buddy%202/Firaxis.Framework.Granny.ImplWin32.DLL
    ----------------------------------------
    Firaxis.Framework.FirePlace
        Assembly Version: 1.0.0.0
        Win32 Version: 1.0.0.0
        CodeBase: file:///C:/Users/erik/Desktop/Civ%205%20modding/Nexus%20Buddy%202/Firaxis.Framework.FirePlace.DLL
    ----------------------------------------
    msvcm90
        Assembly Version: 9.0.30729.9619
        Win32 Version: 9.00.30729.9619
        CodeBase: file:///C:/WINDOWS/WinSxS/x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.9619_none_508d9c7abcbd32b6/msvcm90.dll
    ----------------------------------------
    PresentationCore
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.4180.0 built by: NET48REL1LAST_B
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/PresentationCore/v4.0_4.0.0.0__31bf3856ad364e35/PresentationCore.dll
    ----------------------------------------
    WindowsBase
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.4180.0 built by: NET48REL1LAST_B
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/WindowsBase/v4.0_4.0.0.0__31bf3856ad364e35/WindowsBase.dll
    ----------------------------------------
    
    ************** JIT Debugging **************
    To enable just-in-time (JIT) debugging, the .config file for this
    application or computer (machine.config) must have the
    jitDebugging value set in the system.windows.forms section.
    The application must also be compiled with debugging
    enabled.
    
    For example:
    
    <configuration>
        <system.windows.forms jitDebugging="true" />
    </configuration>
    
    When JIT debugging is enabled, any unhandled exception
    will be sent to the JIT debugger registered on the computer
    rather than be handled by this dialog box.
     
    Last edited: Aug 7, 2020
  10. KingErikII

    KingErikII Chieftain

    Joined:
    Apr 28, 2015
    Messages:
    52
    Gender:
    Male
    Location:
    Norway
    Well, this is pretty funny. Instead of being invisible, my unit's model now glitches and flashes like a rave party. I do not know what is causing this:

    upload_2020-8-7_22-41-45.png
     
  11. KingErikII

    KingErikII Chieftain

    Joined:
    Apr 28, 2015
    Messages:
    52
    Gender:
    Male
    Location:
    Norway
    Now the weird texture rave is at least using the correct texture:

    upload_2020-8-7_23-0-7.png


    For more context, here are some screenshots of my .gr2 file in Nexus Buddy 2:

    upload_2020-8-7_23-1-25.png

    upload_2020-8-7_23-1-38.png
     
  12. KingErikII

    KingErikII Chieftain

    Joined:
    Apr 28, 2015
    Messages:
    52
    Gender:
    Male
    Location:
    Norway
    I am currently stuck, so it would be nice if a more experienced modder could review and comment on this. Maybe @Wolfdog ?

    Edit:
    I have attached a .zip file containing a .gr2 file, a .br2 file, a .blend file, and some other files that may be relevant (like texture files), so my process becomes easier to review.
     

    Attached Files:

    Last edited: Aug 7, 2020
  13. KingErikII

    KingErikII Chieftain

    Joined:
    Apr 28, 2015
    Messages:
    52
    Gender:
    Male
    Location:
    Norway
    This is how the model currently looks in Nexus Buddy 2 and Granny Viewer:

    upload_2020-8-8_13-27-15.png

    upload_2020-8-8_13-27-23.png

    upload_2020-8-8_13-27-29.png
     
  14. KingErikII

    KingErikII Chieftain

    Joined:
    Apr 28, 2015
    Messages:
    52
    Gender:
    Male
    Location:
    Norway
    Another update:
    I was able to export the .gr2 to .nb2 in Nexus Buddy 2 and import it in Blender, but it doesn't have any textures:

    upload_2020-8-8_13-34-23.png

    upload_2020-8-8_13-34-34.png
     
  15. KingErikII

    KingErikII Chieftain

    Joined:
    Apr 28, 2015
    Messages:
    52
    Gender:
    Male
    Location:
    Norway
    The texture does work in game (here it's applied on a default Warrior model) :

    upload_2020-8-8_15-11-30.png

    So what I need to do now is figure out how to make the model work properly...
     
  16. KingErikII

    KingErikII Chieftain

    Joined:
    Apr 28, 2015
    Messages:
    52
    Gender:
    Male
    Location:
    Norway
    Another funny update:
    I was able to copy the default Warrior's vertex groups over to the Maceman, and now the unit looks like this in game:

    upload_2020-8-8_21-45-59.png

    I will still continue to try to fix the model. I will also attach an updated .zip file in this post, containing the most recent files in case more experienced users want to help.

    Edit: Updated the new .zip file. Now it also includes the latest .fxsxml file that I use for the unit.
     

    Attached Files:

    Last edited: Aug 8, 2020
  17. KingErikII

    KingErikII Chieftain

    Joined:
    Apr 28, 2015
    Messages:
    52
    Gender:
    Male
    Location:
    Norway
    The unit also looks weird if I view the EventCodes in the Nexus 3D Viewer. What could be causing this? Improper rigging (I don't really know how to rig properly)?

    upload_2020-8-9_17-40-56.png

    upload_2020-8-9_17-41-16.png
     
  18. KingErikII

    KingErikII Chieftain

    Joined:
    Apr 28, 2015
    Messages:
    52
    Gender:
    Male
    Location:
    Norway
    Huge update!
    The unit looks a lot better, but not 100% right yet, in the Nexus 3D Viewer:
    upload_2020-8-15_21-3-10.png

    upload_2020-8-15_21-3-16.png

    Now I should try to fix the weapon's location.
     

Share This Page