Quick Modding Questions Thread

You can open an XML file in a browser to see if it is a valid XML. If not - it will show you the exact position where it breaks. (This only refers to the XML structure itself, not to the Civ-specific requirements).

It doesn't, though- it just says 'Cannot open modules/etc/Female_Range/ArtDefineLeaderhead.

...Now, that might seem like enough, but I just can't descover what exactly I'm doing wrong to transfer the file over. Everything looks like it should work. It would be nice if it told me which exactly line wasn't working, but it doesn't..
 
2) Huh... weird. I can't find where the XML files actually go, even for mods like Next War.

Uuhh...eh...at what folder are you exactly looking at (complete path please).

3) This is kind of a stupid question, but where can I mod that..? (Really, really sorry. I just started modding yesterday for Civ4.)

In the main menu, there are 4 (okay, some more) options:
- Play now
- Custom game
- Play a scenario
- Custom scenario

The custom game option is the advanced menu for normal games (for play now), like you know.
The custom scenario option is the advanced menu for the play a scenario option.
So if you have a premade map, and you want to adjust anything, then just load your mod, and begin a game on this map with custom scenario.
 
Care to post the xml file?

I would, but it keeps saying that the files are 'invalid' when I go to upload them.

I'll just post the code here, if that is okay. Note: I'm doing this on notepad.

<?xml version="1.0"?>
<!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Firaxis Games (Firaxis Games) -->
<!-- Sid Meier's Civilization 4 -->
<!-- Copyright Firaxis Games 2005 -->
<!-- -->
<!-- Leaderhead art path information -->
<Civ4ArtDefines xmlns="x-schema:Female_Ranger_CIV4ArtDefinesSchema.xml">
<LeaderheadArtInfos>
<LeaderheadArtInfo>
<Type>ART_DEF_LEADER_FEMALE_RANGER</Type>
<Button>,Modules/Custom Civilizations/Scotland/Female_Ranger/Female_Ranger.dds</Button>
<NIF>Modules/Custom Civilizations/Scotland/Female_Ranger/Art/Boudica.nif</NIF>
<KFM>Art/LeaderHeads/Boudica/Boudica.kfm</KFM>
<NoShaderNIF>Modules/Custom Civilizations/Scotland/Female_Ranger/Art/Boudica_noshader.nif</NoShaderNIF>
<BackgroundKFM>Modules/Custom Civilizations/Scotland/Female_Ranger/Boudica_BG.kfm</BackgroundKFM>
</LeaderheadArtInfo>
</LeaderheadArtInfos>
</Civ4ArtDefines>

...I'm pretty sure all the paths are correct, but I may be wrong. I am 75% certain I'm just missing something stupid, so maybe someone else looking it over will help me find out what's going wrong.
 
Uuhh...eh...at what folder are you exactly looking at (complete path please).

In the main menu, there are 4 (okay, some more) options:
- Play now
- Custom game
- Play a scenario
- Custom scenario

The custom game option is the advanced menu for normal games (for play now), like you know.
The custom scenario option is the advanced menu for the play a scenario option.
So if you have a premade map, and you want to adjust anything, then just load your mod, and begin a game on this map with custom scenario.

1) Found it. I had lost it when combinding Next War with the mod I'm currently trying to enjoy- easy enough to find now that I think clearly about it.

2) Aaaaaaaaaahhhhhhhhhh......... well, I'm not even going to pretend that that wasn't stupid of me. I knew that. -_-

And, thank you both for helping out such a newb.
 
So, after a decent amount of work (you can tell how bored I am, considering the amount of time I'm putting into this) I've gotten past several of the problems that affected me before. I just have two left now.

1) It keeps telling me that the CivilizationsInfo isn't reading the Leader_FEMALE_RANGER file- and I have no idea what to do to change this.

2) The buttons aren't showing up- not even in an annoying purple square. I'm not sure why not. In all honesty, I think this is probably the reason why I'm having problems with numer 1, though I can't prove that.
 
Do you have the "Female_Ranger_CIV4ArtDefinesSchema.xml" file (note the word "Schema" in the file name) in the same folder as the actual art def file? You should.
 
