Quick Modding Questions Thread

CvGameTextMgr::assignFontIds() doesn't appear to have a limit :confused:

Since you appear to know the limit, can you make a test version (preferably based on vanilla, or the ModComp git), which fail? I would like to know precisely what happens and how it goes wrong. With a bit of luck, I will finally make the ModComp, which makes GamtFont configurable and much easier to use.

Well, it comes from experiments I made years ago. Take a look at this file for example (CIV4BonusInfos.xml). I added 40 dummy resources to make it a total of 75. All these new bonuses use the ART_DEF_BONUS_MOVIES. Without even changing the tga files, it is sufficient to distort the fonts in several places: Tech tree mouse hover, City screen, messages.

When you look at the WoC ("World of Civilization" team) mod with the extra large tag files (with more than 100 religions, corporations, resources), you see that they worked in the dll on a different way of indexing the symbols. There is probably no limit as such, it's more how the game reads the tga files.
 
When you look at the WoC ("World of Civilization" team) mod with the extra large tag files (with more than 100 religions, corporations, resources), you see that they worked in the dll on a different way of indexing the symbols. There is probably no limit as such, it's more how the game reads the tga files.

This makes it possible to use more icons but there are still limits. In C2C which has those modifications it is only possible to have 204 icons for bonuses.
 
I search for suggestion:
I changed Puppet State 1.6 mod, AI no more raze cities if can't make puppet state, AI will capture, make puppet or raze city. However, does is better to Player/AI can make several puppet states from one player or just can make one puppet state from one player ? What do you prefer ?
 
Where in the DLL is fighting handled? To be specific I want to code a function that gets the number of combat units on the tile of the defender and based on that applies a combat penalty to him.
 
CvUnit::maxCombatStr() is probably the right place to calculate and modify unit strength.
 
A couple years ago I came across a little modcomponent that placed civs in areas with the right resources and terrain to match their real-life environments, so like, Arabia would start in a desert with oases and horses. Does anyone remember this mod, or have a link to it, or if not, does anyone know how I'd go about recreating it??

Thanks!
 
Up until now, when I've had to add a load screen hint to my mod, I've simply overwritten existing hints that were no longer relevant and/or not useful.

Now, I've reached the point where I'd prefer to just *add more* hints. Is this possible, and if so, what needs to be changed besides the hint text XML?
 
I suppose it would be enough to add new numbered entries in GameInfo/CIV4Hints.xml (TXT_KEY_HINT or TXT_KEY_HINT_INTERFACE).
 
