Bug Reports

I can't see how to edit the wiki you created for FAs? Anyway, I fixed to FA and posted them to Git:

Edit: I also made notes on some of the FAs in the first post.

File: CvUnit.cpp
Line: 11298
Expression: false
Message: Unit can not have profession

This was because of trying to Educate Criminals when there was no units left in the city as the unit had to be removed to be Educated and as we all know cities can never have less than one population

and

File: CvInfos.cpp
Line: 15607
Expression: i < GC.getUnitInfo((UnitTypes) j).getGroupDefinitions((ProfessionTypes) m)
Message: Index out of bounds

This was because the extra camel unit for the Wily Trader's Merchant graphic was not also in CIV4UnitArtStyleTypeInfos.
 
Ok, I have a question for you. When you are debugging say in CvCity.pp, is there a way to get the attributes of that city. Like if you hover or LoopCity you can view that cities attributes, like it's X and Y coordinates. I stepped out until I found where LoopCity had called a function in CvCity.pp in this case but I was wondering if there is a way to do this without stepping out of the current code.
If you have a pointer to the city, then you can use that pointer to get int m_iX and int m_iY.
Most of the time you will have a pointer named "this". It points to the object in question. Say you have
Code:
myCity.getMaxYieldCapacity();
Inside getMaxYieldCapacity() this will point to myCity. This is how C++ works and isn't specific to this mod.
Sometimes you will see people write this->m_iX instead of just m_iX. It does the same and the compiler will convert the latter to the first. The first is supposed to be less prone to bugs and easier to read as it is clear that it is a member variable. Firaxis decided to name the members m_* instead.
You can also do this->myCity.getMaxYieldCapacity(); if you like.

I can't see how to edit the wiki you created for FAs?
I removed the two asserts, but if you don't get an edit button, then the wiki is a really bad solution.
EDIT: did you remember to log into github? :)
Either way I opened up the wiki to allow everybody to edit it. Feel free to add pages as needed. I thin you do need to log in to edit though, but any free account will do.

Anyway, I fixed to FA and posted them to Git:
Remember that I made an issue with this bug specifically: https://github.com/Nightinggale/Medieval_Tech/issues/1
If your first line had been
Fixed two failed asserts: Closes #1
then I wouldn't have to close the issue manually. Also #1 turns into a link and all that. Go back and watch the video if you didn't notice.
 
I finally downloaded 2.0h. I suspect the problem was mine, a bad cached url for the mod.

Now I'm getting an XML error:

"Tag: MODER_CODE_TRADING_POST in info class was incorrect. Current XML file is: xml\Buildings/Civ4Buildinginfos.xml"

And I got a ton more XML errors. Did I screw up in applying the update? The game does start, but not, I'm guessing, for long.

EDIT: But this only happened the first time. I have a screwy hunch this had to do with a cached map or something. So, I'm guessing, no worries.
 
Current XML file is: xml\Buildings/Civ4Buildinginfos.xml
Is it \ or /? You can't mix windows and posix style paths. I hope you failed copying the error message correctly.
You are right that you shouldn't accept the game giving errors when starting. If you did as I do and stored all the compressed releases, then you can delete M:C and install it all over. It's not unlikely that you screwed up somehow. Make note of the first post about which updates to install and in which order.
 
EDIT: But this only happened the first time. I have a screwy hunch this had to do with a cached map or something. So, I'm guessing, no worries.

So, all is good now I presume?

Edit: I fixed a few more FAs in the Git version namely...

File: CvPlayerAI.h
Line: 24
Expression: ePlayer >= 0
Message: Player is not assigned a valid value
Fixed in Current Git, AI Europe Popes and Kings were trying to use Trader AI units and this was causing errors.

File: CvPlayer.cpp
Line: 4958
Expression: GC.getCivilizationInfo(getCivilizationType()).getCivilizationUnits(eUnitClass) == eUnit
Message:
Fixed in Current Git, AI Popes and Kings had wrong Class assigned to Artillery aka Trebuchets.