my mod has 11 religions and 6 corporations. only the religions and the first 3 corporations will appear on the city bar, (although when I add the others the existing religion and corporation logos move over and leave blank space for them). since this is 14 total which is also the total of religions plus corporations in the regular game I thought that might be the reason. does anyone know how to change/fix this? also I am getting the golden age sun disk on all my cities, no matter which civ I start with. this is with xml and art changes only, no modded dll or python.
 
Assets\res\fonts\Gamefont.tga + _75.tga, take a look at them with DXTBmp.
Order of the symbols has to be the same like in Religion/CorporationInfos.

And be damn careful with editing. Doing something wrong there will screw the interface or will even bring civ to crash.
 
I did the tga files. purple lines, blue dots and alpha channel all accounted for. the first three corps, which have modded symbols, work fine, its just 4-6 that don't.
 
yesI added all the require resources and they are in the city screen. I did the alpha channel too. here are the files:
 

Attachments

I don't know why, but if i take a look at the files with IrfanView, i get unusual pink lines to the sides of the last 3 pairs of icons, but not for the rest :confused:.

attachment.php
 

Attachments

  • Clipboard01.jpg
    Clipboard01.jpg
    23.4 KB · Views: 159
nice detective work my friend. the alpha channel was off by a pixel, revealing the pink lines and messing up the game. all is well now.
 
I'm taking a break to brush off my python while I get answers to my questions about GameFont, and I'm making this little Python modcomp. How does the CanConstruct callback work? It seems to always return false.
 
The canConstruct callback does normally return False. It is checked at the beginning of the function used in the DLL (also called canConstruct, it is part of the CvCity class) to determine if the DLL's function should just return "True" and not bother with it's normal checks. So if the Python callback returns True the DLL does not do any of the normal checking that it does and just returns True itself, allowing the building to be built whether or not it would normally be possible.

The cannotConstruct callback, on the other hand, happens at the end of the DLL's CvCity::canConstruct function. It too normally returns False. If it returns true then CvCity::canConstruct function throws out it's determination that the city can construct the building in question and just says False. It only happens if CvCity::canConstruct would return True, sicne if it would return False from any of it's test then it has already done so (it doesn't save a value to return and then return that at the end - if any of the tests it does work out to an answer of False it immediately exits the function with a "return false".)

Most (if not all) of the function that have both a canX and cannotX callback work like that. The "can" version is called before the function int he DLL actually does any checking and forces action X to be possible no matter what if it returns True and the "cannot" version, if it returns True, forces it to be impossible if it would have otherwise been possible.

Of course, you have to make sure that the callback in question is actually activated in PythonCallbackDefines.xml or the DLL will not use it. These callbacks are provided for mod use: the regular BtS game doesn't actually use them so they are normally set to be disabled.
 
I'm compiling a dll for a rhye's modmod.

I started with rhye's files, added my own CvRyhes.cpp and CvRhyes.h.

compiled many times and got rid of many bugs to do with working with my civs and map, nothing deleted, just commented out, no problems

I am now getting a different kind of error as follows:

Code:
CvCityAI.obj : error LNK2001: unresolved external symbol "public: virtual enum BuildingTypes __thiscall CvCityAI::AI_bestBuilding(int,int,bool,enum AdvisorTypes)" (?AI_bestBuilding@CvCityAI@@UAE?AW4BuildingTypes@@HH_NW4AdvisorTypes@@@Z)

I found the reference in CvCity.h but its not part of Rhye's changes

and this:

Code:
CvDLLButtonPopup.obj : error LNK2019: unresolved external symbol "public: void __thiscall CvGameTextMgr::setTimeStr(class CvWString &,int,bool)" (?setTimeStr@CvGameTextMgr@@QAEXAAVCvWString@@H_N@Z) referenced in function "private: bool __thiscall CvDLLButtonPopup::launchLaunchPopup(class CvPopup *,class CvPopupInfo &)" (?launchLaunchPopup@CvDLLButtonPopup@@AAE_NPAVCvPopup@@AAVCvPopupInfo@@@Z)

occurs a few times but again doesn't seem to be part of Rhye's changes.
 
Do you have these functions (CvCityAI::AI_bestBuilding, CvGameTextMgr::setTimeStr) defined anywhere? I mean defined - with their implementation - and not declared (header only).

You got a linker error, which means that the compiler went over your code and verified that everything is fine, assuming these functions exist, but when the linker actually tried pointing to them - it couldn't find them.
 
Back
Top Bottom