Quick Modding Questions Thread

The other flavors are read from the XML and assigned numbers (0,1,2,...) based on the order they appear in the XML. If you look at other enums you will see it is common for NO or NONE to be -1, and this is used as a default and/or to prevent invalid things from happening in other parts of the code. "Exposed to Python" comments mean just what you would expect - these can be used in python.
 
The other flavors are read from the XML and assigned numbers (0,1,2,...) based on the order they appear in the XML. If you look at other enums you will see it is common for NO or NONE to be -1, and this is used as a default and/or to prevent invalid things from happening in other parts of the code. "Exposed to Python" comments mean just what you would expect - these can be used in python.

I can add new flavor just from xml?

PHP:
			<Flavors>
				<Flavor>
					<FlavorType>FLAVOR_MILITARY</FlavorType>
					<iFlavor>2</iFlavor>
				</Flavor>
				<Flavor>
					<FlavorType>FLAVOR_GOLD</FlavorType>
					<iFlavor>5</iFlavor>
				</Flavor>
			</Flavors>


			<Flavors>
				<Flavor>
					<FlavorType>FLAVOR_GOLD</FlavorType>
					<iFlavor>10</iFlavor>
				</Flavor>
				<Flavor>
					<FlavorType>FLAVOR_ESPIONAGE</FlavorType>
					<iFlavor>2</iFlavor>
				</Flavor>
			</Flavors>

What means these numbers in code (2,5,10,2)?
 
The iFlavor values are the strength of the flavor. Each leader has a couple of flavor values. Those are the flavors the leader is interested in. The leader's flavor values are multiplied by the matching flavor values of the building (or whatever) and added to the calculated value of the building (or whatever). Any flavor which is not specified has a value of 0 for that leader/building/whatever. So a leader with a military flavor of 5 has a city that needs to build something, when it assigns a value to a building that has a military flavor value of 2 that building gets an extra 5*2=10 points added to its value. In general, once it has decided to look into producing a building the city will try to build whichever building has the highest value. That is, for the most part, how the AI works: it has methods of assigning values to things and picks whatever ends up with the highest value - although there is usually a significant random factor included when assigning the value.

The flavor values in BtS are all 10 or less. They are mostly (or possibly all, I don't know for sure) set to 10, 5, or 2. These will generally only have a small effect, shifting the odds only slightly in favor of things with flavors that match the leader's flavors.
 
I don't know if this is quick or not but is there anyway to combine parts of two different skeletons and their animation? Specifically mounting units on a horse. e.i. A SAM infantry or a marine on a horse
 
I don't know if this is quick or not but is there anyway to combine parts of two different skeletons and their animation? Specifically mounting units on a horse. e.i. A SAM infantry or a marine on a horse

I am work with that clanky4, you can see my mod development HERE(with fantasy units but its similar with marines, SAM infantries.. etc), which is now stopped(temporarily). I can explain you something about skeletons, but i am not expert for animation, and complete art work.
 
Can someone explain me, what do WinMerge? Is this program useful for merging SDK source files? Can someone write quick tutorial in few steps? Thanks.
 
WinMerge compares files. It shows you the differences. It also allows you to copy the differences, also called "merge" instead of "copy" (hence the program name), one by one, from one file to the other (in either direction).

Using it to merge source code is potentially problematic. It has no understanding of what the code actually does so you can run into problems, particularly when the part of the code you are merging something into has already been modified in some other way. Example:
original code has "if A"
modified to "if A or B" in some mod component you already added
then the next thing you are merging has it as "if A or C".
WinMerge's change copying mechanism would replace the 2nd with the 3rd, wiping out the change that allowed for thing B. The correct merge, which you'd have to do manually, would most likely be "if A or B or C".

It is very useful, but has some limitations. Especially with source code or XML where there are a lot of similar lines. For example, adding even a short function that is similar to the ones around it (as they often are) tends to cause it report multiple differences instead of just one, sometimes throwing it out of synch for the rest of the file (or a large chunk of it) and report hundreds of non-existent differences as it is comparing the wrong parts of the files to each other. It can do the same thing if you add something to the XML, say a new unit in the middle of the unit info file - most of the lines are likely to be the same as in the now following unit and when WinMerge gets to taht part of the comparison it doesn't recognize that it is a single new UnitInfo tag, along with everything inside that, rather than a bunch of changes to individual lines. I have run into this sort of issue on numerous occasions. But even with the limitations it is still a very useful tool.
 
Thank you.
1)This is my problem:

