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

Unit Replacements

Discussion in 'Civ4 - European Middle Ages Mod' started by Ajidica, Aug 23, 2007.

  1. Ajidica

    Ajidica High Quality Person

    Joined:
    Nov 29, 2006
    Messages:
    21,172
    I am trying to create a new unit to replace horse archers for European Civs. It is showing up in pedia fine, except the name is TXT_KEY_UNIT_PUERI. I dont know how to fix this. i am also going to be replacing vassals for the other civs. any ideas for names? I also need stats for both. If you want the list on how i divvied the units up, i will post them. Any comments or questions?
     
  2. Head Serf

    Head Serf Emperor

    Joined:
    Aug 6, 2005
    Messages:
    1,566
    Location:
    Michigan, USA
    You need to make a text key in the MedievalTextInfos.xml file.
     
  3. Craig_Sutter

    Craig_Sutter Deity

    Joined:
    Aug 13, 2002
    Messages:
    2,753
    Gender:
    Male
    Location:
    Calgary, Canada
    Noble Cavalry, Noble Horse, Feudal Cavalry, Feudal Horse.

    For Horse Archer replacement... Irregular Cavalry, Irregular Horse, Skirmisher or Mounted Skirmisher.

    My preferences... Skirmisher and Feudal Horse.
     
  4. Craig_Sutter

    Craig_Sutter Deity

    Joined:
    Aug 13, 2002
    Messages:
    2,753
    Gender:
    Male
    Location:
    Calgary, Canada
    Take into account the current UUs... I haven't gone through the list, but there may be a UU that replaces Vassal, for instance, for a Middle Eastern civ. Make certain to reset that UU to replace the new Vassal replacement.
     
  5. Ajidica

    Ajidica High Quality Person

    Joined:
    Nov 29, 2006
    Messages:
    21,172
    When i added an entry almost all units went to TXT_KEY names and loading said there was something wrong with the encoding. whatever that means.

    It says the source for the failure is:
    <?xml version= "1.0" encoding= "UTF-8"?>
    i have no clue what it means. even when i deleted the pueri section it still doest work.
    All units whoes names are added appear as TXT_KEY, i dont have any spelling mistakes in the file, and it says it is redirected to civics_religion file. HELP!!
     
  6. Ajidica

    Ajidica High Quality Person

    Joined:
    Nov 29, 2006
    Messages:
    21,172
  7. Ajidica

    Ajidica High Quality Person

    Joined:
    Nov 29, 2006
    Messages:
    21,172
    Could someone when they look at the bad xml file please add an entery for Feudal Horse? I can add the rest of the stuff.
    All names except ones from core game, structures, tech names, pedia entries, and leader names appear as TXT_KEY..... Can someone please help? The game works fine.
     
  8. ohcrapitsnico

    ohcrapitsnico Deity

    Joined:
    Jan 16, 2006
    Messages:
    2,267
    Are you putting in special characters?
     
  9. Ajidica

    Ajidica High Quality Person

    Joined:
    Nov 29, 2006
    Messages:
    21,172
    nope. its all in english.
    I replaced the modified medievaltextinfos.xml file with an un modded one. now everything is fine and only pueri is TXT_KEY. i dont want to go into that xml file again, so could someone be as kind to post a modified xml file with Pueri (European Horsearcher) and Noble Cavalry ( Eastern Vassals). if they could, i would be most grateful.
     
  10. Ajidica

    Ajidica High Quality Person

    Joined:
    Nov 29, 2006
    Messages:
    21,172
    I got every thing fixed except for the TXT_KEY problem for pueri and noble cavalry. to restrict certiant units the only xml file i have to edit it civilizationinfos.xml?
    When i try to edit the civilizatoninfos file to dissalow certiant units with this for dissalow:
    <UnitClassType>UNITCLASS_PUERI</UnitClassType>
    <UnitType>NONE</UnitType>
    And to allow the opposite way. i coppied it from how you dissalow cogs/medieval galleys and longships/lateen galley. When i load it up, i get the wonder error message saying that encoding for civinfos is bad and is using unitinfos to load. so of course i get no civs to choose from because the file theyre using is dissalowed by encoding. Unless i get some help here, it looks like this project is off.
     
  11. Craig_Sutter

    Craig_Sutter Deity

    Joined:
    Aug 13, 2002
    Messages:
    2,753
    Gender:
    Male
    Location:
    Calgary, Canada
    I'm not so familiar with these files, so I can't really help that much.

    Where did you get Pueri from? It sounds a bit to ethnic... more like a UU than a general purpose unit, in my humble opinion.
     
  12. Ajidica

    Ajidica High Quality Person

    Joined:
    Nov 29, 2006
    Messages:
    21,172
    Pueri is french for light cavalry if my book is corect. and most european civs that get it acknowledged frankish dominion. You had to know something about the encoding crap when you added your religios unit for .65.
     
  13. Head Serf

    Head Serf Emperor

    Joined:
    Aug 6, 2005
    Messages:
    1,566
    Location:
    Michigan, USA
    Yes, you will need the CivilizationInfos in order to decide which civilizations can use the units.
     
  14. Craig_Sutter

    Craig_Sutter Deity

    Joined:
    Aug 13, 2002
    Messages:
    2,753
    Gender:
    Male
    Location:
    Calgary, Canada
    I looked at the file...I can't see what could have been done incorrectly in such a short inserted text. It looks like any of the others.

    Truly, I'm not that familiar with the xml... especially regarding graphics. I did my units simply by copying existing units (swordsman, crusader and horse archer), and duplicating the entries in every file I could find where they came up... making certain to rename everything to the new units in the process.

    Anyhow, the file you uploaded appears to be ok.

    Which files did you alter... did you create Unitclass_Pueri in the unitclassinfos file? Did it work ok before you began disallowing it? If you upload all the files you altered, perhaps I could trace the entries to see if anything was missed.
     
  15. Ajidica

    Ajidica High Quality Person

    Joined:
    Nov 29, 2006
    Messages:
    21,172
    Everything works fine, including graphics. my two problems are that i cant get the names to quit being TXT_KEY_(name) and when i try to dissalow them in civilizationinfos, i get an encoding error when loading the game and all civs dissapear.i dont think i have any spelling errors because it says the location of the error in both sources is 1,1. or the encoding line. i have never had this problem in any other source.
     
  16. Ajidica

    Ajidica High Quality Person

    Joined:
    Nov 29, 2006
    Messages:
    21,172
    to clarify things, when i modify the medievaltextinfos.xml file it uses civicreligion.xml file instead and when i modify the civilizationinfos file it uses unitinfos instead. and for both arrors it says the source of the error is the exact same place, the encoding line. has this ever happened to you before?
     
  17. Ajidica

    Ajidica High Quality Person

    Joined:
    Nov 29, 2006
    Messages:
    21,172
    I fixed the TXT_KEY problem by in description putting the normal names there and not having a description entry. so now i dont think it will work in different languages though.
     
  18. Craig_Sutter

    Craig_Sutter Deity

    Joined:
    Aug 13, 2002
    Messages:
    2,753
    Gender:
    Male
    Location:
    Calgary, Canada
    That's weird. Has never happened when I did modifications like that.

    Try disallowing another unit for a civ, for example, knight, just to see what happens... if you get no error, then something is definetly strange with the pueri.

    Perhaps it has something to do with Pueri being a replacement unit. How did you set that up? Is it set as a replacement for horse archer, or is it a seperate unit, with horse archer being disallowed for civs that have it. Or are you treating it as a UU. For the whole Cog/etc. the units, I believe, are not set up as UUs but simply disallowed. Maybe you need to have an entry disallowing horse archer at the same time you allow Peuri. This all depends how you've set up the unit.

    I don't know how UUs work or how to create one, but I suspect that the units shouldn't be set up as UUs but as ordinary units, then disallowed and allowed in the civinfos file. If they are UUs, then disallowing horse archer while allowing a UU, Pueri, may screw things up.

    However, I'm just guessing.
     
  19. Ajidica

    Ajidica High Quality Person

    Joined:
    Nov 29, 2006
    Messages:
    21,172
    it is its own unit, its not just a horse archer replacement. Right now i have it as dissalow horse archers, dissalow noble cavalry (eastern vassal). ill wait until headsef says something because i dont think it is any spelling or other error because it says something is up with the encoding. if you can tell me how to take a screenshot, ill try and get it. ill try your knight idea, but im gone tomorrow so i cant let you know untill monday at earliest.
     
  20. Craig_Sutter

    Craig_Sutter Deity

    Joined:
    Aug 13, 2002
    Messages:
    2,753
    Gender:
    Male
    Location:
    Calgary, Canada
    Screenshot... hit Print Screen button. It's in different place on the keyboard depending on the type you have. Then open up Paint or any other paint program, create a file, and paste.
     

Share This Page