WoC "How to Mod" Guide

Status
Not open for further replies.

TAfirehawk

WoC Team Manager
Joined
Aug 25, 2006
Messages
2,326
Location
Florida
This will explain in great detail the steps to creating mods/modules in the WoC Standard.

Specific examples for each "Custom" group will be given.
 
Custom Art Styles

Custom Buildings

Custom Civics

Custom Civilizations

Custom LeaderHeads
 
Custom Corporations

Custom Projects

Custom Promotions

Custom Combat Categories

Custom Units
 
Custom Resources

Custom Technologies

Custom UI

Custom Wonders
 
Help! What am I doing wrong?:confused:

First of all, I'm no modder - so please bare with me if some of the following seems a bit redundant, cryptic, or just plain unintelligible...

I've been trying to incorporate TheLopez's M.A.D. Nukes Mod (converted to BtS by macsbug) into WoC.

I've managed to make a new CvGameCoreDLL file by combining the WoC sdk available at svn, with the MAD Nukes sdk.

I've placed the mod in the 'modules' folder.

I've removed everything from the mod's XML files that does not concern 'MAD nukes'.

I've renamed and placed the mod's XML files in a manner similar to other mods in the 'modules' folder (I've kept the mod's 'python' folder - is this right?). I've also re-edited the needed XML Schemas, so they correspond with the existing ones in WoC.

I've added the mod to the 'MLF_CIV4ModularLoadingControls' file (under 'misc. groups').

Yet, when I try to load WoC with the new mod I keep getting 'Failed loading XML file Modules\MAD Nukes\MAD_Nukes_CIV4(...).xml' error messages, concerning different xml files from the added mod. Otherwise WoC loads as normal.

Also, the new CvGameCoreDLL.dll file that I made is only aprox. 6,5 mb to the WoC original's aprox. 9,5 mb - any reason for this? I've been using Codeblocs and Kael's guide to 'installing and using the SDK'.

Any help or advise would be very much appreciated.:)
 
Help! What am I doing wrong?:confused:

First of all, I'm no modder - so please bare with me if some of the following seems a bit redundant, cryptic, or just plain unintelligible...

I've been trying to incorporate TheLopez's M.A.D. Nukes Mod (converted to BtS by macsbug) into WoC.

I've managed to make a new CvGameCoreDLL file by combining the WoC sdk available at svn, with the MAD Nukes sdk.

I've placed the mod in the 'modules' folder.

I've removed everything from the mod's XML files that does not concern 'MAD nukes'.

I've renamed and placed the mod's XML files in a manner similar to other mods in the 'modules' folder (I've kept the mod's 'python' folder - is this right?). I've also re-edited the needed XML Schemas, so they correspond with the existing ones in WoC.

I've added the mod to the 'MLF_CIV4ModularLoadingControls' file (under 'misc. groups').

Yet, when I try to load WoC with the new mod I keep getting 'Failed loading XML file Modules\MAD Nukes\MAD_Nukes_CIV4(...).xml' error messages, concerning different xml files from the added mod. Otherwise WoC loads as normal.

Also, the new CvGameCoreDLL.dll file that I made is only aprox. 6,5 mb to the WoC original's aprox. 9,5 mb - any reason for this? I've been using Codeblocs and Kael's guide to 'installing and using the SDK'.

Any help or advise would be very much appreciated.:)

Python is not modular.

The WoC DLL has Asserts turned on, so it will be bigger.

Be very careful making new schema files...hopefully you started with a WoC schema file and added the MAD Nukes.

MAD Nukes never seemed to work in ViSa for Warlords....but it was a merge issue that could still be around in BtS.

In general you have done at least 90% of it correctly...not sure what else would keep it from working.
 
Okay, so do I have to merge the MAD Nukes python files with the existing ones in WoC?

I have been using existing WoC schemas and then added the MAD Nukes changes.

Is it by any chance possible to point to where my mistake(s) is likely to be found?

And at the risk of asking the obvious - how exactly do you turn on Asserts for a DLL file? Do I need it turned on? And not having done this when I made the new DLL file, will it cause WoC not to work properly?

Thanks for the speedy reply!:)
 
Well, I got it working - meaning I managed to load WoC with the MAD Nukes module without any error messages popping up. I havn't checked if it's working ingame yet, but added stuff are appearing in the Civilopedia - so hopefully that's a good sign...

