Quick Modding Questions Thread

Hey,

I have a question about creating the art for a new unit for a civilizaton.

In the game, when you click on a unit and then you go elsewhere on the map,
you can still see your unit in a small circle on the dim.
Which file in the sidmeier/assets/art/interface or sidmeier/assets/art/unit is it for that special picture?

Thank you
 
As far as I know, it's just the button of the unit that is displayed in a circle.
 
I guess you are right, but I only see .dds files and not the picture. So it would help to know if it is in assets/art/unit or assets/art/buttons etc. maybe somebody know? And further more which .xml file defines this picture to the unit? Is it unitinfo.xml or in the artunit xml ?
 
A .dds file can also be a picture. Usually, the buttons are put apart, in the Art/Interface/Buttons folders.

You can check the path which is defined in the XML/Art/CIV4ArtDefines_Unit.xml file.
 
I guess i need to be more specific, but thank you so far! :-) So here is the code:

Spoiler :
<UnitArtInfo>
<Type>ART_DEF_UNIT_CARIB_Kalipuna</Type>
<fScale>0.44</fScale>
<fInterfaceScale>1.0</fInterfaceScale>
<NIF>Art/Units/Kalipuna/Aztec_Jaguar.nif</NIF>
<KFM>Art/Units/Kalipuna/Aztec_Jaguar.kfm</KFM>
<SHADERNIF>Art/Units/Kalipuna/Aztec_Jaguar_FX.nif</SHADERNIF>
<ShadowDef>
<ShadowNIF>Art/Units/01_UnitShadows/UnitShadow.nif</ShadowNIF>
<ShadowAttachNode>BIP Pelvis</ShadowAttachNode>
<fShadowScale>1.0</fShadowScale>
</ShadowDef>
<fBattleDistance>0.4</fBattleDistance>
<fRangedDeathTime>0.31</fRangedDeathTime>
<bActAsRanged>0</bActAsRanged>
<TrainSound>AS2D_UNIT_BUILD_UNIQUE_UNIT</TrainSound>
<AudioRunSounds>
<AudioRunTypeLoop/>
<AudioRunTypeEnd/>
</AudioRunSounds>
</UnitArtInfo>


My problem is, almost everything is fine, I can see the unit in the game and civilopedia, but like I said, if you have clicked on it, go elsewhere on the map, the circle in which you should see the the kalipuna you just see a pink circle :sad: ;)

So I have to check the xml and the dds and I hope you can tell me where the relevant information for this "circlepicture" is in the above code. Thank you :D
 
you are missing the button art tag...

it should look like this:

Spoiler :
Code:
<UnitArtInfo>
			<Type>ART_DEF_UNIT_LION</Type>
			[COLOR="Red"]<Button>Art/Interface/Buttons/Units/deathclaw.dds</Button>[/COLOR]
			<fScale>30.61</fScale>
			<fInterfaceScale>1.3</fInterfaceScale>
			<bActAsLand>0</bActAsLand>
			<bActAsAir>0</bActAsAir>
			<NIF>Art/Units/deathclaw/devourer.nif</NIF>
			<KFM>Art/Units/deathclaw/devourer.kfm</KFM>
			<SHADERNIF>Art/Units/deathclaw/devourer_fx.nif</SHADERNIF>
			<ShadowDef>
				<ShadowNIF>Art/Units/01_UnitShadows/LionShadow.nif</ShadowNIF>
				<ShadowAttachNode>LionBip Spine1</ShadowAttachNode>
				<fShadowScale>0.05</fShadowScale>
			</ShadowDef>
			<fBattleDistance>0.35</fBattleDistance>
			<fRangedDeathTime>0.28</fRangedDeathTime>
			<bActAsRanged>0</bActAsRanged>
			<TrainSound>AS2D_UNIT_BUILD_UNIT</TrainSound>
			<AudioRunSounds>
				<AudioRunTypeLoop/>
				<AudioRunTypeEnd/>
			</AudioRunSounds>
		</UnitArtInfo>

Also I didn't think lower case letters worked for TYPE tags...
 
There actually should be a Button tag where you can point to the location of the button DDS.
 
This is part of code from War Machine, python mod component from CvEventManager.py:

Code:
## War Machines ##
		if pWinner.getDomainType() == gc.getInfoTypeForString("DOMAIN_LAND") and not gc.getUnitInfo(pWinner.getUnitType()).isNoCapture():
			pPlot = pLoser.plot()
			if pPlot.isCity():
				pCity = pPlot.getPlotCity()
				iPlayer = pWinner.getOwner()
				iTeam = gc.getPlayer(iPlayer).getTeam()
				if pPlot.getNumVisibleEnemyDefenders(pWinner) < 2:
					for i in xrange(pPlot.getNumUnits()):
						pUnit = pPlot.getUnit(i)
						if pUnit.isNone(): continue
						if pUnit.getDomainType() == gc.getInfoTypeForString("DOMAIN_LAND"): continue
						if pUnit.isInvisible(iTeam, False): continue
						if not gc.getTeam(iTeam).isAtWar(pUnit.getTeam()): continue
						iUnitType = pUnit.getUnitType()
						iChance = 20			## Capture Chance ##
						if CyGame().getSorenRandNum(100, "Capture") < iChance:
							self.lCaptured.append(iUnitType)