File: CvPlayer.cpp
Line: 5097
Expression: GC.getCivilizationInfo(getCivilizationType()).getCivilizationBuildings(eBuildingClass) == eBuilding
Fixed in Current Git, added code to first check for Civilization Buildings before cities are assigned a Free Building

File: CvPlayer.cpp
Line: 14645
Expression: iPrice <= getGold()
Commented Out in Current Git
 
Commented Out in Current Git

git said:
- FAssert(m_pUnitInfo->getDefaultUnitAIType() == AI_getUnitAIType());
+ //FAssert(m_pUnitInfo->getDefaultUnitAIType() == AI_getUnitAIType());

- FAssert(iPrice <= getGold());
+ //FAssert(iPrice <= getGold());
Looks to me like the guy who gets tired of breaking fuses and fixes it by inserting a coin only to see his house burn to the ground. Asserts are there for a reason and disabling the warning about the assert will not fix the bug itself. It will only conceal it. In general I would say that there should be a really good reason for commenting out asserts and you provided none. In fact you didn't even include the top one in the commit message.

I wouldn't mind debugging those asserts, but VC++ played a trick on me. For unkonwn reasons it decided to switch the character set in the editor to shift-jis for apparently no reason :confused:
I need to figure out why before I commit anything at all, though the code and comments looks more interesting right now. The problem is that when I google for VC++ and character set it finds stuff on how to convert character sets in C++ code, not how to set the editor :cringe:
&#12363;&#12435;&#12376;&#12288;&#12377;&#12372;&#12356;&#12288;&#12391;&#12377;&#12288;:eek::lol:
 
The first assert was one I added myself for testing so I just removed it until I want to test some more. The second assert I can see no reason for it to even be there and I may have added it too to stop the code for some reason. Ive been working on this mod for three years now and my memory needs replaced. Anyway, If you try to buy something and don't have enough gold you get the failed assert and you also get a message in the in game purchase log saying you don't have enough gold. So, there is no way to fix it other than to comment it out. I should have explained my reasoning better.

Edit: furthermore, right after the failed assert is the player log code, so if you "fix it" so the assert want fail somewhere up earlier in the code then the player want get the message about why he can't purchase what he is trying to purchase.
 
Is it \ or /? You can't mix windows and posix style paths. I hope you failed copying the error message correctly.

1. No, the messages do mix backslashes and forward slashes.

2. The error messages are back. I get these messages whenever the game starts.

3. The full list of errors is:

Spoiler :
"Tag: MODER_CODE_TRADING_POST in info class was incorrect. Current XML file is: xml\Buildings/Civ4Buildinginfos.xml"
"Tag: MODER_CODE_TRADING_POST in info class was incorrect. Current XML file is: xml\Buildings/Civ4Buildinginfos.xml"
"Tag: MODER_CODE_TRADING_POST in info class was incorrect. Current XML file is: xml\Buildings/Civ4Buildinginfos.xml"
"Tag: MODER_CODE_ONLY_NONE_NATIVES in info class was incorrect. Current XML file is: xml\Buildings/Civ4Buildinginfos.xml"
"Tag: MODER_CODE_ONLY_NONE_NATIVES in info class was incorrect. Current XML file is: xml\Buildings/Civ4Buildinginfos.xml"
"Tag: MODER_CODE_AI__ONLY in info class was incorrect. Current XML file is: xml\Buildings/Civ4Buildinginfos.xml"
"Tag: MODER_CODE_AI__ONLY in info class was incorrect. Current XML file is: xml\Buildings/Civ4Buildinginfos.xml"
"Tag: MODER_CODE_NATIVES_VIKING_AGE in info class was incorrect. Current XML file is: xml\Buildings/Civ4Buildinginfos.xml"
"Tag: MODER_CODE_NATIVES_ONLY in info class was incorrect. Current XML file is: xml\Buildings/Civ4Buildinginfos.xml"
"Tag: MODER_CODE_NATIVES_ONLY in info class was incorrect. Current XML file is: xml\Buildings/Civ4Buildinginfos.xml"
"Tag: MODER_CODE_ALLOWS_TRADE_FAIR in info class was incorrect. Current XML file is: xml\Buildings/Civ4Buildinginfos.xml"
"Tag: UNITAI_TRADER in info class was incorrect. Current XML file is: xml\Buildings/Civ4Buildinginfos.xml"
"Tag: UNITAI_TRADER in info class was incorrect. Current XML file is: xml\Buildings/Civ4Buildinginfos.xml"
"Tag: UNITAI_TRADER in info class was incorrect. Current XML file is: xml\Buildings/Civ4Buildinginfos.xml"

