• Our friends from AlphaCentauri2.info are in need of technical assistance. If you have experience with the LAMP stack and some hours to spare, please help them out and post here.

Bug Reporting

This is the save I made the same round that I took the screenshot that I posted:
Thanks for the quick reply btw :)
I had a go at the save this evening and played about 50 turns. It didn't happen for me. How about you, EF?
 
Tried a new game, same settings. Happend again, after about 40 rounds.:crazyeye:
I'll try and reinstall BAT.
 

Attachments

  • Civ4ScreenShot0035.JPG
    Civ4ScreenShot0035.JPG
    341.6 KB · Views: 81
Reinstalled BAT. Same thing happens. I played a while longer on my ovn save, and the same ting happens with other units.
 
I haven't changed anything in the scoreboard code in ages. It sounds like some function that should normally return a single value returned multiple values. This error comes from using the % operator for string substitution in Python with a string that has too few places to substitute compared to the list of values being substituted.
 
This is the save I made the same round that I took the screenshot that I posted:
Thanks for the quick reply btw :)

I tried it a couple times finally, but I don't see what you see. Does it happen every time? Do you have a lot of other apps running?
 
hm how can I fix this?

Somehow a score is being reported as None (not empty string or 0), and I don't see how that's possible. Did you add a calculateScore() gameutils callback handler?
 
I tried it a couple times finally, but I don't see what you see. Does it happen every time? Do you have a lot of other apps running?

This is very strange I think. Played some new games, different settings, and the same thing happens every time. Seems as the uniqe units in the mod gets changed into the original units graphic when they are inactive.

Nobody else has this problem?? :confused:

Usualy I don't have many apps running, Firefox sometimes thats all.

Btw, I'm running a Intel Core2 Quad CPU Q6700 @2,66 GHz with 4 GB RAM
 
This is very strange I think. Played some new games, different settings, and the same thing happens every time. Seems as the uniqe units in the mod gets changed into the original units graphic when they are inactive.

Nobody else has this problem?? :confused:

Usualy I don't have many apps running, Firefox sometimes thats all.

Btw, I'm running a Intel Core2 Quad CPU Q6700 @2,66 GHz with 4 GB RAM

Could it be that this is graphic HW/driver problem? What card do you use, how much graphic mem, does it have the most actual driver?
 
Somehow a score is being reported as None (not empty string or 0), and I don't see how that's possible. Did you add a calculateScore() gameutils callback handler?

Hm no. Did not change anything to the scores.

This is very strange I think. Played some new games, different settings, and the same thing happens every time. Seems as the uniqe units in the mod gets changed into the original units graphic when they are inactive.

Nobody else has this problem?? :confused:

I have had this in older versions of my mod. Could be caused by massive modules. Since I'm using no modules, I haven't seen this error anymore. You could also try using civcheck (must be around here somewhere).
 
