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. Ysharma

    Ysharma Chieftain

    Joined:
    Dec 21, 2009
    Messages:
    28
    how did you do that?
     
  2. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,211
    Location:
    DE/NL/FR
    How did he do what? Be more specific.
     
  3. Agent327

    Agent327 Observer

    Joined:
    Oct 28, 2006
    Messages:
    16,093
    Location:
    In orbit
    Actually, I have the same question. I want to give the Meklars in MOO2Civ a custom MeklarScout unit. So I did what the first 3 posts said, but the MeklarScout unit doesn't show up in my testgame with the Meklars (nor is it in the Civilopedia); they just get the regular Scout. Here's what I have:

    Spoiler :

    </Cities>
    <Buildings/>
    <Units/>
    <FreeUnitClasses>
    <FreeUnitClass>
    <UnitClassType>UNITCLASS_SCOUT_PROBE</UnitClassType>
    <iFreeUnits>1</iFreeUnits>
    </FreeUnitClass>
    </FreeUnitClasses>
    <Unit>
    <UnitClassType>UNITCLASS_SCOUT_I</UnitClassType>
    <UnitType>UNIT_MEKLARSCOUT</UnitType>
    </Unit>
    </Units>
    <FreeBuildingClasses>
    <FreeBuildingClass>
    <BuildingClassType>BUILDINGCLASS_CAPITOL</BuildingClassType>
    <bFreeBuildingClass>1</bFreeBuildingClass>
    </FreeBuildingClass>
    </FreeBuildingClasses>
     
  4. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,211
    Location:
    DE/NL/FR
    Is only the starting unit the problem, or does the scout not appear at all in the game?
     
  5. Agent327

    Agent327 Observer

    Joined:
    Oct 28, 2006
    Messages:
    16,093
    Location:
    In orbit
    They just get the regular Scout; so Scouts are in (they always were), but the MeklarScout unit model doesn't appear. (I'm sure I overlooked/omitted something...)
     
  6. phungus420

    phungus420 Deity

    Joined:
    Mar 1, 2003
    Messages:
    6,296
    If you want to create a UU you do not change UnitClassInfos. Check out how UUs are set up in the regular game. Basically all you do is create a new UnitInfos entry for your new UU, and then define that as a replacement unit in CivilizationInfos. Again look at a regular BtS UU to see how it's done, it's pretty straightforward.
     
  7. Agent327

    Agent327 Observer

    Joined:
    Oct 28, 2006
    Messages:
    16,093
    Location:
    In orbit
    Ah, OK - I'll check. Thx.
     
  8. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,211
    Location:
    DE/NL/FR
    erm...



    And looking closer at this, it sure should be this here:

     
  9. Agent327

    Agent327 Observer

    Joined:
    Oct 28, 2006
    Messages:
    16,093
    Location:
    In orbit
    OK, now I'm confused... What should I do about it? :confused:
     
  10. phungus420

    phungus420 Deity

    Joined:
    Mar 1, 2003
    Messages:
    6,296
    I have no idea what The_J is saying either.

    Look JEELEN, just do this: Search In Files for _JAGUAR in the XML folder using Notepad++ (have it search in child folders as well). This will show you all the places _JAGUAR is in the XML (UnitInfos and CivilizationInfos and some text files). Then just copy what the BtS devs did to make a UU for a standard BtS UU for your unique unit for your mod.
     
  11. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,211
    Location:
    DE/NL/FR
    About what?

    I say, that you've misread the schema for the free units.
    Look at it again closely.

    If i read that right, it IS already a real UU. It has UNITCLASS_SCOUT_I as unitclass, which i guess, is the normal unitclass, and UNIT_MEKLARSCOUT as unittype.
     
  12. Agent327

    Agent327 Observer

    Joined:
    Oct 28, 2006
    Messages:
    16,093
    Location:
    In orbit
    That is correct. So what is wrong? (Looking at it closely, I don't see it; just tell me - or highlight in the section - what I'm missing or did do wrong. This is my very first try at adding a custom model and I need to add plenty more.) The unit (nor a button for it) is showing up when testplaying the Meklars; it also doesn't show in the Civilopedia and I changed all the files according to the tutorial in posts 1-3.
     
  13. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,211
    Location:
    DE/NL/FR
    You don't see it in the civilopedia?
    During a game, or before starting a new one?
     
  14. Agent327

    Agent327 Observer

    Joined:
    Oct 28, 2006
    Messages:
    16,093
    Location:
    In orbit
    No, no and no. (Although I don't quite see how I could see it before starting a game...)
     
  15. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,211
    Location:
    DE/NL/FR
    I mean, directly after loading in the civilopedia, without starting a game.
    ...cache maybe?
     
  16. Agent327

    Agent327 Observer

    Joined:
    Oct 28, 2006
    Messages:
    16,093
    Location:
    In orbit
    If you mean I should (have) clear(-ed) out my cache, I didn't. (It's mentioned in an earlier post, but it's not in posts 1-3 as a necessary step. Should it be?) Would that help to fix it?
     
  17. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,211
    Location:
    DE/NL/FR
    It's worth a try.
     
  18. Agent327

    Agent327 Observer

    Joined:
    Oct 28, 2006
    Messages:
    16,093
    Location:
    In orbit
    OK, will do.
     
  19. Ysharma

    Ysharma Chieftain

    Joined:
    Dec 21, 2009
    Messages:
    28
    i did everything but when i go to its civilopedia entry it only shows a box with a PICTURE OF THE BUTTON
    at least it started and shows it in the civilopedia
    \\
     
  20. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,211
    Location:
    DE/NL/FR
    Is only the button there, or is the button there instead of the unit?
    In the first case: Check again the path to your art files. There's maybe a mistake in one of the folder names in your artDefines_Units.xml.
     

Share This Page