Quick Modding Questions Thread

So I looked through this whole thread and a fair few pages of the forums, and while this has probably been asked before I could not for the life of me find it.

Is there a really nice, simple, easy way for me, someone with minimal xml programming experience and none in python, to disable all technologies from the modern era onwards, so when it gets to that point either there is nothing to research or it just goes straight to "future tech"? I want to be able to play with the ponies and never get to the guns and tanks stage :P
 
xml isn't programming, but yeah, if you were to comment out all of the "offending" techs like so:

Spoiler example of normal XML :
Code:
<TechInfo>
			<Type>TECH_MYSTICISM</Type>
			<Description>TXT_KEY_TECH_MYSTICISM</Description>
			<Civilopedia>TXT_KEY_TECH_MYSTICISM_PEDIA</Civilopedia>
			<Help/>
			<Strategy>TXT_KEY_TECH_MYSTICISM_STRATEGY</Strategy>
			<Advisor>ADVISOR_RELIGION</Advisor>
			<iAIWeight>0</iAIWeight>
			<iAITradeModifier>0</iAITradeModifier>
			<iCost>50</iCost>
			<iAdvancedStartCost>100</iAdvancedStartCost>
			<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
			<Era>ERA_ANCIENT</Era>
			<FirstFreeUnitClass>NONE</FirstFreeUnitClass>
			<iFeatureProductionModifier>0</iFeatureProductionModifier>
			<iWorkerSpeedModifier>0</iWorkerSpeedModifier>
			<iTradeRoutes>0</iTradeRoutes>
			<iHealth>0</iHealth>
			<iHappiness>0</iHappiness>
			<iFirstFreeTechs>0</iFirstFreeTechs>
			<iAsset>8</iAsset>
			<iPower>0</iPower>
			<bRepeat>0</bRepeat>
			<bTrade>1</bTrade>
			<bDisable>0</bDisable>
			<bGoodyTech>1</bGoodyTech>
			<bExtraWaterSeeFrom>0</bExtraWaterSeeFrom>
			<bMapCentering>0</bMapCentering>
			<bMapVisible>0</bMapVisible>
			<bMapTrading>0</bMapTrading>
			<bTechTrading>0</bTechTrading>
			<bGoldTrading>0</bGoldTrading>
			<bOpenBordersTrading>0</bOpenBordersTrading>
			<bDefensivePactTrading>0</bDefensivePactTrading>
			<bPermanentAllianceTrading>0</bPermanentAllianceTrading>
			<bVassalTrading>0</bVassalTrading>
			<bBridgeBuilding>0</bBridgeBuilding>
			<bIrrigation>0</bIrrigation>
			<bIgnoreIrrigation>0</bIgnoreIrrigation>
			<bWaterWork>0</bWaterWork>
			<iGridX>1</iGridX>
			<iGridY>11</iGridY>
			<DomainExtraMoves/>
			<CommerceFlexible/>
			<TerrainTrades/>
			<bRiverTrade>0</bRiverTrade>
			<Flavors>
				<Flavor>
					<FlavorType>FLAVOR_RELIGION</FlavorType>
					<iFlavor>9</iFlavor>
				</Flavor>
				<Flavor>
					<FlavorType>FLAVOR_GOLD</FlavorType>
					<iFlavor>1</iFlavor>
				</Flavor>
				<Flavor>
					<FlavorType>FLAVOR_CULTURE</FlavorType>
					<iFlavor>8</iFlavor>
				</Flavor>
				<Flavor>
					<FlavorType>FLAVOR_GROWTH</FlavorType>
					<iFlavor>2</iFlavor>
				</Flavor>
			</Flavors>
			<OrPreReqs/>
			<AndPreReqs/>
			<Quote>TXT_KEY_TECH_MYSTICISM_QUOTE</Quote>
			<Sound>AS2D_TECH_MYSTICISM</Sound>
			<SoundMP>AS2D_TECH_MP_MYSTICISM</SoundMP>
			<Button>,Art/Interface/Buttons/TechTree/Mysticism.dds,Art/Interface/Buttons/TechTree_Atlas.dds,4,11</Button>
		</TechInfo>

