Quick Modding Questions Thread

Okay a while ago I changed the name of the religions in my mod, but when I build that Apostolic Palace, the old name of the religion will be displayed instead of the new name. How do I fix this?
 
Okay a while ago I changed the name of the religions in my mod, but when I build that Apostolic Palace, the old name of the religion will be displayed instead of the new name. How do I fix this?

Is this with a new game or an old game?
 
this is a Q for anyone familiar with map scripting.

I am currently looking at the smartmap.py map script, to see if i can tweak it to make a random generator that will work well with my mod.

My Q is this, would there be a way to write some code that does this:

If Civ X/Y/Z (three specific civs)
Place FEATURE_VAULT on settler start plot

TiA
Lib.
 
Isnt it easier to do it onCityBuilt rather than map generation?

Firstly not everyone likes the starting plot, sometimes better to move one tile before settling.
Secondly by default, the feature will be removed when the city is built anyway, without additional codes.
 
the feature remove is already disabled, basically I have a system where by 3 of the factions can only found on a Vault tile, and I have noticed that for the initial settlement the AI struggles unless it starts on a Vault tile, after that it seems to be able to find them and grow ok, it is just with the initial city it goes a bit screwy.

If the player is playing that civ then they can do whatever they like :-) this is just to give the AI a chance to start that civ off.
 
What's wrong here? (spawn a lion (for example) when a unit is klilled)
(the game starts interfacelessly with this code in)

Code:
def onUnitKilled(self, argsList):
		'Unit Killed'
		unit, iAttacker = argsList
		player = PyPlayer(unit.getOwner())
		attacker = PyPlayer(iAttacker)
		
		
		[COLOR="Red"]## raise undead from barb start
		barbPlayer = gc.getPlayer(gc.getBARBARIAN_PLAYER())
		pUnit = unit.plot()
		pNewUnit = barbPlayer.initUnit(gc.getInfoTypeForString("UNIT_LION"), pUnit.getX(), pUnit.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.NO_DIRECTION)
			pNewUnit.finishMoves()
		
		## raise undead from barb end[/COLOR]
		
		if (not self.__LOG_UNITKILLED):
			return
		CvUtil.pyPrint('Player %d Civilization %s Unit %s was killed by Player %d' 
			%(player.getID(), player.getCivilizationName(), PyInfo.UnitInfo(unit.getUnitType()).getDescription(), attacker.getID()))
 
why is there a tab in the last red line
indentation error
 
Quick question of the day :)

Facts:
-you can build farm anywhere (given water) without any bonuses present
-you can only build camps/pastures on a bonus tile

Which property determines this on bonus only restriction? I am looking at bonusinfo xml and can't seem to figure it out. (I want to allow to build camps anywhere even if no bonus)

thanks!
 
You have to look into the improvementInfos.xml.
There's no special flag for making an improvement available.
The fact why camps/pastures are not available everywhere is that there's no terrain defined where you could build them.
If you added tundra as valid terrain for camps, then you'd probably be able to build them everywhere.
I'm saying "probably" because I'm not sure, but this seems to be the only logical reason at the moment (I think I also dealt with that at some point, but can't remember anymore).
 
Besides Terrainmakesvalid, hillsmakesvalid (mines) or featuremakesvalid (lumbermill) will also work.
 
You have to look into the improvementInfos.xml.
There's no special flag for making an improvement available.
The fact why camps/pastures are not available everywhere is that there's no terrain defined where you could build them.
If you added tundra as valid terrain for camps, then you'd probably be able to build them everywhere.
I'm saying "probably" because I'm not sure, but this seems to be the only logical reason at the moment (I think I also dealt with that at some point, but can't remember anymore).

YEAH you were right - it worked ;)
I suspected this much but decided to ask, cause the improvementInfos file is a bit convoluted in such way that you don't get the complete and proper listing of ALL the tags. For example Farm missing the default yield tag (since its 0 the devs omitted it), but lumber mill for example missing some other tags, so I basically had to GUESS in which order tags would have to go when pulling features from 2 different types of improvements.

But otherwise it works ;)
 
I suspected this much but decided to ask, cause the improvementInfos file is a bit convoluted in such way that you don't get the complete and proper listing of ALL the tags. For example Farm missing the default yield tag (since its 0 the devs omitted it), but lumber mill for example missing some other tags, so I basically had to GUESS in which order tags would have to go when pulling features from 2 different types of improvements.

The Schema files tell you the exact order of the tags, in this case CIV4TerrainSchema.xml.
 
@ stolenrays: it happens to me too when I have finished comparing big files with different mod components in them, meaning different sizes as well.

I guess Notepad++ has to put these blanks in order for us to visualize properly the corresponding functions at the same level and that those blanks remain when we exit in a way that might not be appropriate?...
 
@ stolenrays: it happens to me too when I have finished comparing big files with different mod components in them, meaning different sizes as well.

I guess Notepad++ has to put these blanks in order for us to visualize properly the corresponding functions at the same level and that those blanks remain when we exit in a way that might not be appropriate?...

Well, it only happens with the compiler, and not with notepad or winmerge.
 
Back
Top Bottom