Quick Modding Questions Thread

Quick question that is bugging me, why does the Settler iCost = 0 in UnitInfo.xml? All the other units in the file have the correct iCost, but the Settler has 0?

That's because the settler cost somehow scales with city size (i think, not sure), so special rules apply here.

EDIT: Another question. What exactly are MapScripts? Can I combine them with other mods? Can I use them with the regular game?

Thanks for the help!

Mapscripts = random maps, like continents, archipegalo, pangaea, etc.
They are normally designed for the standard game, yes, but you can also use them with mods, if there are no real big changes in the terrain and resources, else it might not work as intented.
Best is there to try 5 times or so if they produce playable maps, else you should ask in the thread what the reason for the problems could be.
 
Aren't Settlers and Workers produced with Food? The hammers are only added to the production, but they're not made up of hammers as such?
 
First on the right part, but that adjustment is connected to the ability to settle cities, not connected to being produced by food.
Not sure if i understand what the second part means...i guess you mean that it's not a 1:1 conversion from food to hammers? That might be, but i really don't know it here :dunno:.
 
I'm using the BUG/BAT mod, is there a way to save the preferences, it gets really frustrating having to reset them every time I reload a game.
 
Quick question that is bugging me, why does the Settler iCost = 0 in UnitInfo.xml? All the other units in the file have the correct iCost, but the Settler has 0?
Settler cost is handled in the dll, CvPlayer::getNewCityProductionValue()
You can't simply set an iCost in the xml because the settler cost changes depending on starting era, since you get free buildings and more initial population if you don't choose Ancient.
Btw you could add iCost to the xml, it would simply get added to all settler units, no matter what era.
 
OK, in my mod I'd like to change it so that one (the second one currently)civilization starts the game with the first turn and then the cilization that is currently first goes second. Basically shift their positions in my Iran Iraq war mod so that Iraq strikes first, then Iran (not the other way around). I tried messing with the public map, but it messed things up. Any ideas?
 
Just shift places in the WBS (World Builder Save) file?

But I guess the human player might always be first anyway. Perhaps a little Python script would do the thick? I'm thinking something like CyGame.setActivePlayer().
 
No, it doesn't matter who is human. It always goes player 0 -> player 1 -> player 2 -> ... -> Barbs.
 
The Iraq needs to be the first player (zero) in the WBS.
 
You need to change places all the way, both player info and team info.
 
I dug up another thread which helped me find the answer. You really need notepad plus to do it. You have to switch the following lines PlayerXCulture, TeamID=X, Team=X, CityOwner=X, and UnitOwner=X. Then, make sure the correct order of your teams matches the codes order in you file. I had everything changed except for UnitOwner so as soon as I started the game the enemies units were in my cities and instantly defeated me crashing the game! :lol:
 
By the way, I finally fixed the error. I had made a sort of stupid mistake. I had:

Code:
<ElementType name="iPopLimitModifier" type="textOnly"/>
Instead of:

Code:
<ElementType name="iPopLimitModifier" content="textOnly"/>
 
what would i need to add on the big and small map script to give it the world wrap option toroidal?
Probably CyMap.rebuild()
Spoiler :
VOID rebuild (INT iGridW, INT iGridH, INT iTopLatitude, INT iBottomLatitude, BOOL bWrapX, BOOL bWrapY, WorldSizeType eWorldSize, ClimateType eClimate, SeaLevelType eSeaLevel, INT iNumCustomMapOptions, CustomMapOptionType aeCustomMapOptions)
used to initialize the map during WorldBuilder load
 
The problem with technologies turned out to be that I misspelled the folder name!

I was wrong about the schema being the problem! The game couldn't read the schema at all!
 
Ive downloaded a few mods, some folders say standard install and they also have a folder named woc. For example 'tech by conquest' what does it mean this woc?

Thanks in advance ;)
 
I am getting the error message:

Assert Failed

