Quick Modding Questions Thread

The civilopedia (and other places, like the tech chooser) use a background called SCREEN_BG_OPAQUE.

This is defined in CIV4ArtDefines_Interface.xml. The definition just points to a DDS file. If you change the file that this points to, or overwrite the file with a different one of the same name, then the new art will be used.

Alternatively, you can create one or more new definitions in CIV4ArtDefines_Interface.xml and then change the places in the Python for which you want to use the new definition(s).
 
Is there a thread or post that explains all the tags in Civ4LeaderHeadInfos.xml? (For BTS, that is)

EDIT: Also, looking at the XML for ICBM's and Tactical nukes, I see a tag that says "<iNukeRange>1</iNukeRange>". What exactly does this tag do?

FINAL EDIT: Finally, which tutorials were the ones that depicted what sort-of looked like a person onto a flag, stretched and unstretched, as well as the tutorial that had lessons for making both 2d and 3d leaderheads? My searches are failing me.
 
For all XML related needs, the modiki is your friend :)
 
What do you mean?
Do you want to change the costs for an ongoing game, or do you mean something more like dynamical tech cost increase?
(latter one not doable without major programming skills)

FINAL EDIT: Finally, which tutorials were the ones that depicted what sort-of looked like a person onto a flag, stretched and unstretched, as well as the tutorial that had lessons for making both 2d and 3d leaderheads? My searches are failing me.

Uuuhh...no idea what you mean with the first.
For leaderheads you probably mean this thread.

2D leaderheads are in general simple .dds files (a plain image) with a specific setting. Not sure which exactly, but taking a look at the chinese mod in WL or the middle america mod in BtS should give you an idea.
(.dds can be opened with different programs, there are plugins for GIMP, Photoshop, and paint.net can IIRC do it be default; there's also a simple program named DXTBmp, in case you don't have any of the others).
 
I want to make the tech costs change with the number of cities. More cities - more tech costs. If programming is required, where to look for, in what files?
 
That needs definitely C++ programming.
But no idea where to look at, probably cvPlayer.cpp or cvTeam.cpp in the SDK folder.

(Since I don't know how much you know: Just editing these files will not do anything, you'll have to create a new .dll, see tutorial).
 
Yes, it is in CvTeam. Thanks.

How to make land resources hook up without roads like water resources?
 
I think that's directly a part of the water resources (code wise).
You could allow direct trading over land via a tech (like trading over oceans with astronomy), which will have the same effect (but this makes roades totally useless with a view on trading).
 
Hey, I'm having a series of errors all of which follow the same pattern:

Failed Loading XML file xml\Buildings/CIV4BuildingInfos.xml.
[.\FXml.cpp:133] Error parsing XML File-
File: xml\Buildings/Civ4BuildingInfos.xml
Reason: Invalid at the top level of the document
Line: 1,1
Source: i>>(upside down question mark)<?xml version= "1.0" encoding= "UTF-8"?>

So, can I get some quick help here? I feel like it should be an easy fix, but I can't figure out what.

Thanks in advance,
Radio Noer
 
Here's what I copy/pasted from, I made sure that when I saved the final file it was UTF-8. I still haven't gotten it to work yet.

EDIT: I've also included the full xml file folder, the issues are in BuildingInfos, UnitInfos, and CivilizationInfos.
 

Attachments

  • texas.txt
    72.3 KB · Views: 94
  • XML.7z
    1.3 MB · Views: 48
Not sure with what you edited the files, but when I take a look at your buildingInfos.xml (since that one is mentioned in your first post), then it begins with:
PHP:
<?xml version="1.0" encoding="UTF-8"?>

and the first 3 signs definitely shouldn't be there.
 
Not sure with what you edited the files, but when I take a look at your buildingInfos.xml (since that one is mentioned in your first post), then it begins with:
PHP:
<?xml version="1.0" encoding="UTF-8"?>

and the first 3 signs definitely shouldn't be there.

I'm just using Notpad, and I don't see any of those symbols :/. All I see is the correct entry. Any suggestions?
 
Those symbols are the UTF BOM (Byte Order Mark). That is the wrong format: it should be saved in a format without the BOM (which does exactly nothing in the UTF-8 format anyway). Notepad is notorious for inserting the useless BOM into the beginning of UTF-8 files. While it is missing some useful features of other programs as well, this is possibly the main problem with trying to use Notepad to mod Civ. Apparently, if Notepad thinks the file is UTF-8 instead of 7-bit ASCII or 8-bit ISO 8859-1/"Latin-1" (or Windows-1252, which is slightly different in ways that are frequently irrelevant for text) then it will insert the BOM.

In fact, as far as I know all of the Civ4 XML files, at least those in the version sold in North America (and probably South America too) and western Europe, are actually 7-bit ASCII format, regardless of what the encoding property in the xml tag says they are. All 8 bit characters are encoded using the HTML numeric encoding method to make them 7-bit ASCII (like, for example, "ö" is put into the file as "& #246 ;" (without the 2 spaces)) and the only Unicode symbols out of the 8 bit range are encoded using a "[THING_FOO]" type encoding (like the production hammer icon is "[ICON_PRODUCTION]").
 
Top Bottom