Merging BUG 4.0 with FfH2

I don't know if version 0.8 already includes this, but in CvGlobals::getBuildingInfo you might want to add a check for eLoopBuilding!=NO_BUILDING. The original code had such a check and it surely doesn't hurt. Search for TXT_KEY_MISC_REQ_CITY_HAS and you should find it.

modified code
Code:
					if (bBuildingClassNeeded)
					{
						if(eLoopBuilding!=NO_BUILDING)	//added Sephi
						{
							szBuffer.append(NEWLINE);
							szBuffer.append(gDLL->getText("TXT_KEY_MISC_REQ_CITY_HAS", GC.getBuildingInfo(eLoopBuilding).getTextKeyWide()));
						}
					}
 
I don't know if version 0.8 already includes this, but in CvGlobals::getBuildingInfo you might want to add a check for eLoopBuilding!=NO_BUILDING. The original code had such a check and it surely doesn't hurt. Search for TXT_KEY_MISC_REQ_CITY_HAS and you should find it.

Great catch!:goodjob:
Certainly, Doviello's Great Library shows funny requiring text.

I believe, when active civilization blocks required building, it should be shown instead of hides. (If it hides, player may assume that he can build the building without hidden requirement.)
Despite that, I have hidden "TXT_KEY_BUILDING_REQUIRES_NUM_SPECIAL_BUILDINGS_NO_CITY" message (and forgot this problem with "TXT_KEY_MISC_REQ_CITY_HAS" message).

Now I have fixed my code. Please review this.
Spoiler :
Code:
*/
			if (kBuilding.getPrereqNumOfBuildingClass((BuildingClassTypes)iI) > 0)
			{
				if (ePlayer == NO_PLAYER)
				{
					eLoopBuilding = (BuildingTypes)GC.getBuildingClassInfo((BuildingClassTypes)iI).getDefaultBuildingIndex();
					szBuffer.append(NEWLINE);
					szBuffer.append(gDLL->getText("TXT_KEY_BUILDING_REQUIRES_NUM_SPECIAL_BUILDINGS_NO_CITY",
									getLinkedText(eLoopBuilding, false).c_str(),
									kBuilding.getPrereqNumOfBuildingClass((BuildingClassTypes)iI)));

					szBuffer.append(szTempBuffer);
				}
				else
				{
					const int iNumPreReqs = GET_PLAYER(ePlayer).getBuildingClassPrereqBuilding(eBuilding, ((BuildingClassTypes)iI));
					const int iNumTotal = GET_PLAYER(ePlayer).getBuildingClassCount((BuildingClassTypes)iI);
					if (iNumPreReqs > iNumTotal)
					{
						eLoopBuilding = (BuildingTypes)GC.getCivilizationInfo(GET_PLAYER(ePlayer).getCivilizationType()).getCivilizationBuildings(iI);
						// If the civilization type blocks this building, it shows default building instead.
						if (eLoopBuilding == NO_BUILDING)
						{
							eLoopBuilding = (BuildingTypes)GC.getBuildingClassInfo((BuildingClassTypes)iI).getDefaultBuildingIndex();
						}

						szBuffer.append(NEWLINE);
						szBuffer.append(gDLL->getText("TXT_KEY_BUILDING_REQUIRES_NUM_SPECIAL_BUILDINGS",
										getLinkedText(eLoopBuilding, false).c_str(),
										iNumTotal,
										iNumPreReqs));

						szBuffer.append(szTempBuffer);
					}
				}
			}

			if (!bCivilopediaText)
			{
				if (kBuilding.isBuildingClassNeededInCity(iI))
				{
					bool bBuildingClassNeeded = true;

					if (pCity == NULL)
					{
						eLoopBuilding = (BuildingTypes)GC.getBuildingClassInfo((BuildingClassTypes)iI).getDefaultBuildingIndex();
					}
					else
					{
						eLoopBuilding = (BuildingTypes)GC.getCivilizationInfo(GET_PLAYER(ePlayer).getCivilizationType()).getCivilizationBuildings(iI);
						// Assimilated city requires original civilization's building
						if (pCity->getCivilizationType() != NO_CIVILIZATION)
						{
							eLoopBuilding = (BuildingTypes)GC.getCivilizationInfo(pCity->getCivilizationType()).getCivilizationBuildings(iI);
						}
						// If the civilization type blocks this building, it shows default building instead.
						if (eLoopBuilding == NO_BUILDING)
						{
							eLoopBuilding = (BuildingTypes)GC.getBuildingClassInfo((BuildingClassTypes)iI).getDefaultBuildingIndex();
						}

						for (int iBuilding = 0; iBuilding < GC.getNumBuildingInfos(); iBuilding++)
						{
							if (GC.getBuildingInfo((BuildingTypes)iBuilding).getBuildingClassType() == iI
							 && pCity->getNumBuilding((BuildingTypes)iBuilding) > 0)
							{
								bBuildingClassNeeded = false;
								break;
							}
						}
					}

					if (bBuildingClassNeeded)
					{
						szBuffer.append(NEWLINE);
						szBuffer.append(gDLL->getText("TXT_KEY_MISC_REQ_CITY_HAS", GC.getBuildingInfo(eLoopBuilding).getTextKeyWide()));
					}
				}
			}