File: CvGlobals.cpp
Line: 3493
Expression: strcmp(szType, "NONE")==0 || strcmp(szType, "")==0
Message: info type TERRAIN_GRASS not found, Current XML file is: xml\GameInfo/CIV4ForceControlInfos.xml

----------------------------------------------------------

However, the file 'CIV4ForceControlInfos.xml' contains only this:

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 -->
<!-- -->
<!-- ForceControlInfos - This structure describes the name for each multiplayer option. -->
<Civ4ForceControlInfos xmlns="x-schema:CIV4GameInfoSchema.xml">
	<ForceControlInfos>
		<ForceControlInfo>
			<Type>FORCECONTROL_SPEED</Type>
			<Description>TXT_KEY_FORCE_CONTROL_SPEED</Description>
			<Help>TXT_KEY_FORCE_CONTROL_SPEED_HELP</Help>
			<bDefault>0</bDefault>
		</ForceControlInfo>
		<ForceControlInfo>
			<Type>FORCECONTROL_HANDICAP</Type>
			<Description>TXT_KEY_FORCE_CONTROL_HANDICAP</Description>
			<Help>TXT_KEY_FORCE_CONTROL_HANDICAP_HELP</Help>
			<bDefault>0</bDefault>
		</ForceControlInfo>
		<ForceControlInfo>
			<Type>FORCECONTROL_OPTIONS</Type>
			<Description>TXT_KEY_FORCE_CONTROL_OPTIONS</Description>
			<Help>TXT_KEY_FORCE_CONTROL_OPTIONS_HELP</Help>
			<bDefault>0</bDefault>
		</ForceControlInfo>
		<ForceControlInfo>
			<Type>FORCECONTROL_VICTORIES</Type>
			<Description>TXT_KEY_FORCE_CONTROL_VICTORIES</Description>
			<Help>TXT_KEY_FORCE_CONTROL_VICTORIES_HELP</Help>
			<bDefault>0</bDefault>
		</ForceControlInfo>
		<ForceControlInfo>
			<Type>FORCECONTROL_MAX_TURNS</Type>
			<Description>TXT_KEY_FORCE_CONTROL_MAX_TURNS</Description>
			<Help>TXT_KEY_FORCE_CONTROL_MAX_TURNS_HELP</Help>
			<bDefault>0</bDefault>
		</ForceControlInfo>
		<ForceControlInfo>
			<Type>FORCECONTROL_MAX_CITY_ELIMINATION</Type>
			<Description>TXT_KEY_FORCE_CONTROL_MAX_CITY_ELIMINATION</Description>
			<Help>TXT_KEY_FORCE_CONTROL_MAX_CITY_ELIMINATION_HELP</Help>
			<bDefault>0</bDefault>
		</ForceControlInfo>
		<ForceControlInfo>
			<Type>FORCECONTROL_ADVANCED_START</Type>
			<Description>TXT_KEY_FORCE_ADVANCED_START</Description>
			<Help>TXT_KEY_FORCE_ADVANCED_START</Help>
			<bDefault>0</bDefault>
		</ForceControlInfo>
	</ForceControlInfos>
</Civ4ForceControlInfos>

Huh?
 
The "current XML file" can be misleading. The name of the most recently loaded XML file is stored and will show in cases where it isn't relevant. So something went wrong when that was the variable's current value. That particular file happens to be the last XML file that is loaded which makes it show up any time the value is reported after all the loading is done. It was probably something in Python calling a function in the DLL or just in the DLL itself, not anything in parsing the XML. The problem would be with a call to getInfoTypeForString("TERRAIN_GRASS") (since the line number given is an assert in that function which produces the specified expression), either in Python or something in the DLL that itself calls that.

The short version is that somewhere it is trying to translate TERRAIN_GRASS when no such info value is defined.
 
I searched the dll for 'TERRAIN_GRASS', but found nothing. Any idea where in Python it would be, or how to find it?

Ignoring that error for now, the game made it through XML but crashed while "[World of Pokiphlanon] Init Fonts(<An inconsistant float number>s<rest obcured>

Does anyone know what this means?
 
Back
Top Bottom