I merged the MAD Nukes python files into the WoC pythons - was this correct?

Also, I kept getting an error refering to a MAD Nukes function used in the BuildingInfos but not declared in the BuildingsSchema - eventhough the mentioned function had been declared in the schema.

It wasn't until I added the function to the buildingsSchema for the 'Canadian Microwave Tower' in the 'Custom buildings' module, that the problem was solved - thought I'd better mention it, in case it's a thing to be solved, or if others should run in to similar problems.
 
Glad you got it working....and Asserts being turned on is just for our debugging.

And the pythons, I haven't tried to eliminate any of them but I am sure the ones related to un-used Modules are not needed.
 
This is a information on HOW and WHAT does the game load.
It seems this isn't clear to all the users/modders, so I'm going to explain it here.
I have to do this because unnecessary bugs are appointed to me which are NOT even a bug itself, but just a reason for someone not reading the WoC guidelines.
the Bugreport I'm referring too is:
Bugreport 186

Now, what is WoC all about? I'm now unfortunatly have to repeat myself, but here we go:
the Modular Loading means you enter every non-default value into any modular XML, and it's loaded. To avoid defaults overwriting tags once set, there is on every xml a checkup for defaults, if default, check if some other module already loaded "something" if yes, use that one.
if bWater or whatever is set once by any file, it is set ingame. If you want the OVERWRITE technique, don't use WOC..This is the wrong place...
OVERWRITING is what firaxis comes with, any additional module just overwrites anything else, and you can't combine modules..impossible in default firaxis..every new occurance of any type destroys all info from any previous module with that type..
in WoC we just a copy/append approach. Technically, it would be possible even to make a
IF TAG EXIST, USE IT's VALUE, that would give the possibility to override settings from other modules, but I'm not sure if that's wanted because it will get very complicated then finding tags overwriting tags they shouldn't..
therefore, you cannot in WOC overwrite a TRUE with a FALSE ...
now, how can you proceed in woc?
if you want to use <bWaterWork>0</bWaterWork> but it was already set by
<bWaterWork>1</bWaterWork> some other file, just remove it from that file, and have it OPTIONAL in some special dir ...that's easy todo in WOC..


now i can understand some people might not understand how to override FIRAXIAN settings, so I'm going to eluminate your knowledge about firaxis standard files..

all standard files, are looked for in the following order:
  1. C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\World of Civilization\Assets\XML
  2. C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Assets\XML
  3. C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Warlords\Assets\XML
  4. C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Assets\XML

after the game loaded the default firaxis files, it goes into the
  • C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\World of Civilization\Assets\Modules
  • Loading accordingly the MLF if a MLF exists
  • Loading everything in the Modules if no MLF exists

so if a tag, as in the bugreport 186, is set to true by firaxis, you have to disable this tag in firaxis, and move it's "enable" to a \Modules\whatever

To have no misunderstandings about WHERE ANY tag is loaded, i moved them all(all files loaded by BTS-WOC) to the C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\World of Civilization\Assets\XML

ANY TAG you can find there. There is NOTHING else in ANY dir loaded besides from that dir! At least not of the XML's...

Of course, we don't want to mess around with firaxis settings, so if you disable any default setting from there, make sure to have a folder in the Modules corresponding the change to make sure any player can enable any default tag from within the modules again..

I hope this is understandable, else check SVN 1451 log to see what I've done

also read the readme.txt in the svn 1451 change
 
Here is a rough draft version of the how-to for adding a civ.

Start with a base directory the standard name of the folder is the same as the civilization.
Inside this folder there may be three more folders one for the graphics and two optional, one
for the sound for the units being selected(SelectOrder), the other for the Leaders (Soundpack)

Into base cirectory copy over the following woc xml schemas from EmptyModuleExample
CIV4ArtDefinesSchema
CIV4CivilzationsSchema
CIV4InterfaceSchema

There will be up to five XML files needed. The WoC naming stadard is to start out the file
name with the name of the civilization. When working on the xml files, look at the appropriate
schema files. A lot of the tags are optional - only include them if you need to change the
default value. Also look at the other civilizations included in the civilization folder - that
is why they are there, to show what can be done and how to do it.

XXX_CIV4ArtDefines_Civilization.xml (where XXX should be replaced with name of the Civ)
Like the name describe, this file is used to define where the graphics used for
this civ is located. Along with this file, you will have to create two directory structures
inside the Art folder created in the base directory. Create the two directory structures and
copy in the appropriate graphic files

