Announcement

Collapse
No announcement yet.

How to add unique barbarian unit

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to add unique barbarian unit

    Hi

    I've created a Barbarian warloard unit, that is meant to be unique for the the barbarians (strength 4, +100% vs. cities, collateral damage), but I can't seem to find out where to spacify that the unit is unique for them.

    In the file CIV4CivilizationInfos.xml I can see that the other civs uu's are listed under each civ, but under the barbarians there's just a bunch of unittypes.

    How do I make the unit buildable only by the barbarians?

    Skodkim

  • #2
    My first thought would be to look into how animals are done. They are Barb-only units, so you should be able to get some insight from them.

    Comment


    • #3
      I went back and I looked through the XML files. I think what you're looking for IS in the CIV4CivilizationInfos.xml

      I had to use the php tags to show the xml "properly."
      PHP Code:
                      <!-- BlueJayBird AdditionsStart -->
                      <
      Unit>
                          <
      UnitClassType>UNITCLASS_WARRIOR</UnitClassType>
                          <
      UnitType>UNIT_INCAN_QUECHUA</UnitType>
                      </
      Unit>
                      <
      Unit>
                          <
      UnitClassType>UNITCLASS_ARCHER</UnitClassType>
                          <
      UnitType>UNIT_MALI_SKIRMISHER</UnitType>
                      </
      Unit>
                      <!-- 
      BlueJayBird AdditionsEnd -->
                      <
      Unit>
                          <
      UnitClassType>UNITCLASS_SETTLER</UnitClassType>
                          <
      UnitType>NONE</UnitType>
                      </
      Unit>
                      <!-- 
      BlueJayBird removed this:
                      <
      Unit>
                          <
      UnitClassType>UNITCLASS_SCOUT</UnitClassType>
                          <
      UnitType>NONE</UnitType>
                      </
      Unit>
                      --> 
      Each <Unit> tag looks like an override. For Barbarians, most of these are overridden to NONE, like the scout and settler. Barbs don't have an entry for Warriors or Archers, so they get to use the default. In the code above, I added the Mali and Incan Uniques to the Barb list. In my test game (see screenshot) they were replaced by the proper unit. I had given myself a full map and the spy through the world builder. I wasn't patient enough to discover them on my own.. and I didn't wait around for the archers or scouts to show up. I put a comment tag around the scout so that barbs might be able to build scouts.

      So, I think all you need to do is make an override. If there's already an override to NONE for the type you want to use (pikemen or something), remove it and put yours in.

      Comment


      • #4
        Actually that sounds a bit as what I already did.

        I made a new unit class, something like UNIT_BARB_WARLOARD and made a unit in the units.xml (don't remember the exact name) under that class. I then added the unit to the barbarians and minor civ in the CIV4CivilizationInfos.xml file.

        The only way of testing it (without having to start a new game and actually play it) I could think of was to start a game, build a city, give myself access to iron (preresquite) via the worldbuilder and see whether I could build the unit as the greeks and I could. That tells me that the unit isn't a barb UU..?

        Anyway I'll give your input a try when I get back from work.

        \Skodkim

        Comment


        • #5
          I found out how to make the unit a barbarian UU last night.

          As BlueJayBird suggested I had to specify that the default unit in the new unit class for all normal civs were "NONE".

          Several people have suggested that the idea of receiving a small fee when you kill the unit is great. It is however not within my skills.

          I also made the unit a real city-raider: It has strength 4, +100% vs. cities making it a really strong city-attacker. On the other hand I gave it the "no defence bonus", so you have to kill it before it attacks your city!

          Skodkim
          Last edited by skodkim; January 11, 2006, 02:44.

          Comment

          Working...
          X