Quick Modding Questions Thread

Hi,

I´ve a graphic error which I can´t fix. I´ve added several builings modular. Some of them are not displayed right in the mouseover of a city. There is just a pink square (see first screenshot). In all the other places they are displayed correctly (see the other screenshots).

I compared the ArtDefinesBuildings.xml of one of the added buildings with the error one added which is displayed correctly but couldn´t see a significant difference which cuases the error. Here are the codes:

Building not working right:
Code:
<?xml version="1.0"?>
<!-- Sid Meier's Civilization 4 Beyond the Sword -->
<!-- Modified by the Civ Gold Team -->
<!-- -->
<Civ4ArtDefines xmlns="x-schema:Ekal_CIV4ArtDefinesSchema.xml">
	<BuildingArtInfos>
		<BuildingArtInfo>
			<Type>ART_DEF_BUILDING_ASSYRIA_EKAL</Type>
			<LSystem>LSYSTEM_2x2</LSystem>
			<bAnimated>1</bAnimated>
			<fScale>1.0</fScale>
			<fInterfaceScale>0.8</fInterfaceScale>
			<NIF>Modules/Custom Civilizations/Assyria/Ekal/Mali_mint.nif</NIF>
			<KFM/>
			<Button>Modules/Custom Civilizations/Assyria/Ekal/Ekal.dds</Button>
		</BuildingArtInfo>
	</BuildingArtInfos>
</Civ4ArtDefines>

Building correctly displayed:
Code:
<?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 -->
<!-- -->
<!-- Building art path information -->
<Civ4ArtDefines xmlns="x-schema:BeerMod_CIV4ArtDefinesSchema.xml">
	<BuildingArtInfos>
		<BuildingArtInfo>
			<Type>ART_DEF_BUILDING_BREWERY</Type>
			<LSystem>LSYSTEM_1x2</LSystem>
			<bAnimated>0</bAnimated>
			<fScale>1.5</fScale>
			<fInterfaceScale>0.9</fInterfaceScale>
			<NIF>Modules/BeerMod/Art/Structures/Buildings/Brewery/Brewery.nif</NIF>
			<KFM/>
			<Button>Modules/BeerMod/Art/Interface/Buttons/Buildings/Brewery.dds</Button>
		</BuildingArtInfo>
		<BuildingArtInfo>
			<Type>ART_DEF_BUILDING_TAVERN</Type>
			<LSystem>LSYSTEM_1x1</LSystem>
			<bAnimated>0</bAnimated>
			<fScale>1.5</fScale>
			<fInterfaceScale>0.9</fInterfaceScale>
			<NIF>Modules/BeerMod/Art/Structures/Buildings/Tavern/Tavern.nif</NIF>
			<KFM/>
			<Button>Modules/BeerMod/Art/Interface/Buttons/Buildings/Tavern.dds</Button>
		</BuildingArtInfo>
	</BuildingArtInfos>
</Civ4ArtDefines>

Could someone please help me. Am I looking at the wrong files?:confused:
 

Attachments

  • Civ4ScreenShot0045.JPG
    Civ4ScreenShot0045.JPG
    234.3 KB · Views: 82
  • Civ4ScreenShot0044.JPG
    Civ4ScreenShot0044.JPG
    471.8 KB · Views: 88
  • Civ4ScreenShot0046.JPG
    Civ4ScreenShot0046.JPG
    215.6 KB · Views: 75
Oh, that's new.
The cause of this problem might be the space in the path, in "custom civilizations".
At least that's the cause when you do promotions with a space in the file name. Had not thought that problem existed anywhere else.

Thanks for the reply, The_J.

I found a thread with the same problem. And I found the DiplomacyInfos.xml in Cleopatra's file and I got rid of it. Now the Diplo text works now!

Thanks! :)

Ah, good to know :).
And :lol:, have to remember what SaibotLieh said. It's a bit embarrassing to spread misinformation, even after you've already been corrected one :blush:.

Thanks a lot! As I will have no new promotions, just PROMOTION_LEADER will play a role of an "additional life" I think I won't have to change too many things. Still, there is the second question: where can I find formula defining how many exp is needed for spawning GG?