Art/Interface/Buttons/Civilizations - for the file(s) containing the graphics for the button

Art/Interface/Team Color - for the file(s) containing the graphics for the flag

The value for the type tag should match up with value for the ArtDefineTag in the
CIV4CivilizationInfos file

XXX_CIV4CivilizationInfos.xml (where XXX should be replaced with name of the Civ)
This file contains the information needed for the civilization. All references to
the unique buildings, unique units, and leaders do not belong here - they will go in their
own deployment.

Need to have the following tags -

Description - matches up to a tag in the GameText file
ShortDescription - matches up to a tag in the GameText file
Adjective - matches up to a tag in the GameText file
Civilopedia - matches up to a tag in the GameText file
List all the city tags - match up to entries in the GameText

DefaultPlayerColor - matches up to the type tag in the PlayerColorInfos file

FreeUnitClasses
FreeBuildingClasses
FreeTechs
InitialCivics

CivilizationSelectionSound - needs to match up the a ScriptID in the
XML/Audio/Audio3DScripts.xml file - this is not modularizable so there is only one.
CivilizationActionSound - needs to match up the a ScriptID in the
XML/Audio/Audio3DScripts.xml file - this is not modularizable so there is only one.

XXX_CIV4ColorVals.xml (where XXX should be replaced with name of the Civ)
This file defines custom colors.
Defines custom colors.
For each color defined, you need to use 5 tags,
<Type>
<fRed>
<fGreen>
<fBlue>
<fAlpha>

XXX_CIV4PlayerColorInfos.xml (where XXX should be replaced with name of the Civ)
Indicates what colors this civ will use - either custom or standard.

<Type> - the name of this color scheme - will be used in
CIV4CivilizationInfos file
<ColorTypePrimary> - color either standard or custom (defined
in the CIV4ColorVals file)
<ColorTypeSecondary> - color either standard or custom (defined
in the CIV4ColorVals file)
<TextColorType> - color either standard or custom (defined
in the CIV4ColorVals file)


XXX_CIV4GameText.xml (where XXX should be replaced with name of the Civ)
This file specifies the text to be displayed when the tag is used.
For each Tag, you need to provide the English, French, German,
Italian & Spanish translations. Generally we do not use the gender &
plural. SimCutie' Civ4Translator can be used for the translations
if you are not multi-lingual.
As a minimum you should define are the description, short description,
civilpedia entry, adjective, and each city name.



All comments and suggestions are welcomed
 
This is a information on HOW and WHAT does the game load.
It seems this isn't clear to all the users/modders, so I'm going to explain it here.
I have to do this because unnecessary bugs are appointed to me which are NOT even a bug itself, but just a reason for someone not reading the WoC guidelines.
the Bugreport I'm referring too is:
Bugreport 186

I am the lazy one :)

I understand what you have said. But just imagine the situation: a player (non-modder) loads WoC as it is, starts a new game, and sees both boating and fishing having "enable work on water". From this point of view, this is a bug and should be fixed by some way or another.

Of course in case of bWaterWork this "bug" can be ignored - it doesn't change the game, but suppose this is iHealth or iHappiness tag... There would be problems.

-----------------

Now about the manual. Do you mean World of Civilization Manual v0.100.doc from the SVN? It is almost empty. Or I have read the wrong one?

I know that you gays have no much free time, but please write a little bit more detailed manual. I am a modder with long experience, tracing the WoC thread from November, but still have not enough knowledge to start my own mod under the WoC.

taketounwanted,
Your post was very useful. Thanks for the detailed explanations.
 
I am the lazy one :)

I understand what you have said. But just imagine the situation: a player (non-modder) loads WoC as it is, starts a new game, and sees both boating and fishing having "enable work on water". From this point of view, this is a bug and should be fixed by some way or another.

Of course in case of bWaterWork this "bug" can be ignored - it doesn't change the game, but suppose this is iHealth or iHappiness tag... There would be problems.

-----------------

Now about the manual. Do you mean World of Civilization Manual v0.100.doc from the SVN? It is almost empty. Or I have read the wrong one?

I know that you gays have no much free time, but please write a little bit more detailed manual. I am a modder with long experience, tracing the WoC thread from November, but still have not enough knowledge to start my own mod under the WoC.