I want to add new processes (specifically I want two processes each for Wealth, Research and Culture, one that's unlocked earlier but only converts 50% of hammers while the second one later in the tech tree converts 100%), but I can't seem to get them to appear ingame. I named the new processes the same as the present ones except with _INEFFICIENT_ in the text keys after PROCESS, moved the 100% processes to various late game techs and the inefficient ones to their previous techs of Alphabet, Currency and Music. When starting a game only the old processes show up in the tech tree at their new techs, but the old processes I added appear neither for their techs nor in cities of civs that have the needed techs. Is there something else I have to do besides editing CIV4ProcessInfo.xml and adding text keys for the new processes?
 
Its been awhile since I made mine (same 50%/100% as well as a barter 25%), and as far as I can see its only needed in proccessInfo.xml. I added it to CIV4NewConceptInfos.xml as well, though iirc its only for the Pedia.

Only thing I can think of is the order (shouldnt really matter though). I put the original 100% first and the 50% after. Also, again it shouldnt really matter, but maybe it doesnt read the _ very well. Lastly, do a "left shift + click icon" when starting to make sure it doesnt read the cache, but reloads everything. Even with the INI nocache setting I still need to do it once in a while.

Civ4ProccessInfo.xml
Spoiler :
PHP:
		<ProcessInfo>
			<Type>PROCESS_WEALTH2</Type>
			<Description>TXT_KEY_PROCESS_WEALTH2</Description>
			<Strategy>TXT_KEY_PROCESS_WEALTH_STRATEGY</Strategy>
			<TechPrereq>TECH_TRADE</TechPrereq>
			<ProductionToCommerceModifiers>
				<iProductionToCommerceModifier>50</iProductionToCommerceModifier>
				<iProductionToCommerceModifier>0</iProductionToCommerceModifier>
				<iProductionToCommerceModifier>0</iProductionToCommerceModifier>
			</ProductionToCommerceModifiers>
			<Button>,Art/Interface/Buttons/Process/ProcessWealth1.dds,Art/Interface/Buttons/VIP_Atlas.dds,1,16</Button>
		</ProcessInfo>
		<ProcessInfo>
			<Type>PROCESS_RESEARCH2</Type>
			<Description>TXT_KEY_PROCESS_RESEARCH2</Description>
			<Strategy>TXT_KEY_PROCESS_RESEARCH_STRATEGY</Strategy>
			<TechPrereq>TECH_WRITING</TechPrereq>
			<ProductionToCommerceModifiers>
				<iProductionToCommerceModifier>0</iProductionToCommerceModifier>
				<iProductionToCommerceModifier>50</iProductionToCommerceModifier>
				<iProductionToCommerceModifier>0</iProductionToCommerceModifier>
			</ProductionToCommerceModifiers>
			<Button>,Art/Interface/Buttons/Process/ProcessResearch1.dds,Art/Interface/Buttons/VIP_Atlas.dds,2,16</Button>
		</ProcessInfo>
		<ProcessInfo>
			<Type>PROCESS_CULTURE2</Type>
			<Description>TXT_KEY_PROCESS_CULTURE2</Description>
			<Strategy>TXT_KEY_PROCESS_CULTURE_STRATEGY</Strategy>
			<TechPrereq>TECH_PRIESTHOOD</TechPrereq>
			<ProductionToCommerceModifiers>
				<iProductionToCommerceModifier>0</iProductionToCommerceModifier>
				<iProductionToCommerceModifier>0</iProductionToCommerceModifier>
				<iProductionToCommerceModifier>50</iProductionToCommerceModifier>
			</ProductionToCommerceModifiers>
			<Button>,Art/Interface/Buttons/Process/ProcessCulture1.dds,Art/Interface/Buttons/VIP_Atlas.dds,3,16</Button>
		</ProcessInfo>
		<ProcessInfo>
			<Type>PROCESS_ESPIONAGE2</Type>
			<Description>TXT_KEY_PROCESS_ESPIONAGE2</Description>
			<Strategy>TXT_KEY_PROCESS_ESPIONAGE_STRATEGY</Strategy>
			<TechPrereq>TECH_SLAVERY</TechPrereq>
			<ProductionToCommerceModifiers>
				<iProductionToCommerceModifier>0</iProductionToCommerceModifier>
				<iProductionToCommerceModifier>0</iProductionToCommerceModifier>
				<iProductionToCommerceModifier>0</iProductionToCommerceModifier>
				<iProductionToCommerceModifier>50</iProductionToCommerceModifier>
			</ProductionToCommerceModifiers>
			<Button>,Art/Interface/Buttons/Process/ProcessEspionage1.dds,Art/Interface/Buttons/VIP_Atlas.dds,4,16</Button>
		</ProcessInfo>
		<ProcessInfo>
			<Type>PROCESS_BARTER</Type>
			<Description>TXT_KEY_PROCESS_BARTER</Description>
			<Strategy>TXT_KEY_PROCESS_BARTER_STRATEGY</Strategy>
			<TechPrereq>NONE</TechPrereq>
			<ProductionToCommerceModifiers>
				<iProductionToCommerceModifier>25</iProductionToCommerceModifier>
				<iProductionToCommerceModifier>0</iProductionToCommerceModifier>
				<iProductionToCommerceModifier>0</iProductionToCommerceModifier>
			</ProductionToCommerceModifiers>
			<Button>,Art/Interface/Buttons/Process/ProcessBarter.dds,Art/Interface/Buttons/VIP_Atlas.dds,1,15</Button>
		</ProcessInfo>


CIV4NewConceptInfos.xml
Spoiler :
PHP:
		<NewConceptInfo>
			<Type>CONCEPT_PROCESS_ESPIONAGE2</Type>
			<Description>TXT_KEY_PROCESS_ESPIONAGE2</Description>
			<Civilopedia>TXT_KEY_CONCEPT_ESPIONAGE_PEDIA</Civilopedia>
			<bGraphicalOnly>1</bGraphicalOnly>
		</NewConceptInfo>
		<NewConceptInfo>
			<Type>CONCEPT_PROCESS_WEALTH2</Type>
			<Description>TXT_KEY_PROCESS_WEALTH2</Description>
			<Civilopedia>TXT_KEY_CONCEPT_WEALTH_PEDIA</Civilopedia>
			<bGraphicalOnly>1</bGraphicalOnly>
		</NewConceptInfo>
		<NewConceptInfo>
			<Type>CONCEPT_PROCESS_RESEARCH2</Type>
			<Description>TXT_KEY_PROCESS_RESEARCH2</Description>
			<Civilopedia>TXT_KEY_CONCEPT_RESEARCH_PEDIA</Civilopedia>
			<bGraphicalOnly>1</bGraphicalOnly>
		</NewConceptInfo>
		<NewConceptInfo>
			<Type>CONCEPT_PROCESS_CULTURE2</Type>
			<Description>TXT_KEY_PROCESS_CULTURE2</Description>
			<Civilopedia>TXT_KEY_CONCEPT_CULTURE_PEDIA</Civilopedia>
			<bGraphicalOnly>1</bGraphicalOnly>
		</NewConceptInfo>
		<NewConceptInfo>
			<Type>CONCEPT_PROCESS_BARTER</Type>
			<Description>TXT_KEY_PROCESS_BARTER</Description>
			<Civilopedia>TXT_KEY_CONCEPT_BARTER_PEDIA</Civilopedia>
			<bGraphicalOnly>1</bGraphicalOnly>
		</NewConceptInfo>
 
Never mind, I'm stupid: I just renamed the description and forgot about the type itself. :crazyeye:

While we are at it, where did you get the icon for the espionage process from, or did you make it yourself? I tried adding that process too but failed because the game would apparently only accept very specific dimensions for process icons and I suck at everything graphics related.
 
I have a question on the relationship between the %s1 variable in CIV4DiplomacyText and how it pluralizes TXT_KEY_CIV_x_ADJECTIVE when parsing the line in-game for diploblurbs. As I recall, in the base game, lines like "We demand you stop trading with the %s1" will properly pluralize singular adjectives and leave plural adjectives be (i.e. American&#8594;Americans, Chinese=Chinese). But it doesn't do this when I add custom civs.

Now, gender and pluralization are defined in CIV4GameTextInfos_Objects for every language except English, and adding the tags under <English> doesn't change anything. Does anyone know how this is controlled?
 
the movement points are reset at :doTurn in Cvunit.cpp
PHP:
	setMoves(0);
I think it would be better to put it the actual places where movement points are being used, though there are many places for that (attack, moves etc). Would be a lot of work ;)
 
Is there any tutorial on the formations XML and how to set it up and use it? There are at least two excellent formations mods, neither of which do exactly what I want to try and in any case I can't figure out how to just use the bits I do want.

What I want to do is show the progression of tactics with a unit line. For example starting with a single archer, progressing to a bunch of archers, then a coordinated set of lines of archers all of which should be possible with formations.

Both mods have the spearman -> phalanx -> square set up but I am unsure how to extract and use just that bit.
 
Donno. I've looked at it a couple of times and went: meh, later ;)
Though I really would like some 10+ unit formations, so I guess at one point it will be put on the working desk :p

Btw, regarding the the movepoints, given that my mod have quite a few changes to it, I thought I'd go all the way:

PHP:
	//Vincentz VMoves
	int newMoves = getMoves() - maxMoves();
	if (newMoves < 0) {newMoves = 0;}
	setMoves(newMoves);
Now, my mod have a different number of movepoint system and I always thought it was silly that a unit with 1 movepoint left could do an action that required 5.
This way spend movepoints carry over to next turn, so to use the above example, a unit with 10 movepoints would have 6 movepoints in the beginning of the next turn.

Havent thought it through though :crazyeye: gonna do a bit of testing :lol:
 
Back
Top Bottom