There are some values adjustable in the XML\GlobalDefines.xml (just search for general).
 
Thanks, but still I would like to see the formula (in .cpp?)

It's in CvPlayer.cpp look for CvPlayer::greatPeopleThreshold.
 
Thanks a lot! Next question: how do I check if an unit has leader promotion. I guess in C++ I use "bool CvUnit::isHasPromotion(PromotionTypes eIndex) const" but how exactly it should look like? And how the command should look like in Python?

That's not a question for my very limited skills in C++!
 
1) if unit.isHasPromotion(gc.getInfoTypeForString("PROMOTION_LEADER")):

Might be pUnit depending where it is used

2) Take care that naval units do not spawn back in capital if capital is not coastal.

3) For adjustment of level requirements, adjust def getExperienceNeeded(self, argsList): in CvGameUtils
 
Anybody have any suggestions why the same unique name paratrooper keeps showing up as great person? In addition, all my great generals are unique art, but I just get the default art each time.

Do you mean a paratrooper is born as general?
 
1) if unit.isHasPromotion(gc.getInfoTypeForString("PROMOTION_LEADER")):

Might be pUnit depending where it is used

2) Take care that naval units do not spawn back in capital if capital is not coastal.

3) For adjustment of level requirements, adjust def getExperienceNeeded(self, argsList): in CvGameUtils

As I change CvUnit.cpp I think it's enough to type "isHasPromotion(gc.getInfoTypeForString("PROMOTION_LEADER"))" or exactly:
Code:
lExperienceNeeded = (getLevel() - isHasPromotion(gc.getInfoTypeForString("PROMOTION_LEADER")))^2 + 1;
And in CvGameUtils.py should it look like:
Code:
iExperienceNeeded = (iLevel - unit.isHasPromotion(gc.getInfoTypeForString("PROMOTION_LEADER")))^2 + 1
?

Naval units can get GG? If it's the case the problem was already solved in The J's mod :)
 
Not sure what you changed in cpp, but if it works for you, so be it :D
For the getExperienceNeeded part, nothing much can help since you can only play around with iLevel and iOwner. So it is more like a global adjustment.

On 2nd thoughts, you may try def onUnitPromoted(self, argsList):
If the promotion is leader, reduce the level of the unit by 1.
 
...er...
Might be that something is broken in the C++ code, which evaluates the correct tag for the generals. IIRC that's the tag which grants over units XP. Since you said that you had a problem with one tag while merging another modcomp, I guess that this could maybe somehow be related.
 
Not sure what you changed in cpp, but if it works for you, so be it :D
For the getExperienceNeeded part, nothing much can help since you can only play around with iLevel and iOwner. So it is more like a global adjustment.

On 2nd thoughts, you may try def onUnitPromoted(self, argsList):
If the promotion is leader, reduce the level of the unit by 1.

Hmmm... I've changed .cpp file:
Code:
	lExperienceNeeded = (getLevel() - isHasPromotion((PromotionTypes)GC.getInfoTypeForString("PROMOTION_LEADER")))^2 + 1;
And I think that I have to have the same value at Python? But I really suck at Python so I have no idea how can I do that.
 
Hmmm... I've changed .cpp file:
Code:
	lExperienceNeeded = (getLevel() - isHasPromotion((PromotionTypes)GC.getInfoTypeForString("PROMOTION_LEADER")))^2 + 1;
And I think that I have to have the same value at Python? But I really suck at Python so I have no idea how can I do that.
I don't think needed experience is handled in Python. There might be a callback, but if you haven't intentionally enabled it you should be fine.
 
Oh, that's new.
The cause of this problem might be the space in the path, in "custom civilizations".
At least that's the cause when you do promotions with a space in the file name. Had not thought that problem existed anywhere else.

Thanks. It worked when I deleted the space in the path.:goodjob:
 
Simple question I think. How do I ensure that the barbarian civilization uses specific graphics and units. e.g. using "partisans" as the graphics for infantry.
 
Actually when a Barbarian city produces a new unit it is not from the default range of units, but like one that is specified in the civilization files for other civs. i.e. can I edit the "Barbarian" civilization infos files and add their own unique units.
 
Back
Top Bottom