Spoiler example of "commenting out" :
Code:
[B]<!--[/B]<TechInfo>
			<Type>TECH_MYSTICISM</Type>
			<Description>TXT_KEY_TECH_MYSTICISM</Description>
			<Civilopedia>TXT_KEY_TECH_MYSTICISM_PEDIA</Civilopedia>
			<Help/>
			<Strategy>TXT_KEY_TECH_MYSTICISM_STRATEGY</Strategy>
			<Advisor>ADVISOR_RELIGION</Advisor>
			<iAIWeight>0</iAIWeight>
			<iAITradeModifier>0</iAITradeModifier>
			<iCost>50</iCost>
			<iAdvancedStartCost>100</iAdvancedStartCost>
			<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
			<Era>ERA_ANCIENT</Era>
			<FirstFreeUnitClass>NONE</FirstFreeUnitClass>
			<iFeatureProductionModifier>0</iFeatureProductionModifier>
			<iWorkerSpeedModifier>0</iWorkerSpeedModifier>
			<iTradeRoutes>0</iTradeRoutes>
			<iHealth>0</iHealth>
			<iHappiness>0</iHappiness>
			<iFirstFreeTechs>0</iFirstFreeTechs>
			<iAsset>8</iAsset>
			<iPower>0</iPower>
			<bRepeat>0</bRepeat>
			<bTrade>1</bTrade>
			<bDisable>0</bDisable>
			<bGoodyTech>1</bGoodyTech>
			<bExtraWaterSeeFrom>0</bExtraWaterSeeFrom>
			<bMapCentering>0</bMapCentering>
			<bMapVisible>0</bMapVisible>
			<bMapTrading>0</bMapTrading>
			<bTechTrading>0</bTechTrading>
			<bGoldTrading>0</bGoldTrading>
			<bOpenBordersTrading>0</bOpenBordersTrading>
			<bDefensivePactTrading>0</bDefensivePactTrading>
			<bPermanentAllianceTrading>0</bPermanentAllianceTrading>
			<bVassalTrading>0</bVassalTrading>
			<bBridgeBuilding>0</bBridgeBuilding>
			<bIrrigation>0</bIrrigation>
			<bIgnoreIrrigation>0</bIgnoreIrrigation>
			<bWaterWork>0</bWaterWork>
			<iGridX>1</iGridX>
			<iGridY>11</iGridY>
			<DomainExtraMoves/>
			<CommerceFlexible/>
			<TerrainTrades/>
			<bRiverTrade>0</bRiverTrade>
			<Flavors>
				<Flavor>
					<FlavorType>FLAVOR_RELIGION</FlavorType>
					<iFlavor>9</iFlavor>
				</Flavor>
				<Flavor>
					<FlavorType>FLAVOR_GOLD</FlavorType>
					<iFlavor>1</iFlavor>
				</Flavor>
				<Flavor>
					<FlavorType>FLAVOR_CULTURE</FlavorType>
					<iFlavor>8</iFlavor>
				</Flavor>
				<Flavor>
					<FlavorType>FLAVOR_GROWTH</FlavorType>
					<iFlavor>2</iFlavor>
				</Flavor>
			</Flavors>
			<OrPreReqs/>
			<AndPreReqs/>
			<Quote>TXT_KEY_TECH_MYSTICISM_QUOTE</Quote>
			<Sound>AS2D_TECH_MYSTICISM</Sound>
			<SoundMP>AS2D_TECH_MP_MYSTICISM</SoundMP>
			<Button>,Art/Interface/Buttons/TechTree/Mysticism.dds,Art/Interface/Buttons/TechTree_Atlas.dds,4,11</Button>
		</TechInfo>[B]-->[/B]

take note of the <!-- and --> and the beginning and end of the second example, that is how you comment in XML. Anything between those two arrows (for lack of a better word) is ignored by the computer.
 