I am download this: Expanded Civics Mod Phase 3d this mod have source files.

I have BTS v3.19 and when i tried to play this, i can't (When i go advanced and select this mod, this mod don't load, i just look my desktop and wait and wait and nothing is happening, i am try again and
nothing is happening again.)

when i again compile (i compile source files with this make file and this source files) this files with source files from this mod and i get about 105 errors. When i compile with method open source files and copy/paste changes marked with // < Changes Start > (This is begin of modification in source files) until // < Changes End > (This is end of modification in source files) for every source file, and i get this message in OUTPUT (see spoiler):

Spoiler :
------ Build started: Project: CvGameCoreDLL, Configuration: Release Win32 ------
Build started 24.5.2013 22:12:10.
Build:
"E:\Microsoft Visual C++ Toolkit 2003\bin\cl.exe" /nologo /MD /O2 /Oy /Oi /G7 /DNDEBUG /DFINAL_RELEASE /Fp"Release\CvGameCoreDLL.pch" /GR /Gy /W3 /EHsc /Gd /Gm- /DWIN32 /D_WINDOWS /D_USRDLL /DCVGAMECOREDLL_EXPORTS /Yu"CvGameCoreDLL.h" /IBoost-1.32.0/include /IPython24/include /I"E:\Microsoft Visual C++ Toolkit 2003/include" /I"E:\WindowsSDK/Include" /I"E:\WindowsSDK/Include/mfc" /I"E:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\CvGameCoreDLL\Boost-1.32.0/include" /I"E:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\CvGameCoreDLL\Python24/include" /FoRelease\CvInfos.obj /c CvInfos.cpp
CvInfos.cpp
CvInfos.cpp(6033): error C2086: 'int i' : redefinition
CvInfos.cpp(5964) : see declaration of 'i'
CvInfos.cpp(6148): error C2086: 'int i' : redefinition
CvInfos.cpp(6126) : see declaration of 'i'
CvInfos.cpp(6260): error C2664: 'void CvXMLLoadUtility::SetVariableListTagPair(int ** ,const TCHAR *,int,int,int)' : cannot convert parameter 3 from 'std::vector<_Ty>' to 'int'
with
[
_Ty=CvSpecialistInfo *
]
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
CvInfos.cpp(6337): error C2660: 'CvXMLLoadUtility::FindInInfoClass' : function does not take 4 arguments
CvInfos.cpp(6385): error C2660: 'CvXMLLoadUtility::FindInInfoClass' : function does not take 4 arguments
NMAKE : warning U4010: 'Release\CvInfos.obj' : build failed; /K specified, continuing ...
"E:\Microsoft Visual C++ Toolkit 2003\bin\cl.exe" /nologo /MD /O2 /Oy /Oi /G7 /DNDEBUG /DFINAL_RELEASE /Fp"Release\CvGameCoreDLL.pch" /GR /Gy /W3 /EHsc /Gd /Gm- /DWIN32 /D_WINDOWS /D_USRDLL /DCVGAMECOREDLL_EXPORTS /Yu"CvGameCoreDLL.h" /IBoost-1.32.0/include /IPython24/include /I"E:\Microsoft Visual C++ Toolkit 2003/include" /I"E:\WindowsSDK/Include" /I"E:\WindowsSDK/Include/mfc" /I"E:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\CvGameCoreDLL\Boost-1.32.0/include" /I"E:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\CvGameCoreDLL\Python24/include" /FoRelease\CvPlayer.obj /c CvPlayer.cpp
CvPlayer.cpp
CvPlayer.cpp(374): error C2065: 'iI' : undeclared identifier
CvPlayer.cpp(374): error C3861: 'iI': identifier not found, even with argument-dependent lookup
CvPlayer.cpp(374): error C3861: 'iI': identifier not found, even with argument-dependent lookup
CvPlayer.cpp(376): error C3861: 'iI': identifier not found, even with argument-dependent lookup
CvPlayer.cpp(376): error C3861: 'iI': identifier not found, even with argument-dependent lookup
CvPlayer.cpp(376): error C3861: 'iI': identifier not found, even with argument-dependent lookup
CvPlayer.cpp(383): error C3861: 'iI': identifier not found, even with argument-dependent lookup
CvPlayer.cpp(383): error C3861: 'iI': identifier not found, even with argument-dependent lookup
CvPlayer.cpp(383): error C3861: 'iI': identifier not found, even with argument-dependent lookup
CvPlayer.cpp(385): error C3861: 'iI': identifier not found, even with argument-dependent lookup
CvPlayer.cpp(385): error C3861: 'iI': identifier not found, even with argument-dependent lookup
CvPlayer.cpp(385): error C3861: 'iI': identifier not found, even with argument-dependent lookup
NMAKE : warning U4010: 'Release\CvPlayer.obj' : build failed; /K specified, continuing ...
NMAKE : warning U4011: 'Release\CvGameCoreDLL.dll' : not all dependents available; target not built
NMAKE : warning U4011: 'Release' : not all dependents available; target not built
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command "nmake /NOLOGO /K Release" exited with code 1.