My guess is that there really are misplaced forward or backslashes in Civ4Builinginfos.XML.
 
By the way, Nightinggale, The reason your script doesn't work for me...

Spoiler :
is that the %home% sysvar on my system is e:\Roger's Documents\. I think the embedded apostrophe is killing the bat file. Windows 7 and 8 do this. It's a feature, not a bug.

I can't think why you're not getting this yourself, unless you are a retrograde who is still running Windows XP. :) A directory list of e: shows this file as "My Documents", which means that some kind of alias is being displayed. I don't know how to work with these aliases like "My documents". I think they are part of the new Libraries feature.

I tried including this path manually in the bat file. The single apostrophe killed the bat file. I tried doubled apostrophes, but this didn't work either. I wonder whether there is some escape sequence that will work in bat syntax, i.e. \something. You might use a more advanced scripting language if you're not running Windows XP.
 
By the way, Nightinggale, The reason your script doesn't work for me...

is that the %home% sysvar on my system is e:\Roger's Documents\. I think the embedded apostrophe is killing the bat file. Windows 7 and 8 do this. It's a feature, not a bug.
Finally. An American with a path encoding issue :lol:
You have no idea how much the rest of the world struggles with issues like that. Using non-English letters often cause weird problems. German letters like ü or ß can screw up a lot. I read somewhere that this is a major problem in countries which aren't using latin letters (such as China).

The general rule is that you will get problems eventually if you use characters other than a-z, 0-9 and space. This is unrelated to M:C. You screwed up your paths :p

I never considered having ' in a filename, but it sounds nasty. Still doesn't beat getting a newline in a filename :eek:

I can't think why you're not getting this yourself, unless you are a retrograde who is still running Windows XP. :)
I'm using windows 7 (64 bit) and I haven't tested the bat file elsewhere. My virtual machine is runs 32 bit XP though. Maybe I should test the bat file there. I have used the virtual machine to compile and the path setup in the Makefile can handle finding 32 bit program files just fine, be it with or without (x86).

The reason why I didn't have that problem is because I name my paths with known good characters. Often I even avoid space.

A directory list of e: shows this file as "My Documents", which means that some kind of alias is being displayed. I don't know how to work with these aliases like "My documents". I think they are part of the new Libraries feature.
Try google for move my documents and/or symbolic link in windows. I use both and know it works... well proper symbolic links were introduced in vista meaning I never actually used them in XP.

Just for the record, placing an alias to a MOD in MODS doesn't work. Placing a symbolic link works. Naturally placing the mod itself in there works and is the easiest solution. The only useful scenario I can think of where you could benefit from this would be for loading savegames. Some people rename their mods (DON'T DO THAT). When they send in a savegame with a bug, the game looks for a mod with the custom name. I have used symbolic links to link say my_super_name_for_a_mod to RaRE to avoid having two copies of RaRE just to load savegames. Also both will naturally have the newest version.
I haven't encountered this issue with M:C (yet?).
Setting up a symbolic link is a bit annoying as you have to do it from cmd.exe as an administrator meaning you end up with a lot of typing.
 
Finally. An American with a path encoding issue :lol:
You have no idea how much the rest of the world struggles with issues like that. Using non-English letters often cause weird problems. German letters like ü or ß can screw up a lot. I read somewhere that this is a major problem in countries which aren't using latin letters (such as China).

The general rule is that you will get problems eventually if you use characters other than a-z, 0-9 and space. This is unrelated to M:C. You screwed up your paths :p

I never considered having ' in a filename, but it sounds nasty. Still doesn't beat getting a newline in a filename :eek:

