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

[BNW] Help in modding Civ BE Units in Civ V

Discussion in 'Civ5 - Creation & Customization' started by Electric_Gamers, Oct 15, 2018.

?

With or without Aliens?

  1. With

    69.2%
  2. Without

    7.7%
  3. Without, but replace the Harmony Special Units with the GDR and/or the XCOM

    7.7%
  4. With but call them Mutants

    15.4%
  1. Electric_Gamers

    Electric_Gamers Chieftain

    Joined:
    Oct 15, 2018
    Messages:
    61
    Gender:
    Male
    Location:
    Portugal
    Hi, I'm new (as a member) to the CivFanatics center and thus I don't know if this is the correct sub-forum to post-this.

    Ok, so I have both Civ V and Civ Beyond Earth installed and since they use the same game engine I figured out if I could make a futuristic mod for Civ V using the units from BE.
    (Kind of a Late-Game expansion, where you would upgrade the Modern Armor to the hover tanks of BE and the other units, using new Techs, and some of the latest ones, i.e. Particle Physics -> Tanks; Nano Tech -> Soldiers; Nuclear Fusion -> Ships, being the three afinnities unlockable at the same tech but with different stats, making the choice a matter of strategy.)

    However, to test the unit adding method, I decided to test only one unit, the Combat Rover (cavalry01). I managed to change the stats and make it spawn in-game, but when I select it (using IGE to spawn it) it appears, and moves, and sounds, like pikemen. (The stats have changed to what I set, though.) I've tried different approaches on the ArtDef and ArtDefMember files to select the .fxsxml from civ BE that I put inside the mod folder (shown below) but for some reason none of it works...

    Could anyone please tell me what I am doing wrong and how do I fix this issue?
    Cheers!
    Note: Here are some of the tutorials I followed.
    Add a new unit in the game (using SQL) by Gedemon
    HOWTO: New Unit Creation by lemmy101


    My main xml file:

    "
    <?xml version="1.0" encoding="utf-8"?>
    <!-- Created by ModBuddy on 10/14/2018 2:04:51 PM -->
    <GameData>

    <!-- My Unit -->
    <UnitClasses>
    <Row>
    <Type>UNITCLASS_CAVALRY01</Type>
    <Description>TXT_KEY_UNIT_CAVALRY01</Description>
    <DefaultUnit>UNIT_CAVALRY01</DefaultUnit>
    </Row>
    </UnitClasses>
    <Units>
    <Row>
    <Class>UNITCLASS_CAVALRY01</Class>
    <Type>UNIT_CAVALRY01</Type>
    <PrereqTech>TECH_PARTICLE_PHYSICS</PrereqTech>
    <Combat>85</Combat>
    <Cost>450</Cost>
    <Moves>3</Moves>
    <Range>4</Range>
    <CombatClass>UNITCOMBAT_ARMOR</CombatClass>
    <Domain>DOMAIN_LAND</Domain>
    <DefaultUnitAI>UNITAI_FAST_ATTACK</DefaultUnitAI>
    <Description>TXT_KEY_UNIT_CAVALRY01</Description>
    <Civilopedia>TXT_KEY_CIV5_ANTIQUITY_CAVALRY01_TEXT</Civilopedia>
    <Strategy>TXT_KEY_UNIT_CAVALRY01_STRATEGY</Strategy>
    <Help>TXT_KEY_UNIT_HELP_CAVALRY01</Help>
    <MilitarySupport>true</MilitarySupport>
    <MilitaryProduction>true</MilitaryProduction>
    <Pillage>true</Pillage>
    <ObsoleteTech></ObsoleteTech>
    <AdvancedStartCost>80</AdvancedStartCost>
    <XPValueAttack>3</XPValueAttack>
    <XPValueDefense>3</XPValueDefense>
    <UnitArtInfo>ART_DEF_UNIT_CAVALRY01</UnitArtInfo>
    <UnitFlagIconOffset>0</UnitFlagIconOffset>
    <IconAtlas>TECH_ATLAS_1</IconAtlas>
    <PortraitIndex>0</PortraitIndex>
    </Row>
    </Units>
    <Unit_AITypes>
    <Row>
    <UnitType>UNIT_CAVALRY01</UnitType>
    <UnitAIType>UNITAI_FAST_ATTACK</UnitAIType>
    </Row>
    <Row>
    <UnitType>UNIT_CAVALRY01</UnitType>
    <UnitAIType>UNITAI_DEFENSE</UnitAIType>
    </Row>
    </Unit_AITypes>
    <Unit_ClassUpgrades>
    </Unit_ClassUpgrades>
    <Unit_Flavors>
    <Row>
    <UnitType>UNIT_CAVALRY01</UnitType>
    <FlavorType>FLAVOR_DEFENSE</FlavorType>
    <Flavor>10</Flavor>
    </Row>
    <Row>
    <UnitType>UNIT_CAVALRY01</UnitType>
    <FlavorType>FLAVOR_OFFENSE</FlavorType>
    <Flavor>20</Flavor>
    </Row>
    <Row>
    <UnitType>UNIT_CAVALRY01</UnitType>
    <FlavorType>FLAVOR_MOBILE</FlavorType>
    <Flavor>12</Flavor>
    </Row>
    </Unit_Flavors>
    <Unit_FreePromotions>
    <Row>
    <UnitType>UNIT_CAVALRY01</UnitType>
    <PromotionType>PROMOTION_ONLY_DEFENSE</PromotionType>
    </Row>
    </Unit_FreePromotions>
    <Language_en_US>
    <Row Tag="TXT_KEY_UNIT_CAVALRY01">
    <Text>Cavalry</Text>
    </Row>
    <Row Tag="TXT_KEY_UNIT_HELP_CAVALRY01">
    <Text>help</Text>
    </Row>
    <Row Tag="TXT_KEY_CIV5_ANTIQUITY_CAVALRY01_TEXT">
    <Text>historical info</Text>
    </Row>
    <Row Tag="TXT_KEY_UNIT_CAVALRY01_STRATEGY">
    <Text>strategy</Text>
    </Row>
    </Language_en_US>
    </GameData>
    "
    My ArtDef File
    "
    <?xml version="1.0" encoding="utf-8"?>
    <GameData>
    <ArtDefine_UnitInfos>
    <Row>
    <Type>ART_DEF_UNIT_CAVALRY01</Type>
    <DamageStates>1</DamageStates>
    <Formation>Vehicle</Formation>
    </Row>
    </ArtDefine_UnitInfos>
    <ArtDefine_UnitInfoMemberInfos>
    <Row>
    <UnitInfoType>ART_DEF_UNIT_CAVALRY01</UnitInfoType>
    <UnitMemberInfoType>ART_DEF_UNIT_MEMBER_CAVALRY01</UnitMemberInfoType>
    <NumMembers>3</NumMembers>
    </Row>
    </ArtDefine_UnitInfoMemberInfos>
    <ArtDefine_UnitMemberInfos>
    <Row>
    <Type>ART_DEF_UNIT_MEMBER_CAVALRY01</Type>
    <Scale>0.100000001490116</Scale>
    <Model>cavalry01.fxsxml</Model>
    <MaterialTypeTag>METAL</MaterialTypeTag>
    <MaterialTypeSoundOverrideTag>METALSM</MaterialTypeSoundOverrideTag>
    </Row>
    </ArtDefine_UnitMemberInfos>
    <ArtDefine_UnitMemberCombats>
    <Row>
    <UnitMemberType>ART_DEF_UNIT_MEMBER_CAVALRY01</UnitMemberType>
    <EnableActions>Idle Attack RunCharge AttackCity Bombard Death BombardDefend Run Fortify CombatReady</EnableActions>
    <HasShortRangedAttack>1</HasShortRangedAttack>
    <HasStationaryMelee>1</HasStationaryMelee>
    <HasRefaceAfterCombat>0</HasRefaceAfterCombat>
    <ReformBeforeCombat>1</ReformBeforeCombat>
    <HasIndependentWeaponFacing>1</HasIndependentWeaponFacing>
    </Row>
    </ArtDefine_UnitMemberCombats>
    <ArtDefine_UnitMemberCombatWeapons>
    <Row>
    <UnitMemberType>ART_DEF_UNIT_MEMBER_CAVALRY01</UnitMemberType>
    <Index>0</Index>
    <SubIndex>0</SubIndex>
    <VisKillStrengthMin>25.0</VisKillStrengthMin>
    <VisKillStrengthMax>50.0</VisKillStrengthMax>
    <HitEffect>ART_DEF_VEFFECT_TANK_IMPACT_$(TERRAIN)</HitEffect>
    <WeaponTypeTag>EXPLOSIVE</WeaponTypeTag>
    <WeaponTypeSoundOverrideTag>EXPLOSION20POUND</WeaponTypeSoundOverrideTag>
    </Row>
    </ArtDefine_UnitMemberCombatWeapons>
    <ArtDefine_StrategicView>
    <Row>
    <StrategicViewType>ART_DEF_UNIT_CAVALRY01</StrategicViewType>
    <TileType>Unit</TileType>
    <Asset>SV_ModernArmor.dds</Asset>
    </Row>
    </ArtDefine_StrategicView>
    </GameData>
    "
     

    Attached Files:

    Last edited: Oct 19, 2018
  2. Nutty

    Nutty Deity

    Joined:
    Mar 9, 2011
    Messages:
    3,171
    Gender:
    Male
    Location:
    Orange County, California, U.S.A.
    1. Not the right subforum; this is where completed models are shared. I've alerted the moderators.
    2. The spearman is the default unit if the .fxsxml isn't found. I suspect that you didn't set VFS=True for the art files (i.e., the .fxsxml file, the .ftsxml trigger file, and the .gr2 models/animations and .dds textures) in ModBuddy.
    3. Even with VFS=True it still wouldn't have worked, as there was the addition of a string database in BE that isn't used in Civ5. This requires you to resave the gr2s. You're going to need to do some conversion using Nexus Buddy 2 (be sure to see this post). You're also going to need to add the sound effects files (also VFS=True), and unless you want to make your mod a quasi-DLC, you're going to want to replace the particle effects from BE with approximations using the effects from Civ5.
     
  3. leif erikson

    leif erikson Game of the Month Fanatic Administrator Supporter GOTM Staff

    Joined:
    Feb 2, 2003
    Messages:
    26,414
    Location:
    Plymouth, MA
    Moderator Action: Welcome to CivFanatics. Moved to the main C&C forum as that is where questions belong. Best of luck with your modding.
     
  4. Electric_Gamers

    Electric_Gamers Chieftain

    Joined:
    Oct 15, 2018
    Messages:
    61
    Gender:
    Male
    Location:
    Portugal

    Thank you very much. Tomorrow I might try and change the VFS settings. As for the gr2 conversion, I also had checked out that specific thread yet did not understar what the OP meant with it, going to try it ASAP but I'm running out of time today so might have to finish tomorrow.
     
  5. Electric_Gamers

    Electric_Gamers Chieftain

    Joined:
    Oct 15, 2018
    Messages:
    61
    Gender:
    Male
    Location:
    Portugal
    The sounds is something that I need to take care of, they have also been decompressed, I just need to sort them. The particle effects is what has got me more intrigued. How do I do it?
     
  6. cd5ssmffan

    cd5ssmffan Chieftain

    Joined:
    Feb 1, 2018
    Messages:
    28
    Have you tried reloading the unit system? It's in the project properties in modbuddy.
     
  7. Nutty

    Nutty Deity

    Joined:
    Mar 9, 2011
    Messages:
    3,171
    Gender:
    Male
    Location:
    Orange County, California, U.S.A.
    See this thread. It'll involve tweaks to the .ftsxml trigger file and some bone scaling in Nexus Buddy.

    Yes, this is also necessary.
     
  8. Electric_Gamers

    Electric_Gamers Chieftain

    Joined:
    Oct 15, 2018
    Messages:
    61
    Gender:
    Male
    Location:
    Portugal

    Okay guys, did what you said and.... It worked (see pictures below)
    However, in order for it to load I have to go to the mod properties and add actions when the mod is loaded to update the database and the user data.(see below) Is this normal?
     

    Attached Files:

  9. Electric_Gamers

    Electric_Gamers Chieftain

    Joined:
    Oct 15, 2018
    Messages:
    61
    Gender:
    Male
    Location:
    Portugal
    Also, I don't seem to find where I am supposed to place the Sound files. In a separate folder or in the art folder? And do I have to specify them in a .xml file or do they come attached to the unit?
     
  10. Nutty

    Nutty Deity

    Joined:
    Mar 9, 2011
    Messages:
    3,171
    Gender:
    Male
    Location:
    Orange County, California, U.S.A.
    That's how Civ5 mods work. Either a file is in VFS (the game's virtual file system), or it uses the properties to set an action to add it to the database or to set a Lua entry point. Without one of those, the file doesn't really exist in the game. See this thread.

    The sound files are VFS=True, and folders basically don't matter to the VFS [the only exception is if the game is trying to distinguish between 2 files with the same name; this is why you want to ensure you're using unique filenames for VFS=True files]. Sounds and effects are called using triggers in the .ftsxml, or they're referenced in the art defines (which is why you're referencing, e.g., the "METAL" material type and "EXPLOSI[ON]" weapon type).
     
  11. Electric_Gamers

    Electric_Gamers Chieftain

    Joined:
    Oct 15, 2018
    Messages:
    61
    Gender:
    Male
    Location:
    Portugal
    So, I have to create an entry on the ArtDefine file? And what do I put in them? Is there a template of some sort of what I'm supposed to put on each sound (like what critical categories of sound are required)?
     
  12. Electric_Gamers

    Electric_Gamers Chieftain

    Joined:
    Oct 15, 2018
    Messages:
    61
    Gender:
    Male
    Location:
    Portugal
    NVM, just had to get the ftsxml file from the bunch of converted files. The thing is, the ftsxml file has all these event tags that require "ART_DEF_VEFFECT" Files, which I presume are the effects, and "AS3D_UNIT_CAVALRY" which I think are the sound files. The thing is, where do I find those ART_DEF_VEFFECT amd AS3D entries?
    upload_2018-10-17_18-29-33.png

    Edit: So I found the AS3D files from the modern armor and used the 3ds scripts file as a base for the AS3D's, but even after changing them I still don't get any sound from the unit
    sound.png

    Edit2: So apparently, in game the only sound is the explosions on target...I wonder why that is the case?
     
    Last edited: Oct 17, 2018
  13. cd5ssmffan

    cd5ssmffan Chieftain

    Joined:
    Feb 1, 2018
    Messages:
    28
    You don't actually need to update user data, right? Only update the database. I've never modded units before, so I don't know
     
  14. Electric_Gamers

    Electric_Gamers Chieftain

    Joined:
    Oct 15, 2018
    Messages:
    61
    Gender:
    Male
    Location:
    Portugal
    I don't really know, I just did that because it seemed to work.
     
  15. Electric_Gamers

    Electric_Gamers Chieftain

    Joined:
    Oct 15, 2018
    Messages:
    61
    Gender:
    Male
    Location:
    Portugal
    [UPDATE]
    So, by changing the Sounds in the FTSXML files to the mechanized infantry ones, I was able to put it with sound, and effects aswell. Now all I need to take care are the Flag Atlas Symbols... I created a made-up file using png images from the Civ Wiki (see below). Put them in a dds file, and called it atlas.dds.
    I then created an Atlases.xml file (shown below) and described the atlas as being FLAG_ATLAS_BE.
    I set the parameters and changes the flag atlas designation in the cavalry.xml file to FLAG_ATLAS_BE. But it isn't showing up... I even set the .xml file to true. What is happening here?

    Here's the Atlases.xml File
    <?xml version="1.0" encoding="utf-8"?>
    <!-- Created by ModBuddy on 10/18/2018 5:00:30 PM -->
    <GameData>
    <IconTextureAtlases>
    <Row>
    <Atlas>FLAG_ATLAS_BE</Atlas>
    <IconSize>256</IconSize>
    <Filename>Atlas.dds</Filename>
    <IconsPerRow>4</IconsPerRow>
    <IconsPerColumn>4</IconsPerColumn>
    </Row>
    </IconTextureAtlases>
    </GameData>
     

    Attached Files:

  16. cd5ssmffan

    cd5ssmffan Chieftain

    Joined:
    Feb 1, 2018
    Messages:
    28
    Since you are using paint.net, save icons with no mipmapping, or they won't work. But your problem is most likely icon sizes. This thread here says you also need 128, 80, 64, and 45 icon sizes for your atlas. Also, note unit action and unit sv icon sizes.
    https://forums.civfanatics.com/threads/icon-and-screen-pixel-dimension-reference.499400/

    You will have to create a new row in the IconTextureAtlases table for each new icon size. Alternatively, you could use sql:
    Code:
    INSERT INTO IconTextureAtlases
        (Atlas, IconSize, Filename, IconsPerRow, IconsPerColumn)
    VALUES
        ('FLAG_ATLAS_BE', 256, 'Atlas256.dds', 4, 4),
        ('FLAG_ATLAS_BE', 128, 'Atlas128.dds', 4, 4),
        ('FLAG_ATLAS_BE', 80, 'Atlas80.dds', 4, 4),
        ('FLAG_ATLAS_BE', 64, 'Atlas64.dds', 4, 4),
        ('FLAG_ATLAS_BE', 45, 'Atlas45.dds', 4, 4);
    Unrelated but also don't save with DXT3 or 5 compression or you will get artifacts (copy this to pdn and zoom way in):

    I'm not ****ting on DXT here, it is great for larger image textures, but generally is not a good idea for small images, such as the icons that civ uses. Save using A8R8G8B8 instead
     
  17. Nutty

    Nutty Deity

    Joined:
    Mar 9, 2011
    Messages:
    3,171
    Gender:
    Male
    Location:
    Orange County, California, U.S.A.
    Like art defines, the way that Firaxis gets to do it is different from how we need to do it for a mod. So to add your .wav files as an AS3D entry, you add them to the database like so (this is from Deliverator's T-Rex unit, note you do not provide the .wav file extension to the filename):
    Spoiler :
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <GameData>
      <Audio_Sounds>
        <Row>
          <SoundID>SND_UNIT_TREX</SoundID>
          <Filename>trex</Filename>
          <LoadType>DynamicResident</LoadType>
        </Row>
        <Row>
          <SoundID>SND_UNIT_TREX_STEP</SoundID>
          <Filename>trexstep</Filename>
          <LoadType>DynamicResident</LoadType>
        </Row>
      </Audio_Sounds>
      <Audio_3DSounds>
        <Row>
          <ScriptID>AS3D_UNIT_TREX</ScriptID>
          <SoundID>SND_UNIT_TREX</SoundID>
          <SoundType>GAME_SFX</SoundType>
          <MaxVolume>70</MaxVolume>
          <MinVolume>45</MinVolume>
          <IsMusic>0</IsMusic>
        </Row>
        <Row>
          <ScriptID>AS3D_UNIT_TREX_STEP</ScriptID>
          <SoundID>SND_UNIT_TREX_STEP</SoundID>
          <SoundType>GAME_SFX</SoundType>
          <MaxVolume>55</MaxVolume>
          <MinVolume>40</MinVolume>
          <IsMusic>0</IsMusic>
        </Row>
      </Audio_3DSounds>
    </GameData>


    Make sure you set Reload Audio System, the XML you add the above to is set to UpdateDatabase, and your .wav files are VFS=True.

    The reason for this was that the explosion sound is from the art defines as I mentioned above, not the .ftsxml.
     
  18. Electric_Gamers

    Electric_Gamers Chieftain

    Joined:
    Oct 15, 2018
    Messages:
    61
    Gender:
    Male
    Location:
    Portugal
    Alright, thank you guys! I will try the mipmapping method and as for the sounds, might replace them, but for now, I'm just testing the basic combat and seeing if I can add a second unit.(Oh, BTW Nutty I didn't know you were the one who created the camerarotation mod but I've got to say I've been using it for years and It's fantastic)
     
  19. Electric_Gamers

    Electric_Gamers Chieftain

    Joined:
    Oct 15, 2018
    Messages:
    61
    Gender:
    Male
    Location:
    Portugal
    upload_2018-10-18_21-32-17.png

    Okay, so here it is! Gotta do the sound stuff to this one to see how it turns out. Still need to change the Stats.
     
  20. Electric_Gamers

    Electric_Gamers Chieftain

    Joined:
    Oct 15, 2018
    Messages:
    61
    Gender:
    Male
    Location:
    Portugal
    upload_2018-10-18_22-30-38.png

    Alright, so the icons are taken care of, thanks, cd5ssmffan!
     

Share This Page