Quick Modding Questions Thread

No. Generally, you can assume that a mod won't work online. Hot Seat plays like single player (when it comes to turns and code et cetera), with one or more humans instead of AI's. Multiplayer is different, and a lot of code needs to be made specially to account for that.





If this mod only adds XML things, however, then chances are it'll work online. But, try it out - can you launch an online game with only you and AI's? If that works fine, then it should probably work fine with you and another human as well.





I might be able to contribute expanded city lists and great people names to that (I'm in the process of adding all cities and great people names of Civilization III, V, and Rise of Nations - and possibly Empire Earth? - to my own mod, though it takes a lot of time because I want to read up on all of them :p). Do you have a link to this mod, perhaps?



I'm afraid not, but it's on the forum in the mod pack list.
 
I ask too many questions... I was thinking of making a rebalance mod for leader traits for personal use. Is there a way to make buildings (as a group) faster/cheaper to build?
 
Asking questions isn't bad. :)

To prove that, I will ask my own question: What are groups of buildings? Monuments, Obelisks, Steles, and Totem Poles, for example? They all share the same buildingclass (Obelisk), and it's buildingclasses, not buildings, that are made cheaper with traits (and everything).
 
Asking questions isn't bad. :)

To prove that, I will ask my own question: What are groups of buildings? Monuments, Obelisks, Steles, and Totem Poles, for example? They all share the same buildingclass (Obelisk), and it's buildingclasses, not buildings, that are made cheaper with traits (and everything).



Sorry for not being explicit. I mean, there are three "groups" of things you can build: Units, wonders, and buildings as a whole. Do they have they're own class? I know the first two "groups" do, as they're used in traits. I was thinking of splitting Industrious' bonus between wonders and buildings (but not units).
 
Nope, I don't believe so. World wonders, national wonders, and team wonders, yes, but not buildings, as you can see here.
 
Do you think I could work around this by giving Industrious a bonus to production in general, and a penalty to production of units?
 
I don't know. You'll have to experiment, I suppose - but at least one probable side-effect would be the increased conversion of production to commerce types.

Perhaps this got buried:

This has been bugging me for at least half a dozen of hours now. I've tried many variations, but nothing seems to work... See, I can either make cities not remove terrain features they're built on (forests, jungles, floodplains...), and add an exception for floodplains so that they remain existing or respawn, or I can go the opposite road and have cities not remove terrain features and then remove forests and jungles in a city tile. But nothing works.

For example:

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()))
		if city.plot().getFeatureType() == gc.getInfoTypeForString("FEATURE_FOREST"):
			pPlot.setFeatureType(-1, -1)

This is supposed to check whether the city tile contains a forest, and if so, remove it. But, I consistently, no matter what I do, get a message along the lines of:

<bound method aiautoplay.oncitybuilt of <aiautoplay.aiautoplay instance at 0x370217B0>>

There's no crash or anything, but the forest persists.

I also have another question; can naval units be limited moving in enemy territory, much like land units are?
 
I also have another question; can naval units be limited moving in enemy territory, much like land units are?

Yes, you have to change one entry (on every naval unit) in CIV4UnitInfos.xml:
Code:
<bRivalTerritory>[B]0[/B]</bRivalTerritory>
If the value is "0", the unit can NOT enter rival territory :)
 
No, I mean their movement speed; land units get slowed down in enemy territory (war), whereas naval units don't. :)
 
Huh. That is an excellent point!
 
This has been bugging me for at least half a dozen of hours now. I've tried many variations, but nothing seems to work... See, I can either make cities not remove terrain features they're built on (forests, jungles, floodplains...), and add an exception for floodplains so that they remain existing or respawn, or I can go the opposite road and have cities not remove terrain features and then remove forests and jungles in a city tile. But nothing works.

This is supposed to check whether the city tile contains a forest, and if so, remove it. But, I consistently, no matter what I do, get a message along the lines of:

<bound method aiautoplay.oncitybuilt of <aiautoplay.aiautoplay instance at 0x370217B0>>

There's no crash or anything, but the forest persists.
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.
I also have another question; can naval units be limited moving in enemy territory, much like land units are?
For our mod we limited naval movement speed within enemy borders to 2 tiles/turn. It, too, requires DLL editing.
 
Anyone knows what <OnUnitChangeTo> does in FeatureInfos?

Apparently it changes a feature into another when a unit moves onto it.
void CvUnit::move(CvPlot* pPlot, bool bShow)
PHP:
	//change feature
	FeatureTypes featureType = pPlot->getFeatureType();
	if(featureType != NO_FEATURE)
	{
		CvString featureString(GC.getFeatureInfo(featureType).getOnUnitChangeTo());
		if(!featureString.IsEmpty())
		{
			FeatureTypes newFeatureType = (FeatureTypes) GC.getInfoTypeForString(featureString);
			pPlot->setFeatureType(newFeatureType);
		}
	}

Edit : It is only used in the Afterworld mod for walls and doors changing. (the weird mod with rooms)
 
Currently modding unit strength... What's power? Is it the same as combat? How do they differ? They seem to always be the same value.
 
Apparently it changes a feature into another when a unit moves onto it.
void CvUnit::move(CvPlot* pPlot, bool bShow)
PHP:
	//change feature
	FeatureTypes featureType = pPlot->getFeatureType();
	if(featureType != NO_FEATURE)
	{
		CvString featureString(GC.getFeatureInfo(featureType).getOnUnitChangeTo());
		if(!featureString.IsEmpty())
		{
			FeatureTypes newFeatureType = (FeatureTypes) GC.getInfoTypeForString(featureString);
			pPlot->setFeatureType(newFeatureType);
		}
	}

Edit : It is only used in the Afterworld mod for walls and doors changing. (the weird mod with rooms)

THX :)
 
Got a more serious issue... I've been modding (editing) a civic, and it seems to crash whenever I load the mod. I've changed the required tech, and the effects, but none of the reference info (tags). I guess it's worth noting that it's a civic from a mod. I looked over it again and again... It seems to have no differences with the original, other than changing the effects. Also, I must emphasize that I edited it; I did not make a copy. I'll add screenshots soon.



EDIT: Was missing a closing bracket somewhere... Fixed it.
 

Attachments

  • 2016-07-26.png
    2016-07-26.png
    79.4 KB · Views: 88
  • 2016-07-26 (1).png
    2016-07-26 (1).png
    98.5 KB · Views: 83
  • 2016-07-26 (2).png
    2016-07-26 (2).png
    177.5 KB · Views: 69
  • 2016-07-26 (3).png
    2016-07-26 (3).png
    151.1 KB · Views: 49
Does anyone know how to change a unit's civ color to it's "white" flag?

I've attached a couple of images showing a pikeman which has the flag on its shield and also a man-at-arms which also displays the flag but it's overlayed with the blue civ color. It appears similar to setting a flag colour wrong using:
<bWhiteFlag>0</bWhiteFlag>





Is there similar code for units? And if so, what is the file name and where do I find it?

Thanks in advance!
 
Is it possible to change nuclear yield/damage? I don't see anything in the unit xml.

If you are referring to Fallout, that's a terrain feature, just like Forrest. Look at there.
 
Top Bottom