I'm using windows 7 (64 bit) and I haven't tested the bat file elsewhere. My virtual machine is runs 32 bit XP though. Maybe I should test the bat file there. I have used the virtual machine to compile and the path setup in the Makefile can handle finding 32 bit program files just fine, be it with or without (x86).

The reason why I didn't have that problem is because I name my paths with known good characters. Often I even avoid space.

Try google for move my documents and/or symbolic link in windows. I use both and know it works... well proper symbolic links were introduced in vista meaning I never actually used them in XP.

Just for the record, placing an alias to a MOD in MODS doesn't work. Placing a symbolic link works. Naturally placing the mod itself in there works and is the easiest solution. The only useful scenario I can think of where you could benefit from this would be for loading savegames. Some people rename their mods (DON'T DO THAT). When they send in a savegame with a bug, the game looks for a mod with the custom name. I have used symbolic links to link say my_super_name_for_a_mod to RaRE to avoid having two copies of RaRE just to load savegames. Also both will naturally have the newest version. I haven't encountered this issue with M:C (yet?).
Setting up a symbolic link is a bit annoying as you have to do it from cmd.exe as an administrator meaning you end up with a lot of typing.

I'm not sure what you're referring by the terms alias and symbolic links. I think you're referring to, first, I don't know what, and, second, "shortcuts". When I use the term "alias" below, I know it's not the correct term. In Linux files can have aliases, but in Windows, not. In Linux you have "links" but in Windows, "shortcuts".

You are apparently in Europe, and obviously not using the US version of Win 7. In the US version, a "my documents" directory is created on the C: drive. in the Users folder. Apparently "my documents" is an alias of some kind for the real file name, which is [username]'s Documents. If you try to rename that folder, you are only changing the alias, not the real file name. I don't know how to change the underlying real name.

I moved the directory on c: to e: using the Windows "move location" button on the folder tab. When I did so, Windows apparently changed the name of that directory, and established "My Documents", the former directory name, as some kind of alias. This alias is what you see when you work with that directory--but only if you are logged on as Roger. If you logged on as "Joe", you would see "Roger's Documents" instead/

Of course I didn't put an apostrophe in the folder name--Windows put it there. So your script won't run on US Windows, as far as I can see. I've had many problems trying to change anything about these names.

I will research how this works and try to figure out how %homedir% works, and how to change the real file name. But as I see it, your script will fail for any user with the US version of Windows.

Just for the record, placing an alias to a MOD in MODS doesn't work. Placing a symbolic link works. Naturally placing the mod itself in there works and is the easiest solution. The only useful scenario I can think of where you could benefit from this would be for loading savegames. Some people rename their mods (DON'T DO THAT). When they send in a savegame with a bug, the game looks for a mod with the custom name. I have used symbolic links to link say my_super_name_for_a_mod to RaRE to avoid having two copies of RaRE just to load savegames. Also both will naturally have the newest version.
I haven't encountered this issue with M:C (yet?).
Setting up a symbolic link is a bit annoying as you have to do it from cmd.exe as an administrator meaning you end up with a lot of typing.

Again, I'm not sure what you're referring to as aliases and symbolic links in Windows. I think "symbolic links" are what are called "Shortcuts" in English.

I've used the term alias for lack of any other to refer to how Windows presents the name "My Documents" on directory listings and such, for the folder "[username]'s documents". The term is only in that context. As far as I know there aren't other "aliases" in Windows. I could be mistaken of course.

I'm not sure what you're saying in the quoted text. I think it has to do with where the Colonization mods reside and how Colonization locates them. With my setup, the Colonization installer finds the "My Games" folder under "e:\My Documents" and creates a subfolder in it named "\Sid Meier's Civilization 4 Colonization"--again, with an apostrophe. In turn, it has a MODS subfolder. The Colonization code is installed in the "Program Files (x86)\2K Games\Firaxis Games\Sid...\ folder. The installer creates a shortcut there named "_Civ4CustomMods" which points to the MODS folder under "My Games\Sid..." This is all done automatically by the installer.

Unfortunately, Steam versions omit Sid's name from these folders, for an added level of complexity.