## War Machines ##

I like when python or sdk components have their game options, because sometimes i want to play or don't want to play with that components (I know what i must to do in SDK please don't explain me that)

can i write this:

Code:
## War Machines ##
       [B] if (GC.getGame().isOption(GAMEOPTION_SOME_MY_GAMEOPTION)):[/B] // for example [B]GAMEOPTION_WAR_MACHINE[/B]
		if pWinner.getDomainType() == gc.getInfoTypeForString("DOMAIN_LAND") and not gc.getUnitInfo(pWinner.getUnitType()).isNoCapture():
			pPlot = pLoser.plot()
			if pPlot.isCity():
				pCity = pPlot.getPlotCity()
				iPlayer = pWinner.getOwner()
				iTeam = gc.getPlayer(iPlayer).getTeam()
				if pPlot.getNumVisibleEnemyDefenders(pWinner) < 2:
					for i in xrange(pPlot.getNumUnits()):
						pUnit = pPlot.getUnit(i)
						if pUnit.isNone(): continue
						if pUnit.getDomainType() == gc.getInfoTypeForString("DOMAIN_LAND"): continue
						if pUnit.isInvisible(iTeam, False): continue
						if not gc.getTeam(iTeam).isAtWar(pUnit.getTeam()): continue
						iUnitType = pUnit.getUnitType()
						iChance = 20			## Capture Chance ##
						if CyGame().getSorenRandNum(100, "Capture") < iChance:
							self.lCaptured.append(iUnitType)
## War Machines ##

Is this work ? If work, do i must import some additional files in CvEventManager.py ?
 
Also I didn't think lower case letters worked for TYPE tags...
You can, it's just generally not recommended because it increases the chances of tags being identical with proper words in the text, which could lead to unintended behavior.

(By the way, I didn't mean to repeat your answer, didn't see that you have already replied while I was typing my post.)
 
What about the art of the building? I guess you added it to your mod.

That is wrong:
Code:
<Button>,Art/Structures/Buildings/Herbalist/Herbalist.dds</Button>

Delete the leading comma (it is not even in FfH-AoI). A leading comma is only for buttons in an Atlas file.

Like that, you have a sure crash.

PS: FfH - Age of Ice does not have a custom dll.

ok....so i took out the leading comma in the code above and it still crashes when i attempt to add it to the building queue.:cry:
 
@ Zlatko:

it should work if you type
Code:
gc.getGame().isOption(GameOptionTypes.GAMEOPTION_...): # your comment

Python is not exactly C++ and caps/non-caps are important + comment doesn't start with //.

There might be a problem if you add too many options.

Just try it.
 
ok....so i took out the leading comma in the code above and it still crashes when i attempt to add it to the building queue.:cry:

Wait... the button is
Code:
Art/Interface/Buttons/Buildings/Herbalist.dds
NOT
Code:
Art/Structures/Buildings/Herbalist/Herbalist.dds
! The dds file you refer to is definitely not a button.

Also, I noticed you changed the LSystem definition. I hope you know what you're doing (I'm not an expert on art so no idea if it is correct or not, just a thought).

As a side note, text files are different than other xml files and you don't have to copy an entire text file in your mod, just have the new tags in whatever text file you want. The name of the text file doesn't matter. Also, there is no reason not to add the TXT_KEY_BUILDING_HERBALIST to the BuildingClass file.
 
@ Zlatko:

it should work if you type
Code:
gc.getGame().isOption(GameOptionTypes.GAMEOPTION_...): # your comment

Python is not exactly C++ and caps/non-caps are important + comment doesn't start with //.

There might be a problem if you add too many options.

Just try it.

Yes, with # not with // i am mix two languages
Which problem i can get if i put lots of gc.getGame().isOption(GameOptionTypes.GAMEOPTION_...): in .py files ?
 
Zlatko, contrary to you, I don't like options so I've never added one myself.

It's not about Python, it's about the game. It is something I read somewhere but I don't remember more.
 
I know how to make the ai use nationhood more, using the aiweight, in civtraits.

But how can I actually make the ai use the draft unit, ability more? Its the most important part of nationhood.

Specifically I'd like the AI to use drafting not just when their cities are in trouble.
 
In the Next War pedia, the Clone unit shows the same special ability as the Worker: "Can Improve Tiles" ...in other words, it somehow suppresses the big list of build orders.

I've ported the Clone unit to my personal mod, with few changes, but in my pedia, it shows the full list of build orders. How do I prevent that?

EDIT: Nevermind, answered my own question. If the Clone's available build orders differ from the Workers-- even if the Worker has a new, non-Firaxis build order-- it shows every order in the Clone's pedia. Otherwise it defaults to "Can Improve Tiles" :)
 
I have one question

I play civilization 4 very long and i never seen that VOTE_UN_FORCE_WAR (U.N. War Resolution) somewhere in game, i seen if you have apostolic palace and players vote declare war on someone, but in UN, never. How U.N. War Resolution work ?
 
I remember seeing something about values that affected production bonuses through the course of the game...wish I could be more specific...but I'd like to find and adjust those values. I'd like to strengthen the AI more as the game progresses than it does.

I find that if I set difficulty higher the early game is not really much fun, but if I set it lower the runaway effect ruins the late game.
 
Back
Top Bottom