Mod Component Requests Thread

@ferocca
Replace the unit and building check with these.

If producing project and does not have wonder
Return false

If producing process
Return false

That check of yours is bound to fail since return true will disrupt all the checks below such as gold check
 
Thanks, I will do that platyping :)

Oh and to the guy who wanted to get a random city names mod component: I did it in the SDK. PM me if you still want to know how to do it. The way I did it you can able/disable it for any civilization with the boolean bRandomCities (I did that for civilizations like the Native Americans and other 'tribes' that didn't have a real capital or something).
 
How can i make it so that Settler type units cannot be built? I want to do sort of a one city challenge, but for the AI as well. Thank you.
 
If you want to make them always unable to be built, then you can just edit Assets/XML/Units/CIV4UnitInfos.xml so that UNIT_SETTLER's iCost value is -1.


If you want to disable them in certain situations, like game options, then you would block then in python. Edit Assets/Python/CvGameUtils.py by adding some code like this under def cannotTrain(self,argsList):
Code:
		if gc.getGame().isOption(GameOptionTypes.GAMEOPTION_ONE_CITY_CHALLENGE):
			if eUnit == gc.getInfoTypeForString('UNIT_SETTLER'):
				return True

(You may need to edit Assets/XML/PythonCallbackDefines.xml to change USE_CANNOT_TRAIN_CALLBACK from 0 to 1 in order to make this code run.)

Unfortunately you cannot add a new game option type without compiling a new DLL.
 
Thanks for the help Magister, but now I can't edit the XML file using notepad/wordpad. (Running Windows Vista as Administrator)
 
It is still possible to spawn Settlers via Goodie Huts though, so it still won't be a OCC :D
 
I think you can turn off settlers from goody huts in HandicapInfos because you can't get settlers anymore from noble to higher levels:)

I just managed to make projects hurryable by population, gold and engineer rush. Besides a very minor display bug that I can fix later for sure, that work is done (even adding a working HurryCostModifier to the ProjectInfos.xml).

Just enabling it at all was a lot harder than I expected. Anyway, now I want to disable it again for the civilizations that don't own a building with the bHurryProjects set to 1. After studying the SDK for a long time, I just can't figure out how to do it.
I know how to add the bHurryProjects tag to the BuildingInfos.xml, but I don't know how to use it properly to disable Project Hurrying for civs that don't own such a building. Any tips?

Or maybe someone knows a SDK mod that adds a global boolean to the BuildingInfos.xml?
 
1) Loop through whole building list
2) Add those buildings that can hurry projects into a list
3) Set bHurryProjects as False
4) Loop through the new list
5) If Player/Team (depends which you want) has Building X and Building X not Obsolete, set bHurryProjects as True and break the loop
6) If Producing project and not bHurryProjects
Return False

How to translate that into SDK is up to you :D
 
Thanks for the help Magister, but now I can't edit the XML file using notepad/wordpad. (Running Windows Vista as Administrator)

Notepad ++ is much, much better than Notepad or Wordpad. To get rid of settlers you could just delete the settler unit and then remove any references to that unit in EventInfos, HandicapInfos/GoodyInfos, etc.
 
Deleting the settler unit from CIV4UnitInfos.xml would cause the not insignificant issue of being unable to found your first city except in Advanced Start games.


If you want to limit the number of cities, rather than merely settlers, then it would be better to edit Assets/XML/PythonCallbackDefines.xml to change USE_CANNOT_FOUND_CITY_CALLBACK from 0 to 1 and then Edit Assets/Python/CvGameUtils.py by adding some code like this under def cannotFouncCity(self,argsList):
Code:
	def cannotFoundCity(self,argsList):
		iPlayer, iPlotX, iPlotY = argsList


		pPlayer = gc.getPlayer(iPlayer)
		if pPlayer.getNumCities() > 0:
			return True

		return False

Notepad++ is certainly better than Notepad or Wordpad for editing XML.

If you wish to edit Python files though, it may be better to use something like PyScripter so that you can use its debugger.


It is of course not a great idea to modify the original Civ VI or BtS files. It is better to edit copies of those files placed in a new folder in the Mods folder. You only need to include the files that you mod changes, within the proper file structure. Mods refer back to the main game for any unaltered file, which is one reason why you usually would not want to modify the originals (as those changes would apply not only to the normal game but also to many mods).

You could make copies of the files you want, edit them while they are not in a protected folder, and then move them to the mods folder. That should let you get around the security settings that stop you from editing the files.
 
1) Loop through whole building list
2) Add those buildings that can hurry projects into a list
3) Set bHurryProjects as False
4) Loop through the new list
5) If Player/Team (depends which you want) has Building X and Building X not Obsolete, set bHurryProjects as True and break the loop
6) If Producing project and not bHurryProjects
Return False

How to translate that into SDK is up to you :D

Despite the tip I have noticed that I am not able to make the boolean global. In fact there is no global boolean in the Buildings section. But it is totally functional now in every city with a building with bHurryProjects>1<. I then realized that if I wanted that effect globally, I could also just give a bulding a free building in every city that would make sense with the said building, and the free building would do nothing except for allowing the rushing of projects. Anyway, thanks, I did what I wanted to do!
 
Deleting the settler unit from CIV4UnitInfos.xml would cause the not insignificant issue of being unable to found your first city except in Advanced Start games.

Ah whoops. The mod I'm making is based around advanced starts so I don't normally worry about this problem...but I can see how that would cause problems.

Would it work to make the settler a national unit in unitclassinfos, and make only one possible? then the person would get one at the beginning but not be able to build any more, right? Handicap/Goody infos would still have to be edited, though.
 
Nope. Just think of missionaries.
Those are national units.
National limit only means you can only have X of them at 1 time.
But if they die or are used up, you can build more
 
I believe that you could make them a National Unit, with a limit of 0.

You could make Settlers a World Unit. Those limits apply the whole game. You cannot get more just because they die.

I don't think that either of these would interfere with getting your starting settler. I doubt it would make any difference when it comes to getting the units from tribal villages, events, etc., either though.
 
Could someone please separate the Platy´s trackers separately ? The whole UI I could not merge . Trackers are amazing and I would very much like to have in mod . The first tracker worked fine . I think trackers could work all . Other things to me about fighting with something . I have more python in my mod but I´m not programmer. Merging is hard for me :(
 
Hello there, I wonder if someone made mod that allows victory-specific wonders, like UN or Apostilic Palace, without specific victory type active. For example allowing UN resolutions, but without Diplomatic Victory possible, or build spaceship for the kick of it, not instant win.
 
I don't think there are any mods like that already, but it wouldn't be too hard to make
Just some tricky XML I think.
 
Top Bottom