Screenshots of these directories are attached.

Again, this might go better if you were using Windows Script Host instead of BAT.
 

Attachments

  • E-Drive Follders.jpg
    E-Drive Follders.jpg
    135.4 KB · Views: 128
  • E-Drive Folders 2.jpg
    E-Drive Folders 2.jpg
    282.1 KB · Views: 99
  • C-Drive Folders.jpg
    C-Drive Folders.jpg
    166.8 KB · Views: 60
More: Apparently Linux aliases are similar to Windows NTFS Symbolic Links. Apparently "My Documents" is a conditional symbolic link to the "Roger's Documents" folder, set up when "Roger" logs on. I will continue investigating this. I gather that Kailric uses US Windows.

It's true that this has nothing to do with M:C. It has to do with the script you wrote to set up synchronized repositories for the development version. How do French or German Windows handle naming of a user's documents directory?

BTW, Microsoft Knowledge Base says that apostrophe is a valid character in a file name. See http://support.microsoft.com/kb/177506.
 
I'm not sure what you're referring by the terms alias and symbolic links. I think you're referring to, first, I don't know what, and, second, "shortcuts". When I use the term "alias" below, I know it's not the correct term. In Linux files can have aliases, but in Windows, not. In Linux you have "links" but in Windows, "shortcuts".
A shortcut or an alias is NOT the same as a symbolic link. I don't think I should have mentioned those. Looks like it just causes more confusion.

You are apparently in Europe, and obviously not using the US version of Win 7. In the US version, a "my documents" directory is created on the C: drive. in the Users folder. Apparently "my documents" is an alias of some kind for the real file name, which is [username]'s Documents. If you try to rename that folder, you are only changing the alias, not the real file name. I don't know how to change the underlying real name.
I think that's pretty much the standard everywhere. It may have different names in different languages, which is why we should use the variable names rather than hardcoded paths.
I use UK English as I was too cheap to pay $70 extra for a translated one. Also a few poorly programmed apps works only on English systems.

Unfortunately, Steam versions omit Sid's name from these folders, for an added level of complexity.

Screenshots of these directories are attached.
I can't see that in the screenshots :confused:

Again, this might go better if you were using Windows Script Host instead of BAT.
I'm not sure that would really help. Now that I think about it I don't even know what your error is.
 
I am learning more than I ever wanted to about NTFS. Specifically, in addition to shortcuts, there are hard links, soft links and directory joins.

I believe the problem comes from your using the system variable &homepath&. This returns "e:\Roger&#8217;s Documents\My Games\Sid Meier's Civilization IV Colonization" on my system. The embedded apostrophe breaks the bat file. I take what you said to mean that even in UK Windows, Windows sets up your home directory with an apostrophe in the name. If that's so, I don't see why the script isn't breaking for you as well.

One problem I'm having is that it's been many years since I worked with BAT files. When I say "Speak, memory!", she only coughs weakly.

The game directory containing mods, savegames, etc., but not code is a subdirectory of the home directory. I am using the DVD version of Colonization. Its installer names this user game directory "Sid Meier's Civilization IV Colonization". The Steam version names it just "Civilization IV Colonization".

So, I don't see how the script can work in US Windows, and I don't know how it's working in UK Windows either.
 
In this new 2.0h game on the MC map, I'm not seeing the characters' action buttons. Can't found a settlement.
Sounds like a python bug.

When colo is NOT running, edit CivilizationIV.ini and set to 0 and LoggingEnabled to 1.

Play again and inside logs there should be PythonErr.log or something like that. Any file in there starting with Python would likely be more interesting than the savegame itself.

It's really annoying to mod python. If you make a typo in the city screen you risk the file won't run and then you get glitches like you just mentioned with no ingame indication of where the bug is :wallbash:
 
Sounds like a python bug.

Today I've been experiencing lots of drops to the desktop in the first 10 turns. So much so that I can't play the game. I will get an error log.

It would be nice if you'd fix those XML source bugs in XML\Buildings\Civ4Buildinginfos.xml. I'm getting a sore finger! (:
 
Back
Top Bottom