View Full Version : Problems with modular loading


Alulim
Aug 07, 2007, 06:19 PM
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.


Modules don't seem to load from CustomAssets. According to 14.3 in Kael's post here (http://forums.civfanatics.com/showpost.php?p=5630431&postcount=1), 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?


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?

purplexus
Aug 08, 2007, 06:29 PM
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

ambrox62
Aug 09, 2007, 05:06 AM
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

<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

<?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...)

purplexus
Aug 09, 2007, 06:58 AM
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.

ambrox62
Aug 09, 2007, 11:07 AM
Ok, thanks!

I made this (http://forums.civfanatics.com/showthread.php?t=237153) following your standard

Alulim
Aug 09, 2007, 05:12 PM
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:

purplexus
Aug 09, 2007, 05:51 PM
Ok, thanks!

I made this (http://forums.civfanatics.com/showthread.php?t=237153) following your standard

Let me add it in to the Library. Good work.:goodjob:

purplexus
Aug 09, 2007, 05:53 PM
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:

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

Impaler[WrG]
Aug 10, 2007, 05:23 PM
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.

EmperorFool
Aug 11, 2007, 04:28 AM
I also encountered the problem that modules don't seem to load from CustomAssets. See my other post here (http://forums.civfanatics.com/showthread.php?p=5805519#post5805519). Has anyone found a work-around for this?

purplexus
Aug 11, 2007, 07:26 AM
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.

Aeven
Aug 12, 2007, 04:18 AM
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.

Edgecrusher
Aug 13, 2007, 06:45 PM
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.

purplexus
Aug 13, 2007, 10:45 PM
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.

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.

strategyonly
Aug 21, 2007, 09:27 PM
nevermind fixed it myself

strategyonly
Sep 26, 2007, 07:15 AM
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????

TAfirehawk
Sep 26, 2007, 05:47 PM
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????

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.

strategyonly
Sep 26, 2007, 09:35 PM
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.


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?

EmperorFool
Sep 27, 2007, 12:04 AM
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.

TAfirehawk
Sep 27, 2007, 04:03 PM
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.

Custom Assets is not used....but you are right, all players in MP will need identical Modules.

strategyonly
Oct 02, 2007, 09:17 AM
One thing i just noticed is that when loading MODULES, from all different civs alot of them override each other and add buildings to your civ???

Example, i am trying one civ that has no archery range listed in it, but when i add a modular civ that has an archery range in it, MY civ now gets that range as a choice of building?? why is this??
This happens in every civ that has a BuildingClass extra building. It adds ALL the buildings listed.

How do i solve this problem?

TAfirehawk
Oct 02, 2007, 04:24 PM
One thing i just noticed is that when loading MODULES, from all different civs alot of them override each other and add buildings to your civ???

Example, i am trying one civ that has no archery range listed in it, but when i add a modular civ that has an archery range in it, MY civ now gets that range as a choice of building?? why is this??
This happens in every civ that has a BuildingClass extra building. It adds ALL the buildings listed.

How do i solve this problem?

This is the overwriting tag problem that I have mentioned in numerous threads here and on the WoC forum.

mrgenie might have a solution without Firaxis....but by far the best solution is for Firaxis to expose some more variables out of the EXE and into the SDK. Otherwise you are basically screwed as is the WoC at making EVERYTHING modular....some stuff can still be modular but the civilizationinfos.xml is not 'friendly' yet.

strategyonly
Oct 02, 2007, 04:38 PM
This is the overwriting tag problem that I have mentioned in numerous threads here and on the WoC forum.

mrgenie might have a solution without Firaxis....but by far the best solution is for Firaxis to expose some more variables out of the EXE and into the SDK. Otherwise you are basically screwed as is the WoC at making EVERYTHING modular....some stuff can still be modular but the civilizationinfos.xml is not 'friendly' yet.

Ok, but again i have only noticed this when you use a new "ClassInfo"
If you use something that already has a ClassInfo, it works great. Oh well i guess i will have to go find a ClassInfo to use in its place for now then, but thx for the new info.;)

TAfirehawk
Oct 02, 2007, 04:52 PM
Ok, but again i have only noticed this when you use a new "ClassInfo"
If you use something that already has a ClassInfo, it works great. Oh well i guess i will have to go find a ClassInfo to use in its place for now then, but thx for the new info.;)

Not sure I understand your exact problem without digging deep into it....but it sounds like an xml loading issue that is not perfect by any means.

Without a couple MAJOR/KEY changes, the modular xml loading goal can not be fully realized.

strategyonly
Oct 02, 2007, 05:46 PM
Not sure I understand your exact problem without digging deep into it....but it sounds like an xml loading issue that is not perfect by any means.

Without a couple MAJOR/KEY changes, the modular xml loading goal can not be fully realized.

What i am trying to say is if you make a NEW unit/building and dont use the "swordsman/maceman" already there or "factory/wall" furnished and you make a NEW classinfo, thats when this happens.:rolleyes: