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

GUIDE: Adding new units

Discussion in 'Civ4 - Modding Tutorials & Reference' started by sovarn, Nov 10, 2005.

  1. Domen

    Domen Misico dux Vandalorum

    Joined:
    Mar 27, 2009
    Messages:
    8,088
    Location:
    Doggerland
    Is there a list of all possible unit Abilities? Or you can invent and add any ability you want?
     
  2. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,018
    Location:
    Germany / Netherlands
    You can only change the values which are already in the UnitInfos.xml, and you can't just add other tags in there, they would not work.

    If you want totally new abilities, then you'd have to program that in (and that would be then the wrong tutorial for you ;)).
     
  3. Domen

    Domen Misico dux Vandalorum

    Joined:
    Mar 27, 2009
    Messages:
    8,088
    Location:
    Doggerland
    Ok, thanks for this answer. ;)
     
  4. Spcfoster

    Spcfoster Chieftain

    Joined:
    Feb 14, 2012
    Messages:
    1
    Hey I THINK i did everything in the tutorial right but by all the new units showing up as red domes apparently i didnt. anyone else with this problem or know what i can do to fix it?
     
  5. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,018
    Location:
    Germany / Netherlands
    the path in ArtDefines_units.xml is wrong, most likely the file name. Check it again ;).
     
  6. ronjon

    ronjon Chieftain

    Joined:
    Jan 5, 2007
    Messages:
    143
    I apologize if this is the wrong place to ask this question. I am trying to change some units stats or values or whatever they are called, and I notice for ROM that instead of using terrain offense and defense, Afforesse used featureattacks and featuredefense, and I just wondered why, and if any problems could be caused going the other way?
     
  7. ronjon

    ronjon Chieftain

    Joined:
    Jan 5, 2007
    Messages:
    143
    2nd question. If I want to change a units offense and defense in flatlands, do I have to do this <FeatureAttack><FeatureType>FEATURE_PLAINS</FeatureType>
    <iFeatureAttack>50</iFeatureAttack>
    </FeatureAttack> for grassland and marsh and tundra separately?
     
  8. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,018
    Location:
    Germany / Netherlands
    Oh, if you prefer terrain or feature related attack/defense values is just a matter of taste and what you want to do, nothing more.

    ...er...yes, you have to do it separately, but together in the main tag...er...e.g.:
    PHP:
                <TerrainAttacks>            
                    <
    TerrainAttack>
                        <
    TerrainType>TERRAIN_TUNDRA</TerrainType>
                        <
    iTerrainAttack>50</iTerrainAttack>
                    </
    TerrainAttack>
                    <
    TerrainAttack>
                        <
    TerrainType>TERRAIN_PLAINS</TerrainType>
                        <
    iTerrainAttack>50</iTerrainAttack>
                    </
    TerrainAttack>
                </
    TerrainAttacks>
     
  9. ronjon

    ronjon Chieftain

    Joined:
    Jan 5, 2007
    Messages:
    143
    Thank you, The J, exactly what I needed.
     
  10. Ayeshteni

    Ayeshteni Chieftain

    Joined:
    Oct 21, 2012
    Messages:
    20
    Love Civ IV and remember my days tinkering around with modding Civ II. Not much I want to change, except for one thing:

    I want to make Mechanized Infantry also require having the Oil resource. But have absolutely no clue on how to do that. I have BtS (3.17) any idea on where I need to look?

    Ayeshteni
     
  11. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,018
    Location:
    Germany / Netherlands
    Like mentioned in the OP, it's the Assets\XML\Units\UnitInfos.xml.
    Just search for MECHANIZED_INFANTRY, find the related entry, and change:
    PHP:
    <BonusType>NONE</BonusType>
    to BONUS_OIL
     
  12. Ayeshteni

    Ayeshteni Chieftain

    Joined:
    Oct 21, 2012
    Messages:
    20
    Cheers.

    Aye.
     
  13. George Smiley

    George Smiley Chieftain

    Joined:
    Dec 31, 2010
    Messages:
    1
    I have no trouble adding new units: they show up in game properly and the button icons all work. However, the green/white/red dot status indicator button that used to appear at the top of every unit's (even unmodded units) flagstaff has disappeared. How to I get that to come back?
     
  14. Elite

    Elite Comrade

    Joined:
    Aug 10, 2006
    Messages:
    423
    Location:
    somewhere
    Where's the Newbie friendly tutorial?... like has absolutely no experience is modding Civ IV because it's modding interface sucks compared to 3's.
     
  15. Slinger

    Slinger Chieftain

    Joined:
    Dec 30, 2017
    Messages:
    1
    Gender:
    Male
    Hi, Civ4 BTS noob here. Anyone know how I can add artillery type attack to a spy unit? I'm working on a saboteur that can destroy stuff. I'm using the Great Spy assets, but don't have the ability to attack a unit or city. Any hints would be great. Thanks!
     
  16. quiknik23

    quiknik23 Chieftain

    Joined:
    Aug 29, 2014
    Messages:
    9
    i am attempting to add a unit from FfH2 to a new mod to do some tinkering, and I get everything to work correctly, except that my marksman just stands there with his arms out at his side all the time in map, and in pedia
     
  17. blovdubb

    blovdubb Chieftain

    Joined:
    Feb 4, 2006
    Messages:
    71
    Location:
    Charlotte,NC
    Hi I realize no one has posted in here in over a year, so sorry if an inconvenience...
    Im new to modding civ 4, so far i managed to make a civ, add a tech, all with buttons and text entries. (After much trial and error I might add)

    I have followed this tutorial to the word and I keep getting this same error

    its in Artdefines_Units it says line 11, 12
    <fscale>0.61</fscale>

    then in unitclassinfos it says 15,17

    <DefaultUnit>UNIT_LION</DefaultUnit>
    Then it goes into a whole bunch of errors I'm assuming originating from these two.

    very confused as i didnt edit anything in that area???

    I pasted everything at the bottom as directed.
    please help uploaded the two files in question, tried to get screenshots of errors but print screen button doesnt work.

    the content ive attempted to add is the last entry reskined warrior names Brand instead of terry


    *******problem solved had the artdefines xml from vanilla in there....******
     

    Attached Files:

    Last edited: Apr 30, 2019

Share This Page