//<<<<	BUGFfH: End Modify
 
I followed your instructions and BUG is working pretty well with FfH2.

I use the autolog since i play SGs and for the HoF.
It won't list the combats, the cities conquered and it gives errors when you build disciple and arcane units.

For the rest it seems to work very well.

In case you can find the issue, can you please post just the files you modify so it can be easier for me to replace them?
 
Denev, did you add something to make the FFH Bonus tag bModifierPerBonus work in the cityscreen? (so multiple life mana show a health bonus higher than 1), or does that work without having to modify BUG interface?
 
Denev, did you add something to make the FFH Bonus tag bModifierPerBonus work in the cityscreen? (so multiple life mana show a health bonus higher than 1), or does that work without having to modify BUG interface?

Cool idea. I'll try it.
But I am a little busy lately. Please wait for a time.
 
Is there an update on BULL support for FFH? Is that something we can try to do on our own? I believe this might require a modification to the CvGameCore DLL, and I see you've included the C and header files in the BUGFfH2_ver0.08 patch, but I'm not sure what I need to do.

I just started using BAT/BUG/BULL for vanilla BTS and even more recently starting playing FFH. One thing I noticed is that I REALLY need the "Actual X:" tooltip when it comes to creating buildings ;) BULL support would be really awesome!
 
Hi Denev,
i've tried to selectively copy paste to install your BUG for FfH under patch "m", but no way.
Of course we can't follow the instructions, or all the variations from patch J to M will be lost.

Have you planned a new release?

As a HoF player, i enjoy to play with BUG, as I enjoyed this modmod for patch J.

Thanks in advance and keep it up.

BTW if i can give you some help, i can do something with the XML files, if you like.
 
Have you planned a new release?

Hi, BLubmuz.
Thank you for your interest. I'm glad there is a player who enjoys my modding.

I am working in other modmod now. But it seems to need more time a little.
I was thinking to merge latest FfH2 patch after Kael started to take a short break.
It seems that is now. Okey, I suspend current working and start merging BUG.

I am planning a diet version that includes only unmodded FfH2 and BUG.
I will start it first.


BTW if i can give you some help, i can do something with the XML files, if you like.

I remember your suggestion for the time when I needs it, thanks! :D
 
Thanks reporting.
I will try to find out the reason of CtD.

By the way, you said about python exception of this modmod too.
I am interested in it. Please report about it if you can.

Thanks!
 
:cool:

denev, could you give me a hint how I could proceed with the current game? That'd be much appreciated.

Best wishes, .
 
Well, the logs in my logs folder are all gibberish to me. :twitch: But if they mean anything to you ... :goodjob: here you go!

If you'd need anything else specifically please let me know! :)

Archive contains: PythonDbg, PythonErr, and PythonErr2.
 

Attachments

  • Logs.rar
    20.5 KB · Views: 79
Top Bottom