Ohh thanks, that'll probably do it! I guess if it doesn't I'll have to post here again.

Edit: So, it messes with all the info files that link to it, but I think once I comment out the appropriate info files it might work. Or that might open up a whole new can of worms.

Edit: The more files I edit, the more xml errors open up. I'm thinking that there's too many files linking together to be editing them all and ensuring they all link right without throwing errors.

If anyone has or knows of a mod I can download instead or something else that might be simpler to try then I guess lemme know :(
 
I know that city population is calculated in CvCity.cpp. But where is calculated civs population? I want to change it from a sum of all cities population into ~ all cities population*(1+ %ofControlledLandmass*200/numofCities). How?

[EDIT]: I think I find it in CvPlayer.cpp but still don't know how to change it:
Spoiler :
Code:
long CvPlayer::getRealPopulation() const
{
    CvCity* pLoopCity;
    __int64 iTotalPopulation = 0;
    int iLoop = 0;

    for (pLoopCity = firstCity(&iLoop); pLoopCity != NULL; pLoopCity = nextCity(&iLoop))
    {
        iTotalPopulation += pLoopCity->getRealPopulation();
    }

    if (iTotalPopulation > MAX_INT)
    {
        iTotalPopulation = MAX_INT;
    }

    return ((long)(iTotalPopulation));
}
 
I know you can build cottages, what would it take to enable workers to be able to build Hamlets, Villages or Towns. i.e. speed up the growth of these by working the tile.
 
I know you can build cottages, what would it take to enable workers to be able to build Hamlets, Villages or Towns. i.e. speed up the growth of these by working the tile.
My own idea is that Workers would always have a "work tile" mission that makes the tile yield more. This would in fact be what the Slavery/Serfdom civic enables - the ability to make Workers (slaves/serfs) work the tiles directly - perhaps most useful before some of the associated Improvements themselves are available. So it wouldn't be as effective in the later eras, but still a viable option for otherwise useless Workers in a fully improved land.

I would rather give Workers a "settle down" mission (with something like Emancipation) that disbands the Worker but makes the Cottage>Village grow one segment. So you'd be able to get something out of the Workers you don't need anymore.
 
Well, the next step is really to upgrade the Town into a City, but I don't think that should be a Worker action. Or perhaps it could?
 
That wouldn't work if the Town was in the FC of a city already (or within 2 tiles of a city or however you have it custom defined)

Retired Worker gives the Town +1:hammers: & +1:commerce:?
 
I know you can build cottages, what would it take to enable workers to be able to build Hamlets, Villages or Towns.

The only thing which is missing here (i think) are the entries in Units\BuildInfos.xml and related entries in the worker entries in UnitInfos.xml.
 
That wouldn't work if the Town was in the FC of a city already (or within 2 tiles of a city or however you have it custom defined)
Yeah, of course. Perhaps Workers (and Settlers) should also have the ability to join cities. This way it would be possible to migrate population.
 
The only thing which is missing here (i think) are the entries in Units\BuildInfos.xml and related entries in the worker entries in UnitInfos.xml.
Ok I will look into those.
 
iAIWeight is supposed to influence "Importance of building to the AI", but every single building has an iAIWeight value of zero, and the AI builds them anyway. What's up with that?
 
In the part of your sentence that reads 'influence "Importance of building to the AI"' you should be aware that influence != set.
It changes the value the AI places on the building, but they already have value it based on other factors. For example, if a city needs happiness then a building that gives happiness is rated highly in its determination of what it should build next.

The AI is set up to know about the various properties that exist in the XML file as it comes with the game. If you give a building some property via Python then the AI will not know anything about that new property. That is a good time to give it a little bit of iAIWeight. If you add a tag to the XML and do some DLL work to make the new tag do something but neglect to teach the AI anything about it, that would also be a good time to adjust that value.
 
What if I want the AI to never, ever build Wonders, leaving them all to me?
 
modifiy the AI in Civ4LeaderheadInfos.xml to have a low priority for wonders.

And which tag controls this function?
 
Back
Top Bottom