Build FAILED.

Time Elapsed 00:00:05.68
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


here is image with errors:
eBRHasl.png


http://i.imgur.com/eBRHasl.png

This is try in "Microsoft Visual Studio 2010".

What is the problem? What i must to do?

2)Can i convert some SDK mod from v3.17 or v3.13 in v3.19?
 
Not sure about your program in particular but can you click or double click on an error line and have it take you to that portion of the code which offends? One error often has a domino effect so solving one then making another attempt to compile, then solving another then making another attempt to compile is a good process. You'll find each one solved repairs more than just its own error message usually.

If you go to the portion of the code where the error exists and you need more help, post the error line and the function you're having trouble with and highlight the line you're having trouble with and I and others may be able to help you further.
 
I've created custom buttons and flags for my Civ, but they appear to get ignored. As far as I can tell I have all the XML in order, but the game refuses to use anything except the Sumerian button/flag, despite the fact that I can't see any references to those files in my XML anywhere. I feel like I'm missing something stupid...
 
But the civ itself is there?
Could you show us your entries for your civ, and the ones in the ArtDefines_Civilizations?

Yes, the civ is there, refusing to acknowledge my hard artistic work!
Art file locations attached below.

CIV4ArtDefines_Civilization XML:
Code:
<CivilizationArtInfo>
	<Type>ART_DEF_CIVILIZATION_HEBREW</Type>
	<Button>,Art/Interface/Buttons/Civilizations/India.dds,Art/Interface/Buttons/HebrewNation.dds</Button>
	<Path>Art/Interface/TeamColor/FlagDECAL_Hebrew.dds</Path>
	<bWhiteFlag>0</bWhiteFlag>
</CivilizationArtInfo>

CIV4CivilizationInfos XML:
Code:
<CivilizationInfo>
	<Type>CIVILIZATION_HEBREW_NATION</Type>
	<Description>TXT_KEY_CIV_HEBREW_DESC</Description>
	<ShortDescription>TXT_KEY_CIV_HEBREW_SHORT_DESC</ShortDescription>
	<Adjective>TXT_KEY_CIV_HEBREW_ADJECTIVE</Adjective>
	<Civilopedia>TXT_KEY_CIV_HEBREW_PEDIA</Civilopedia>
	<DefaultPlayerColor>PLAYERCOLOR_DARK_INDIGO</DefaultPlayerColor>
	<ArtDefineTag>ART_DEF_CIVILIZATION_HEBREW</ArtDefineTag>
	<ArtStyleType>ARTSTYLE_MIDDLE_EAST</ArtStyleType>
	<UnitArtStyleType>UNIT_ARTSTYLE_MIDDLE_EAST</UnitArtStyleType>
	<bPlayable>1</bPlayable>
	<bAIPlayable>1</bAIPlayable>
	<Cities>
		<City>TXT_KEY_CITY_NAME_LEVI</City>
		<City>TXT_KEY_CITY_NAME_REUBEN</City>
		<City>TXT_KEY_CITY_NAME_SIMEON</City>
		<City>TXT_KEY_CITY_NAME_JUDAH</City>
		<City>TXT_KEY_CITY_NAME_DAN</City>
		<City>TXT_KEY_CITY_NAME_NAPHTALI</City>
		<City>TXT_KEY_CITY_NAME_GAD</City>
		<City>TXT_KEY_CITY_NAME_ISSACHAR</City>
		<City>TXT_KEY_CITY_NAME_ASHER</City>
		<City>TXT_KEY_CITY_NAME_ZEPULUN</City>
		<City>TXT_KEY_CITY_NAME_EPHRAIM</City>
		<City>TXT_KEY_CITY_NAME_MANASSEH1</City>
		<City>TXT_KEY_CITY_NAME_MANASSEH2</City>
		<City>TXT_KEY_CITY_NAME_BENJAMIN</City>
	</Cities>
	<Buildings>
		<Building>
			<BuildingClassType>BUILDINGCLASS_OBELISK</BuildingClassType>
			<BuildingType>BUILDING_HEBREW_ALTAR</BuildingType>
		</Building>
	</Buildings>
	<Units>
		<Unit>
			<UnitClassType>UNITCLASS_SCOUT</UnitClassType>
			<UnitType>UNIT_HEBREW_SPY</UnitType>
		</Unit>
	</Units>
	<FreeUnitClasses>
		<FreeUnitClass>
			<UnitClassType>UNITCLASS_SETTLER</UnitClassType>
			<iFreeUnits>1</iFreeUnits>
		</FreeUnitClass>
	</FreeUnitClasses>
	<FreeBuildingClasses>
		<FreeBuildingClass>
			<BuildingClassType>BUILDINGCLASS_PALACE</BuildingClassType>
			<bFreeBuildingClass>1</bFreeBuildingClass>
		</FreeBuildingClass>
	</FreeBuildingClasses>
	<FreeTechs>
		<FreeTech>
			<TechType>TECH_AGRICULTURE</TechType>
			<bFreeTech>1</bFreeTech>
		</FreeTech>
		<FreeTech>
			<TechType>TECH_HUNTING</TechType>
			<bFreeTech>1</bFreeTech>
		</FreeTech>
	</FreeTechs>
	<DisableTechs/>
	<InitialCivics>
		<CivicType>CIVIC_DESPOTISM</CivicType>
		<CivicType>CIVIC_BARBARISM</CivicType>
		<CivicType>CIVIC_TRIBALISM</CivicType>
		<CivicType>CIVIC_DECENTRALIZATION</CivicType>
		<CivicType>CIVIC_PAGANISM</CivicType>
	</InitialCivics>
	<Leaders>
		<Leader>
			<LeaderName>LEADER_JOSHUA</LeaderName>
			<bLeaderAvailability>1</bLeaderAvailability>
		</Leader>
	</Leaders>
	<DerivativeCiv>CIVILIZATION_BABYLON</DerivativeCiv>
	<CivilizationSelectionSound>AS3D_SUMERIA_SELECT</CivilizationSelectionSound>
	<CivilizationActionSound>AS3D_SUMERIA_ORDER</CivilizationActionSound>
