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

Creating a New Unit, Can I change the Icon?

Discussion in 'CivBE - Modding Help & Mod Creation' started by roadmaster, May 16, 2015.

  1. roadmaster

    roadmaster Chieftain

    Joined:
    Apr 28, 2015
    Messages:
    20
    I have created a new Unit and have called it the M1Abrams which is of course a ripoff of the American M1Abrams Battle Tank, I have been using the LEV Tank art up til now. I wanted to create my own Icon for it, instead of using the Lev Tanks Icon. So I got to looking around and after unpacking a bunch of fpk files I found the xml file that had <UnitArtInfos><UnitArtInfo>. Just what I had been looking for. so I found the entry for the LEV Tank and copied it over into a xml file in my Mod, I first noticed that the UnitArtInfos did not have the GameData root tag so I tried my xml code both inside and outside of the GameData root tag. this is what I got from the LEV Tank info.

    The only elements I changed were the Type, PortraitAtlas, and PortraitIndex. From within my M1Abrams Unit xml I call for <UnitArtInfo>ART_DEF_UNIT_M1ABRAMS</UnitArtInfo>, the Portrait Atlas points to a atlas I created using the 256x256 8x8 Template, my Icon is in the Top Left Circle so I call it with a Portrait Index of 0.

    This has all been guesswork so far on my part, however it does not seem to work. With the UnitArtInfos xml Code in my M1Abrams Unit xml file, the game wouldn't even load my Tank Unit into the game regardless of whether or not the code was or was not in the GameData root tag. Before I did all this my Unit worked fine it just showed the Icon for the LEV Tank, after I took the UnitArtInfos xml code out of my Unit xml and put it in its own xml file my Tank would load again, however since I didn't change my Unit pointing to ART_DEF_UNIT_M1ABRAMS it came up with a Soldiers Icon, that's not an issue if I completely change it back, what is at issue is I would like to use my own Icon, not necessarily new Graphics for moving around, just the icon when purchasing the unit or when looking into the Pedia Entry.

    So Can this be done? If so does anyone see what I have done wrong here?

    I have successfully changed icons in the Buildings xml code, but Units does not have a IconAtlas or a PortraitIndex so my assumption was that it did this through the UnitArtInfo type. What I have tried is not working though.
     
  2. lilgamefreek

    lilgamefreek Warlord

    Joined:
    Oct 30, 2014
    Messages:
    229
    The UnitArtInfos are defined differently in the Game's Database table than what they are in the xml file you found in the .fpk. Thus when adding art deines through mods, you have to use their alternate names. You can look up my mod's artdefines table for an example of how to structure your artdefine for your mod.

    http://steamcommunity.com/sharedfiles/filedetails/?id=400212531
     
  3. roadmaster

    roadmaster Chieftain

    Joined:
    Apr 28, 2015
    Messages:
    20
    Thanks, that did the trick. It took me awhile to fix my mod, for the life of me I just couldn't get those defines to work with my mod, for the longest time every time I started up the game my Sponsor wouldn't be displayed on the Setup's Sponsor screen. I finally realized I had added some bad language enUS entries at the same time that I added the ArtDefines. Thanks for the help.
     

Share This Page