1. Firaxis celebrates the "Asian American and Pacific Islander Heritage Month", and offers a give-away of a Civ6 anthology copy (5 in total)! For all the details, please check the thread here. .
    Dismiss Notice

Problems with modular loading

Discussion in 'Civ4 - Plug and Play Project' started by Alulim, Aug 7, 2007.

  1. Alulim

    Alulim Chieftain

    Joined:
    Dec 19, 2005
    Messages:
    16
    Location:
    USA
    Hi, I hope this is the right place for this. I'm having a few problems with the modular loading system in BtS, maybe someone here can help.

    1. Modules don't seem to load from CustomAssets. According to 14.3 in Kael's post here, they should load if they're in "CustomAssets\Modules", but I can only get them to load from "Mods\Modname\assets\Modules". Has anyone got this working or is this a feature that didn't make it into BtS?

    2. Modular text tags can't replace non-modular text tags. If I make a modular text file (of the form *_Civ4GameText.xml), I can create new text tags, I just can't overwrite old ones, like say <Tag>TXT_KEY_CITY_NAME_WASHINGTON</Tag>. I know my modular text files are being read, since the game gives me an error box if I have typos, but the old text tags don't get overwritten. Or maybe the non-modular text is loaded after modular text, unlike the other sorts of files? Is this a bug or am I doing something stupid?
     
  2. purplexus

    purplexus Prince

    Joined:
    Feb 13, 2002
    Messages:
    477
    Location:
    Calgary Alberta, Canada
    You are not doing something stupid at all.

    But in order for you to get rid of the old TXT names you will have to include within your own mod is an Actual Civ4GameText.xml with those entries you don't want in it taken out. Because you see what is happening is the game is still loading the original text files and then it ADDS the new text in as well. In order to take something out you will have to remove it from the original Text Files by doing the following.

    1.) copy past the original Civ4GameText.xml into your mod folder.
    2.) remove all the entries you want to remove.
    3.) Place this within your Assets/Xml/Text folder within your mod.

    Once you have done this. Your new Civ4GameText.xml file will supercede the original one.

    Something I will be working on shortly is a Blank Assets folder which in itself will be a module. It will remove all current civ's from the game so that you can have only the Civ's you chose to have. By doing this I'll Also have to make new modules which will allow you to add each civ in one at a time.

    I did do this for Warlords but found that the DiplomacyInfos.xml file got really upset with me. Impaler[WRG] wrote a fix for this the only thing is I haven't gotten word from him that it is also available now for BtS
     
  3. ambrox62

    ambrox62 Emperor

    Joined:
    Mar 24, 2005
    Messages:
    1,294
    A question about P&P LH and modular modding

    Looking at Wilhelmina mod I noticed Wilhelmina_CIV4CivilizationInfos.xml file.
    It comes from firaxis BTS CIV4CivilizationInfos.xml file with only netherland civ inside PLUS the following lines
    Code:
    				<Leader>
    					<LeaderName>LEADER_WILHELMINA</LeaderName>
    					<bLeaderAvailability>1</bLeaderAvailability>
    				</Leader>
    
    to set Wilhelmina as 2nd netherland leader

    But what happens if I'll made another different Mods to add a further "2nd" netherland leader?
    I guess that my second mod step on the first and Wilhelmina disappears, right?

    For modular modding purpose I would have expected something like this
    Code:
    <?xml version="1.0"?>
    <!-- Civilization Infos -->
    <Civ4CivilizationInfos xmlns="x-schema:LEADERXXX_CIV4CivilizationsSchema.xml">
    	<CivilizationInfos>
    		<CivilizationInfo>
    			<Type>CIVILIZATION_NETHERLAND</Type>
    			<Leaders>
    				<Leader>
    					<LeaderName>LEADER_XXX</LeaderName>
    					<bLeaderAvailability>1</bLeaderAvailability>
    				</Leader>
    			</Leaders>
    		</CivilizationInfo>
    	</CivilizationInfos>
    </Civ4CivilizationInfos>
    
    in order to add any further netherland leader at the bottom of the previous ones (Willelm, Wilhelmina, LeaderXXX, ecc...)
     
  4. purplexus

    purplexus Prince

    Joined:
    Feb 13, 2002
    Messages:
    477
    Location:
    Calgary Alberta, Canada
    This has come up before. Even your solution is not a good work around on this. A good way to work around the issue is for someone to come up with a front loading program to manage the modules.
     
  5. ambrox62

    ambrox62 Emperor

    Joined:
    Mar 24, 2005
    Messages:
    1,294
    Ok, thanks!

    I made this following your standard
     
  6. Alulim

    Alulim Chieftain

    Joined:
    Dec 19, 2005
    Messages:
    16
    Location:
    USA
    Thanks purplexus! It sounds like it might be best not to use modular loading for my alternate city names mod. I can just picture someone removing my alternate city names files from the modules folder (either for a single civ or all of them) but leaving behind the "blanked" xml and wondering why the Americans keep founding cities called TXT_KEY_CITY_NAME_WASHINGTON. :crazyeye:
     
  7. purplexus

    purplexus Prince

    Joined:
    Feb 13, 2002
    Messages:
    477
    Location:
    Calgary Alberta, Canada
    Let me add it in to the Library. Good work.:goodjob:
     
  8. purplexus

    purplexus Prince

    Joined:
    Feb 13, 2002
    Messages:
    477
    Location:
    Calgary Alberta, Canada
    So lets see how we can get a work around for this.

    What we would first do is blank the civ's out. Then we create Modules for each original civ. That should work for what you are trying to do.

    Now when you want to replace the american's with your own version. they will have cities with your own flavour. Its all doable. Tonight I'll Start on Blanking out the civ's
     
  9. Impaler[WrG]

    Impaler[WrG] Civ4:Col UI programmer

    Joined:
    Dec 5, 2005
    Messages:
    1,750
    Location:
    Vallejo, California
    An even better solution would simply be to have the Leaderhead reference the Civilization it belongs to rather then the other way around (same thing for Unique Units). Hopefully I can code that in some day, though it won't be compatible with default BtS.
     
  10. EmperorFool

    EmperorFool Deity

    Joined:
    Mar 2, 2007
    Messages:
    9,633
    Location:
    Mountain View, California
    I also encountered the problem that modules don't seem to load from CustomAssets. See my other post here. Has anyone found a work-around for this?
     
  11. purplexus

    purplexus Prince

    Joined:
    Feb 13, 2002
    Messages:
    477
    Location:
    Calgary Alberta, Canada
    Ambrox about your question earlier about using a General XXX for a LeaderHead Name....
    I guess apparently the only true work around that will work is to incorporate a mod in which the LH will reference the Civilization instead of the other way around like it does now.
     
  12. Aeven

    Aeven EU Citizen

    Joined:
    May 11, 2007
    Messages:
    228
    Location:
    the Netherlands, EU
    I tried to do what ambrox suggested, but it caused all kinds of errors. I believe a modified schema could address it. That, or it combined with a SDK or python script.
     
  13. Edgecrusher

    Edgecrusher King

    Joined:
    Aug 7, 2006
    Messages:
    917
    Location:
    Massachusetts
    What I do is just keep 1 CivilizationInfos File, and edit it, as i add leaders. Ignoring the XXX_CivilizationInfos.xml for each individual leader.

    Its not completly 100% plug and play, but one has to Cut+Paste the Diplomacy's file anyway, so I dont really care.
     
  14. purplexus

    purplexus Prince

    Joined:
    Feb 13, 2002
    Messages:
    477
    Location:
    Calgary Alberta, Canada
    The diplomacy issue is now resolved.

    The purpose for creating Modules though is also to make this as easy as possible for the Non Programming types.

    Sounds like Impaler has thought of a way to Implement a Leader referring to their civilization... instead of the other way around. He has also mentioned he will try to code this in and get us an update.
     
  15. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,844
    Gender:
    Male
    Location:
    MN
    nevermind fixed it myself
     
  16. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,844
    Gender:
    Male
    Location:
    MN
    Ok i am having a problem with the attached file:

    It will not override the original file to be placed in the civ that i want to play? Each civ i play gives the original one and not the custom unit one, what is wrong????
     
  17. TAfirehawk

    TAfirehawk WoC Team Manager

    Joined:
    Aug 25, 2006
    Messages:
    2,326
    Location:
    Florida
    Well if you want it to replace the SAM Infantry, then you have to name it the same, not different as you have with Yellow_SAM_Infantry.

    Although I don't understand why it doesn't show up ingame as a regular unit :confused: It is in the pedia and WB just fine, but even when I turned off the upgrade unit tag it still wouldn't show up....


    EDIT:
    It looks like an EDU in the pedia saying it replaces the SAM Infantry....but it won't show up on a unique Civ if the CivilizationInfos.xml isn't in the Module as well.
     
  18. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,844
    Gender:
    Male
    Location:
    MN

    You know i thought of that also, about the CivInfo but i didnt want to use that because i wanted all civs to use it??:crazyeye:

    EDIT: Ok tried the <Class>UNITCLASS_SAM_INFANTRY</Class>
    <Type>UNIT_SAM_INFANTRY</Type>

    and it WORKED!!

    But only thing i was thinking about then was now if playing with other person(s) (multiplayer)they will have to use the same SamInfan then? I think?
     
  19. EmperorFool

    EmperorFool Deity

    Joined:
    Mar 2, 2007
    Messages:
    9,633
    Location:
    Mountain View, California
    I've never played a multiplayer game, but from the modding side I can pretty well bet you that all players must be using the same mods as you if you want to avoid problems. All you need to do is ZIP Up your CustomAssets folder and send it to the other players. The same goes for any succession or PBEM games -- any game that's shared among players in some way.

    If you just replace the unit with a similar unit with different abilities (meaning not a new unit), then the game would work if no one else has your mods, but the units would work differently for them than they do for you.
     
  20. TAfirehawk

    TAfirehawk WoC Team Manager

    Joined:
    Aug 25, 2006
    Messages:
    2,326
    Location:
    Florida
    Custom Assets is not used....but you are right, all players in MP will need identical Modules.
     

Share This Page