Quick Modding Questions Thread

Anyone knows what is the purpose of all these pyPrint lines in CvEventManager such as
Code:
CvUtil.pyPrint("City Razed Event: %s" %(city.getName(),))

I am sick of seeing python exception errors everything Porturgal is in the game due to those special city names...
 
Hmm thanks.
Quite sick of seeing those exception messages while doing in game modifications with Portugal in the game :D
 
I'm completely confused.

I have a mod that I created for the use of me and a couple friends. On my machine and theirs, I have gotten this mod to work immediately after a vanilla install + patch. On my new machine, however, once the game starts, I am instantly defeated. And now I'm wondering why. Have any ideas?
 
How can I change the frequency of goody huts?

In CIV4ImprovementInfos.xml is the ImprovementInfo for IMPROVEMENT_GOODY_HUT. That has a setting called iTilesPerGoody which is normally 40. If you lower this value you will increase the number of goody huts placed on the map. If you increase it the number placed will decrease.

Some mods have more than one type of goody hut (like inhabited star systems vs. wreckage in Final Frontier Plus, for example, or "goody islands" in the coastal waters in Caveman 2 Cosmos and some other mods).
 
How do you shorten or add a scroll-bar to this list of teams on the right hand side of the screen? I have something like 28 civs in a scenario and I can't see the top 2 teams or access my civs/religion/military buttons because the list is too long.
 
Where would you change the prerequisite for a civic? And would it be possible to add an 'expiration' to them? Say 'paganism can no longer be used once you have teched monotheism' or something like that.
 
Use python.
When city conquered, transfer all culture to new owner
 
Ah good to know that it can be done that easily.
Well, assuming one knows how to write such a command. Any hint? :mischief:
@Riveraxis
I don't know the answer to the question, but the Caveman2Cosmos mod (has its own forum subsection) has a feature where one can freely change the number of teams displayed. Maybe you can ask there for more info.
 
Hint:
Code:
	def onCityAcquired(self, argsList):
		'City Acquired'
		iPreviousOwner,iNewOwner,pCity,bConquest,bTrade = argsList
		CvUtil.pyPrint('City Acquired Event: %s' %(pCity.getName()))

Do something here :D
Possible to code, except that it will fail in one situation.
When it is the last city, most likely the civ is dead and there is no culture to convert.
 
Is there any particular way to instigate war in a scenario?

I set attitudes appropriately but no one seems to want to go to war, or when they do, they don't really attack. I even did a test run and sicked a large civilization against a small undefended one,they just won't attack. "Aggressive AI" is on.

Would changing the handicap help, maybe?

From inside the scenario you could use worldbuilder. In the xml you could create an event that happens immediately on starting that causes a war between countries. things like that.

Changing the handicap can help--<iAIDeclareWarProb> is a tag in HandicapInfo that changes how likely AIs declare war. On chieftain it's 25, on deity it's 100. That would probably help a bit.

and one last thing...BBAI deals with AIs not attacking and other things, it's really useful. you can get it here .

Hope at least one of those helps :goodjob:
 
With basic xml modding can I add a building that would require the city to be adjacent to a lake (but not next to ocean)?
 
With basic xml modding can I add a building that would require the city to be adjacent to a lake (but not next to ocean)?

I don't think so (at least not in regular BtS). Ocean or fresh water lake is determined entirely by the size, under 10 plots = lake, 10 or more = ocean. You can have a building require a body of water that is some minimum size which allows you to require ocean (or ocean and lakes above some size), but there is no tag to specify a maximum size which would allow you to require it not be an ocean.
 
Is there a way switch civs midgame? Do Barbarians only build ships with with UNITAI_ASSAULT_SEA AI? I've added some new units and they aren't building them. Do they upgrade galleys if possible?
 
I want to stop nations from changing civics - Is there an easy way?

Alternatively, is there a python file that controls this and I can comment out that section.
 
Back
Top Bottom