In the new BULL SVN a debug dll complains because the new experience showing code tries to get CvPlayer::canConstruct to run on buildings that get passed to it which the civilization of the player cannot build. Adding this control statement fixes the assert:
Code:
for (int iJ = 0; iJ < GC.getNumBuildingClassInfos(); iJ++)
{
	if ((BuildingTypes)GC.getCivilizationInfo(kPlayer.getCivilizationType()).getCivilizationBuildings((BuildingClassTypes)iJ) == (BuildingTypes)iI)
	{
...do stuff

Code added to file below (pulled from latest BULL SVN):
 
Anther minor issue, which will only effect mods, is that if you give a unitclass to units that can't gain experience, the code displays that they will, because the domain type check returns true. In LoR I've set it up so that missionaries are of the "religious" unitclass, I do this so that Spiritual leaders grant them the free morale promotion, and thus an extra movement point. The game knows that these units do not get experience somehow, as barracks don't give them 3XP, but the BUG check does not. I'm not on my computer so I'm not sure how the game makes the distinction (At first I thought it was strength 0 units, but LoR also adds Spy promotions, and they are strength 0, and they are granted their XP from the buildings defined in the XML to do so; perhaps there is a check civ does to ensure there are no promotions available to a unit, and doesn't grant XP if this is true?), but I'll take a look at it and see if I can't add a check to fix this for mods.
 
Perhaps there is a check civ does to ensure there are no promotions available to a unit, and doesn't grant XP if this is true?

This is exactly what it does, but it goes through CvUnit and not CvUnitInfo. This means I need an actual unit to use the existing code. I dug into it and thought that it eventually checked that the unit had a combat type and went with that.

So your missionaries receive a free Morale promotion. This means that the Morale promotion is valid for that combat type, right? I'll have to double-check, but if I see that it has an available promotion (Morale) I'll show that the unit will get experience. I'll also need to check that the promotion isn't given for free to the unit. That shouldn't be too hard.
 
No, Morale is gifted to units of spiritual civs to "Religious units" in LoR, however it is not valid for the unit in any check that civ does (civilopedia, etc do not show this). If you click on a missionary in the civilopedia, it will not show any promotion as available, as the XML doesn't have any promotions available to "religious units". You can give any promotion to any unit via worldbuilder, or in UnitInfos and TraitInfos using the FreePromotions array tag, but doing so makes no difference in the civilopedia, or in the free XP grant from buildings, specialists, or religions.

Edit:
As a side note you can also cause a similar effect by making a unit go over it's max withdraw/intercept chances that are defined in GlobalDefines. As an example, in the XML say you give an attack sub the tactics promotion by default, and bump up it's base withdraw chance in the XML so that when created the attack sub has over a 95% withdraw chance. This unit will not be able to receive XP and cannot get any promotions (though the civilopedia will still show the promotions available that are in the XML). Not sure if that is useful at all, but it's related behavior.

Edit 2:
This is exactly what it does, but it goes through CvUnit and not CvUnitInfo. This means I need an actual unit to use the existing code. I dug into it and thought that it eventually checked that the unit had a combat type and went with that.
I think the simplest way might be to just to add a new function "bool CvGameCoreUtils::canRecieveExperience(eUnit)" which would find the combat class, and then loop over PromotionsInfos and see if the unit is valid to receive experience. Recently I've found that in many ways it's simply easier create my own function that does exactly what I want then trying to figure out how to string together a bunch of existing calls correctly.
 
I couldn't figure out any other way to do it, other then to create a new function that took eUnit as an argument. CvUnit's functions required the unit to be an actual unit. Also fixed the loop, so it's just a single loop over unitclasses and then grabs the civilization's building for it. Anyway I fixed all issues with the Experience code I could find; except there is still a minor text thing, need to add XP to the text, as right now it just says +3 in green or red depending on if you have the building, or state religion or what not, instead of +3 XP. Source code in this post. I'm including 3 Cy files that exposes the new canAquireExperience(eUnit) function to python; not sure if you want to include that as the other experience functions aren't exposed, but I figured maybe some python modder would find it useful.

Also just as a question, I had to use this code to eliminate the assert caused by passing an invalid building type for a civilization to CvPlayer::canConstruct
Spoiler :
Code:
for (int iI = 0; iI < GC.getNumBuildingClassInfos(); iI++)
{
	BuildingClassTypes eBuildingClass = (BuildingClassTypes)iI;
	BuildingTypes eBuilding = (BuildingTypes)GC.getCivilizationInfo(eCivilization).getCivilizationBuildings((BuildingClassTypes)iI);
	if (GC.getCivilizationInfo(eCivilization).getCivilizationBuildings(eBuildingClass) != eBuilding || eBuilding == NO_BUILDING)
	{
		continue;
	}
	CvBuildingInfo& kBuilding = GC.getBuildingInfo(eBuilding);
Why isn't this good enough? How is it passing buildings from the wrong civ into CvPlayer?
Spoiler :
Code:
CvBuildingInfo& kBuilding = GC.getBuildingInfo((BuildingTypes)GC.getCivilizationInfo(eCivilization).getCivilizationBuildings((BuildingClassTypes)iI);)
 
Using BUG 4.3 and BULL 1.1 (first installed BUG via *.exe, afterwards installed BULL) caused the following bug:
bugscreen01.jpg

As you can see I didn't find HC yet, even though he's listed as Wang's WE!

And furthermore it seems that the property "Worst Enemy" for the Leaderheads on the fist page of the BUG-properties page doesn't work. Whether I selected or deselected it, the information of the WE's gets always shown on the hover text as well as on the foreign adviser sceen. I'm not sure whether I missunderstood this property but maby it's worth a look.

Nonetheless thx for the great improvements on BUG!!
 
Some more fixes, I'm no longer getting any asserts with these sources (the new BUG buiding defense functions were also tripping asserts). Let me know if you have a good idea around putting the canAcquireExperience(eUnit) function in CvGameCoreUtils.cpp, I can't think of any where else to put it where it will work though.
 
Back
Top Bottom