Quick Modding Questions Thread

I have units coming from Colonization. No problems with them.

I'm not an expert in art and I can only vaguely remember what I did. But this is what I notice: there is no _FX.nif file for the <SHADERNIF> tag in Colonization. This tag does not even exist in Colonization. I think it's all in the .nif file, that's why you have to make a copy of the .nif file, rename it _FX.nif and reference it in the <SHADERNIF> tag.

Something like that... :hammer:

It might not sound very logical but that's how my Colonization units work. Maybe this is not valid for every unit though.

EDIT: from youflancy, 15/11/2008: "The xxx_fx.nif means an NIF file with a shader(which can show more realistic scenes with shadows), and xxx.nif means the identical unit without a shader.
Civ4 program can take both types of NIF, and choose one of them to use, according to the performance of the computer.
But Colonization only use _fx files, simply because they look better."

Here is the link to the thread but it's a Colonization one, meaning that they were trying to use Civ4 units in Col.
 
Oh, that's interesting. Thanks for your help, I'll try it soon.
 
If you know answer on some question please answer.


1) This is map width and height

iW = map.getGridWidth()
iH = map.getGridHeight()

How i can know which value iW and iH have on some map size (DUEL, TINY, ... HUGE), i want to know this because i want for example on iH = 47 put ICE or something other, i want to know how to calculate iW and iH for every map size ?

2) What is this ?

Spoiler :
Code:
def getGridSize(argsList):
	"Reduce grid sizes by one level."
	grid_sizes = {
		WorldSizeTypes.WORLDSIZE_DUEL:		(24,15),
		WorldSizeTypes.WORLDSIZE_TINY:		(24,15),
		WorldSizeTypes.WORLDSIZE_SMALL:		(24,15),
		WorldSizeTypes.WORLDSIZE_STANDARD:	(24,15),
		WorldSizeTypes.WORLDSIZE_LARGE:		(24,15),
		WorldSizeTypes.WORLDSIZE_HUGE:		(24,15)
	}

3) What is this ?

Spoiler :
Code:
# Here is an example of obtaining grain sizes to fit with map sizes.
		sizekey = self.map.getWorldSize()
		sizevalues = {
			WorldSizeTypes.WORLDSIZE_DUEL:	  (3,2,1,2),
			WorldSizeTypes.WORLDSIZE_TINY:	  (3,2,1,2),
			WorldSizeTypes.WORLDSIZE_SMALL:	 (3,2,1,2),
			WorldSizeTypes.WORLDSIZE_STANDARD:  (4,2,1,2),
			WorldSizeTypes.WORLDSIZE_LARGE:	 (4,2,1,2),
			WorldSizeTypes.WORLDSIZE_HUGE:	  (5,2,1,2)
			}
		# You can add as many grain entries as you like.
		# Seed them all from the matrix using the following type of line:
		(iGrainOne, iGrainTwo, iGrainThree, iGrainFour) = sizevalues[sizekey]
		# The example is for four grain values. You may not need that many.
		# Check scripts that use MultilayeredFractal for more examples.

4) I have some problem with original BTS map script in my mod. I am add new fantasy terrain and YIELD for BTS and my terrain haven't same value because if they have, i get that terrain on BTS map scripts (important information: I AM NOT CHANGE DEFAULT MAP SCRIPT!!!) in my mod, but i don't want that. I want BTS map script like in BTS. Why terrain mixed with my fantasy terrain ?
 
I have units coming from Colonization. No problems with them.

I'm not an expert in art and I can only vaguely remember what I did. But this is what I notice: there is no _FX.nif file for the <SHADERNIF> tag in Colonization. This tag does not even exist in Colonization. I think it's all in the .nif file, that's why you have to make a copy of the .nif file, rename it _FX.nif and reference it in the <SHADERNIF> tag.

Something like that... :hammer:

It might not sound very logical but that's how my Colonization units work. Maybe this is not valid for every unit though.

EDIT: from youflancy, 15/11/2008: "The xxx_fx.nif means an NIF file with a shader(which can show more realistic scenes with shadows), and xxx.nif means the identical unit without a shader.
Civ4 program can take both types of NIF, and choose one of them to use, according to the performance of the computer.
But Colonization only use _fx files, simply because they look better."

Here is the link to the thread but it's a Colonization one, meaning that they were trying to use Civ4 units in Col.
Okay, I couldn't solve the problem but I think I gained some additional understanding.

The problem was indeed the SHADERNIF tag. I have used the same .nif file there as in the normal NIF tag (since only one is provided). Copying, renaming and referencing it as ***_fx.nif didn't help (and it would've surprised me if it did).

That is still confusing to me because the shadered nif, to my understanding, is the "higher quality" one. And colonization only uses shadered nifs. So why does a nif file that works in Colonization (presumably because it is of the higher quality) not work as a shadered nif in Civ4?

Is there a way to convert between those types, or get the game to properly accept and display the lower quality version as both the shadered and nonshadered graphics?
 
If I remember rightly, there is a process you have to go through to get civ4 graphics to work in col. it may be that you have to reverse this process to get col to work in civ.

Try looking in the col modding section for info on converting Civ graphics to Col, and it might give you some insight?
 
I'll do that, just haven't had the time yet. I'll definitely post the solution here in case I find it or someone tells me.
 
Greetings!
I need a little help with a new building.
I have created a Navy Academy which gives XP bonus to ships. It works all fine except 1 problem:
I can't seem to make to be only available to port cities.
I know there are building properties that are set for port buildings (like Lighthouse):

<bWater>1</bWater>
and
<iMinAreaSize>10</iMinAreaSize>

However if I use both of them then my building - which is just a house - will appear over water as if it was a harbor or lighthouse. If I set bWater=0, it will appear on land, but will be available for building everywhere instead of just the port cities.