taketounwanted,
Your post was very useful. Thanks for the detailed explanations.

The biggest challenge we have is to get the documentation done for modders. As everybody knows, it is the last thing anybody wants to do....so I am cracking my whip as hard as I can, as hard as I can for people not getting paid.... :whipped:
 
Looking forward to that, my xml worked in 0.80 but has failed to do so ever since (CTD during load). imo it should work, having a documentation might provide hints to what is wrong (unless it actually is your code).

EDIT: I try to keep WoC minimal, i.e. as little WoC xml and Python as possible, so some documentation on what actually IS required would be nice ;)
 
Looking forward to that, my xml worked in 0.80 but has failed to do so ever since (CTD during load). imo it should work, having a documentation might provide hints to what is wrong (unless it actually is your code).

EDIT: I try to keep WoC minimal, i.e. as little WoC xml and Python as possible, so some documentation on what actually IS required would be nice ;)

Right now you need everything but Modules....sure there are some things you can take away like the soundtrack and main menu, but Modules is 99% of the total size. I don't know exactly what is required as everything should be kept except Modules....

I have no idea why you are getting CTD's if you are using SVN 1499 (somewhere in the 1470's was the CTD fix I think)....we do have one failed assert left that is an eBuildNum problem, but other than that you should have zero problems, or we need to hear them here :)
 
Well, most of your XML/... stuff should not be needed as it just repeats the standard definitions.

If I knew what the problem was I would says so, I get a CTD upon loading, that is all I know. It also crashes with all of your definitions (except for modules) and my regular (i.e. non-WoC'ed) xml. I would have expected it to work as regular xml should be compatible with WoC as well, it just doesn't use the new features introduced with WoC.
 
Well, most of your XML/... stuff should not be needed as it just repeats the standard definitions.

If I knew what the problem was I would says so, I get a CTD upon loading, that is all I know. It also crashes with all of your definitions (except for modules) and my regular (i.e. non-WoC'ed) xml. I would have expected it to work as regular xml should be compatible with WoC as well, it just doesn't use the new features introduced with WoC.

You need to have the latest SVN and that XML folder to get around a Firaxis bug.
 
Ok, quick question, any mod which changes xml only (i.e. does not come with a custom dll or custom Python) should be able to run with WoC (i.e. all of WoC except the 'Modules' and 'Unloaded Modules' folders) without requiring any changes, right ?

If it does not, that is a problem on your side, right ?

EDIT: at least those mods which do not change any of the xml definitions you changed in the XML/... hierarchy
 
Trying to get WoC working with FfH, which is quite a complex mod itself. So far I have managed to get the combined DLL to merge and compile without errors, but then there are issues with loading the game.

So, to test it out, I loaded the WoC DLL up into Crossroads of the World, and attempted to start it. In theory with the spirit of WoC, I ought to be capable of doing that. But after some heavy testing I found that you must include with the DLL:

Assets/Modules/CIV4ModularLoadingControlsSchema.xml
Assets/Modules/MLF_CIV4ModularLoadingControls.xml

---If not present, XML load error pop-up, game still loads and even seems to use the TGA fairly well.


Assets/res/Fonts/CIV4GlobalDefinesSchema.xml
Assets/res/Fonts/GameFont_CIV4GlobalDefines.xml

--If not present, XML load Error pop-up, game still loads and seems fine


Assets/XML/Art/CIV4ArtDefines_Interface.xml
--If not present, Assert Message, game still loads and seems fine


Assets/XML/GameInfo/CIV4CommerceInfo.xml
Assets/XML/GameInfo/CIV4Hints.xml

--If not present, Commerce gives an Assert issue, game loads and seems fine. But the Hints will cause the game to crash before loading the main screen if not present.
 
Hey guys, could really use some expert help.

As you may well know, had a really good (well, in my opinion it was good) Civics Mod for Warlords. It took a bit of testing, but I had all the extra tags working perfectly. Somehow, though, the tags have lost their functionality in the porting process, and I am at a loss to figure out why. Could someone possibly go over to my thread here: http://forums.civfanatics.com/showpost.php?p=6864035&postcount=178 and just check my files and let me know where I'm going wrong? I would very much like to commit this work to the overall WoC project as soon as I get everything working!

Aussie_Lurker.
 
Status
Not open for further replies.
Top Bottom