Quick Modding Questions Thread

So, I've been working on a general modmod(hence all the questions), and I'm trying to make later era units much stronger. It just irkes me that a maceman can take out a machine gun... But even upping the strength didn't help. Should I just increase the strength by an order of magnitude? Or is there a better way to do this?
 
Is there a way to change the number of trees shown in a 'forest'? I want to change it so there's just one tree displayed. I tried removing a bunch of the nifs listed in the Feature ArtDefines, but all that did was make the trees look weird and shove them to the NW end of the tile.
 
Is there a way to change the number of trees shown in a 'forest'? I want to change it so there's just one tree displayed. I tried removing a bunch of the nifs listed in the Feature ArtDefines, but all that did was make the trees look weird and shove them to the NW end of the tile.

You need a new nif with a single tree in it, and then replacing it with those entries you found above.
 
Hello!

For the huge mod I'm working on, I would like to add a few flavors in order to make the Stalin Leader choose to build Politburo and Communist Party HQ etc, which obviously Roosevelt does not want to build. So for the specific ideological building have FLAVOR_COMMUNIST, FLAVOR_FASCIST, and so on.

In globaltypes.xml, most entries have the <!--Changes must be reflected in CvEnums.h--> line above them, but for <FlavorTypes> this is not so.

My question thus is, will adding FLAVOR entries to steer the A.I leaders to choose buildings and units work in the intended way? Does it require SDK-work (as far as I can tell it shouldn't)?
 
As far as I can recall, I did not have to modify the DLL after adding a new flavor type.
 
I've been doing modifications to make SoD more manageable. Testing to the extreme (collateral damage many times larger than defender's combat), and I took off the limits to see how it would work. It now kills units, but takes forever. It only maxes out at about 10%-20% of the defender's combat, regardless of what it is. The attacker's combat and collateral max were many times larger. Is there some sort of hard limit outside of xml?
 
For the collateral damage, I think if I remember rightly there is some weird math in the SDK/DLL code.

It basically makes the damage really small or really large, in a weird mathy way.

There is a setting in the glabaldefines.xml I think.

<Define>
<DefineName>RANGE_COMBAT_DAMAGE</DefineName>
<iDefineIntVal>30</iDefineIntVal>
</Define>
<Define>
<DefineName>COLLATERAL_COMBAT_DAMAGE</DefineName>
<iDefineIntVal>10</iDefineIntVal>
</Define>

I think it was these two, but I found that changing them either did nothing or everything until we changed the underlying math in the DLL.
 
Quick question! I tried to add a new city style so I copied the Asian city nif (and textures) as a template and then renamed it to a native american style.

Before adding custom graphics, I decided to test this change in game - so I loaded up the game. Unfortunately the mod only partly works -- the default asian buildings appear now instead of the european ones for this civ only the textures are distorted - not just Asian textures but greco-roman ones too.

I'm not sure what caused this?? I deleted it and tried again but got the same result. Any help appreciated.
 
I'm looking to add some buildings in my mod. Is it as simple as copy and pasting a similar building's xml info, changing it slightly, and adding the text for it the text xml? Or are there more files I would have to edit?
 
I'm looking to add some buildings in my mod. Is it as simple as copy and pasting a similar building's xml info, changing it slightly, and adding the text for it the text xml? Or are there more files I would have to edit?

BuildingInfos, BuildingClassInfos in the XML\Buildings folder and CIV4ArtDefines_Building in the XML\Art folder is enough for most buildings. Of course there is the art files that need copying as well.
 
Your best option would be to edit the DLL - in response to your posting in the Civ4 Reimagined thread I posted a possible way how to do that: >link to answer<

If you only want to touch python you have a problem: Before onCityBuilt is executed all features are already removed in CvCity.cpp. However, you could try a somewhat hacky solution by adding floodplains if the city is on desert terrain and adjacent to a river - after all, that's where flood plains are located.
Code:
def onCityBuilt(self, argsList):
	'City Built'
	city = argsList[0]
	if (city.getOwner() == gc.getGame().getActivePlayer()):
		self.__eventEditCityNameBegin(city, False)	
	CvUtil.pyPrint('City Built Event: %s' %(city.getName()))

	self.featureFloodplains = gc.getInfoTypeForString("FEATURE_FLOOD_PLAINS")
	self.terrainDesert = gc.getInfoTypeForString("TERRAIN_DESERT")
	
	if (city.plot().getTerrainType() == self.terrainDesert and city.plot().isRiver()):
		city.plot().setFeatureType(self.featureFloodplains, -1)
This won't work for cities placed with the world editor and might have other glitches, thus I recommend editing CvCity::init() instead if you can.
For our mod we limited naval movement speed within enemy borders to 2 tiles/turn. It, too, requires DLL editing.
Thank you very much! It works flawlessly. :)

Does anyone know if there's something special to the <Flavors> tag in CIV4UnitInfos.xml? I'd assume all units default to the flavour MILITARY, unless they get another flavour assigned to them (Spies get ESPIONAGE, Great Prophets get RELIGION, and so on).

Thus, if I want to add a few flavours - say, CAVALRY, SIEGE... - I should give units both the flavour MILITARY and my own flavour, I suspect. Would that break anything, if anyone knows? Because I don't want leaders with flavour MILITARY to never build any units anymore because they all have a different flavour.
 
Think of flavors as leader-specific positive bias. Everyone will still evaluates stuff in the game based on their usefulness. But a military leader will prefer military flavored techs even above that.

Flavors also have other effects, for example a great person associated with a flavor will prefer techs with similar flavors on their discovery list.

But in general you cannot break anything by adding a new flavor. The worst thing that can happen is that it does nothing.
 
Think of flavors as leader-specific positive bias. Everyone will still evaluates stuff in the game based on their usefulness. But a military leader will prefer military flavored techs even above that.

Flavors also have other effects, for example a great person associated with a flavor will prefer techs with similar flavors on their discovery list.

But in general you cannot break anything by adding a new flavor. The worst thing that can happen is that it does nothing.
I know that. But that would imply that the flavour MILITARY actually doesn't do anything when it comes to building units - that only iBuildUnitProb influences how many units are made. So I wondered if the flavour MILITARY perhaps did influence that, in such a way that every single unit without a flavour automatically got the flavour MILITARY attached to it. But alright, thank you. :)

And no, VCrakeV, I don't believe you can do that using only the XML files (now, with the SDK, for example, it would be possible, of course).
 
@Crake

If you wanted to explore the problem further, this is the actual tag in the unitinfos that makes a unit 'gunpowder' in terms of building defence.
<bIgnoreBuildingDefense>1</bIgnoreBuildingDefense>



Well, :) :) :) :):) :) :) :):) :) :) :):) :) :) :)... Thanks! I was just half-way through changing all gunpowder units to a new combat class that I made... Since I'm already pretty much done, do you think that would work too?
 
No. ARMOR, for example, also ignores it, so it's not part of one unitclass (it's simply bIgnoreBuildingDefense). Besides, if you do ever want to add a new unitclass, you'd also have to carefully change all the instances where this unitclass is used; combat modifiers, promotions, events...
 
Top Bottom