Any ideas how to solve this?
Thanks!

UPDATE: ok I find out that building actually appears on LAND since its art plot type is based of land building and only shown on water in pedia. I guess its fine with me unless you still have elegant solution how to make it better ;)
 
ok stupid question.
I got an error where a newly added unit works fine in game but doesn't show up in Pedia - it shows only an icon and a blank page - no model no text.
I seen this error before and fixed it, but can't remember what it was.

Could someone please give me a hint?

Even with python exceptions activated I have had this happen without giving an error.

It usually means that you have something wrong with the art def for the unit.
 
Even with python exceptions activated I have had this happen without giving an error.

It usually means that you have something wrong with the art def for the unit.

Exactly. The unit walks, shoots and dies just fine. But blank pedia entry.

Can you see anything wrong here?

The file paths obviously correct otherwise unit wouldn't be working at all...

Spoiler :
<UnitArtInfo>
<Type>ART_DEF_UNIT_MUSKETEER_M</Type>
<Button>,Art/Interface/Buttons/Units/Musketeer.dds,Art/Interface/Buttons/Unit_Resource_Atlas.dds,2,2</Button>
<fScale>0.44</fScale>
<fInterfaceScale>1.0</fInterfaceScale>
<bActAsLand>0</bActAsLand>
<bActAsAir>0</bActAsAir>
<NIF>Art/Units/MusketeerM/MusketeerM.nif</NIF>
<KFM>Art/Units/MusketeerM/arquebusier.kfm</KFM>
<SHADERNIF>Art/Units/MusketeerM/MusketeerM.nif</SHADERNIF>
<ShadowDef>
<ShadowNIF>Art/Units/01_UnitShadows/UnitShadow.nif</ShadowNIF>
<ShadowAttachNode>BIP Pelvis</ShadowAttachNode>
<fShadowScale>1.0</fShadowScale>
</ShadowDef>
<fBattleDistance>0.35</fBattleDistance>
<fRangedDeathTime>0.05</fRangedDeathTime>
<bActAsRanged>1</bActAsRanged>
<TrainSound>AS2D_UNIT_BUILD_UNIT</TrainSound>
<AudioRunSounds>
<AudioRunTypeLoop/>
<AudioRunTypeEnd/>
</AudioRunSounds>
</UnitArtInfo>
 
Exactly. The unit walks, shoots and dies just fine. But blank pedia entry.

Can you see anything wrong here?

The file paths obviously correct otherwise unit wouldn't be working at all...

Spoiler :
<UnitArtInfo>
<Type>ART_DEF_UNIT_MUSKETEER_M</Type>
<Button>,Art/Interface/Buttons/Units/Musketeer.dds,Art/Interface/Buttons/Unit_Resource_Atlas.dds,2,2</Button>
<fScale>0.44</fScale>
<fInterfaceScale>1.0</fInterfaceScale>
<bActAsLand>0</bActAsLand>
<bActAsAir>0</bActAsAir>
<NIF>Art/Units/MusketeerM/MusketeerM.nif</NIF>
<KFM>Art/Units/MusketeerM/arquebusier.kfm</KFM>
<SHADERNIF>Art/Units/MusketeerM/MusketeerM.nif</SHADERNIF>
<ShadowDef>
<ShadowNIF>Art/Units/01_UnitShadows/UnitShadow.nif</ShadowNIF>
<ShadowAttachNode>BIP Pelvis</ShadowAttachNode>
<fShadowScale>1.0</fShadowScale>
</ShadowDef>
<fBattleDistance>0.35</fBattleDistance>
<fRangedDeathTime>0.05</fRangedDeathTime>
<bActAsRanged>1</bActAsRanged>
<TrainSound>AS2D_UNIT_BUILD_UNIT</TrainSound>
<AudioRunSounds>
<AudioRunTypeLoop/>
<AudioRunTypeEnd/>
</AudioRunSounds>
</UnitArtInfo>
Is there an arquebusier.nif in the units folder?
 
I think I had oddities of this sort happening to me before, and it was something about how one of the graphics files was configured, and it needed the other specific file to be the way it expected it..

I know that it is not much of an explanation (or even the right explanation), but it was years ago and over my head even then :D
 
yeah there was, but I removed it since it was no longer used.
Somehow Pedia wants that arquebusier.nif to be there to display the unit :confused:
So I put it back in even though in game the unit worked fine without it.
Whats up with that?

The arquebusier.kfm is most likely using arquebusier.nif as its nif. Even though the nif is not being refed in the XML it is still needed by its kfm or it won't work properly.
 
The arquebusier.kfm is most likely using arquebusier.nif as its nif. Even though the nif is not being refed in the XML it is still needed by its kfm or it won't work properly.
Yepp, the kfm file always (at least for Civ) has a reference to a nif file that needs to be in the same folder, normally with the same name as the kfm file. I think in fact the nif file does not even have to be a real nif file, the kfm is happy just as long as there is a correctly named file in the same folder.
 
ok stupid question.
I got an error where a newly added unit works fine in game but doesn't show up in Pedia - it shows only an icon and a blank page - no model no text.
I seen this error before and fixed it, but can't remember what it was.

Could someone please give me a hint?
Some XML errors can cause this as well I think. Review the xml carefully if you've disproven art issues.
 
A pretty simple question here. I tried to look into guides for this, but they mostly are about creating whole new units or replacing the skin compeletely for everyone.

How does one replace skin of, say, Warrior, so that for example Native Americans have more native looking one? Preferrably so that they get no Wikipedia Entry of their own etc.
In short, the civilization specific skin should be exactly just that: A skin. Not a new unit, civ-specific or otherwise; the files and the pedia would become bloated as hell pretty damn fast.
 
Back
Top Bottom