</CivilizationInfo>
 

Attachments

  • button_location.PNG
    button_location.PNG
    68 KB · Views: 29
  • flag_location.PNG
    flag_location.PNG
    72.5 KB · Views: 87
The button definition is wrong. The whole "leading comma followed by multiple comma separated things" is only for when a button is stored in an atlas, and it requires 2 more parameters (numbers telling it which image in the atlas to use) than you gave.

You should just have
Code:
<Button>Art/Interface/Buttons/HebrewNation.dds</Button>
No commas at all.

Aside from that, make sure the paths are actually correct.
 
No commas at all.

Awesome! I didn't read that anywhere in my digging, so thank you for the clarification. I'll try it out when I get home.

Incidentally...if the path is a fail then why is the Sumerian art showing up? Shouldn't it be blank, or pink, or whatever?
 
Not sure about your program in particular but can you click or double click on an error line and have it take you to that portion of the code which offends? One error often has a domino effect so solving one then making another attempt to compile, then solving another then making another attempt to compile is a good process. You'll find each one solved repairs more than just its own error message usually.

If you go to the portion of the code where the error exists and you need more help, post the error line and the function you're having trouble with and highlight the line you're having trouble with and I and others may be able to help you further.

Thank you for advice, i gave up from that, because there are codes from BTS v3.13 i think, i am not sure, and i must do lots of changes (convert codes from old version in v3.19) and i haven't lots of experience now.
 
Maybe it's a caching issue.
Hold down shift while the game loads, and see if it changes anything.
(and disable caching in your main Civ4.ini)

I tried both of these things and it didn't fix it. I'm still seeing the Sumerian button and flag.

Was this the setting in the INI you meant?
Code:
; Disable caching of xml and file system (may slow initialization)
DisableCaching = 1

I changed that to '1' from '0', which is what made sense to do, but it still didn't change anything.

I got to this file by opening the shortcut in my 'Beyond the Sword' directory, which points back to:
"C:\Users\...\Documents\My Games\Beyond the Sword\CivilizationIV.ini"

Is that the correct file?
 
That's the right file, and the value should be set to 1 (caching should be disabled for modders).

So that's probably not an issue.
Other possible problems:
- The ArtDefines_Civilizations.xml is at the wrong place
- Wrong named
- The folders it is in are wrong named

Recheck these things.
 
Back
Top Bottom