Mod Component Requests Thread

I'd like to request some small changes in the DLL that would allow buildings to improve certain terrains. For example, by defining so in the XML, an Igloo would give +1 food from Snow tiles.
I know this is possible in python, but my request is if someone could do that for me in C++ :)
 
So I've miserably failed combing two mods that in my opinion significantly improve warfare experience. Ranged bombardment for artillery and route bombing. I would love it if someone were to either combine these mods or come up with a vastly different mod that combines these features and improves them

http://forums.civfanatics.com/downloads.php?do=file&id=14884

http://forums.civfanatics.com/downloads.php?do=file&id=13807

Here you go: http://forums.civfanatics.com/showthread.php?t=440557
 
Does anybody know how to use this and make a useful mod out of it? For example, a science fiction mod with multiple planets, doing combat on a smaller map instead of resolving it in the big map, etc. I'm totally lost when it comes to SDK.
 
Could someone tweak the BuildInfos code so that you could choose for that build to place a Resource instead of an Improvement or Route? This would be much appreciated! :)
 
Hi again. I've had an idea. I'd like to try to make a mod where there are no cities/armies/huge, grand strategic things; I'd like to make one where you have individual buildings as improvements, but still have the same technology upgrading and etc. In order to do that I'd need something like thisthis, possibly, except expanded to include population and improvements that can work tiles. Does anyone know if this is possible, and could anyone do it for me?:)
 
I would like a mod where every leader has a unique unit instead of the civ. So England would have no UU but Victoria could have the Redcoat, Churchill Commonwealth infantry, and so on. I'm sure I found something like this before, but couldn't find it. Could someone either make this or if it already exists give me the link? Thanks/
 
Me again! I have seen that some mods (the genetic mod specifically) had worked out a way to found cities in the water. Unfortunately the coding for this was done back before BTS and most of those mods are gone now anyway. Would anyone happen to have a BTS version of the coding required for this?
 
1) Activate USE_CAN_FOUND_CITIES_ON_WATER_CALLBACK in PythonCallbackDefines
2) Change def canFoundCitiesOnWater(self,argsList): to return True in CvGameUtils

Done
 
1) Activate USE_CAN_FOUND_CITIES_ON_WATER_CALLBACK in PythonCallbackDefines
2) Change def canFoundCitiesOnWater(self,argsList): to return True in CvGameUtils

Done

Thanks! That has done the trick.

However, these cities cannot seem to be able to build anything (also, buildings do not appear in them). Is their anyway to fix this? Also, how can I get units to walk on routes placed in the water?
 
I don't see an issue...
I can even complete a Wonder in a water city...
 

Attachments

  • Civ4ScreenShot0003.JPG
    Civ4ScreenShot0003.JPG
    112.7 KB · Views: 77
I don't see an issue...
I can even complete a Wonder in a water city...

When I started reading the whole discussion about water cities, I immediately started trying to do it myself because it would be a great ability for a Unique Naval Unit to be able to settle on coastal waters.

I am familiar with your skills and that's why I kindly ask you for help. I don't need much help, everything is working out, except for one thing. I want the coastal water plot to convert to a land plot when I settle on it with the unit in particular.

Converting the water plot to a land plot would fix many issues (maybe even the issue of not being able to build builidings in one case).

Anyway, I can almost 'release' this modcomp for the person in need, I just need your help with this code.

Code:
	def onCityBuilt(self, argsList):
		'City Built'
		city = argsList[0]

		tt_coast = gc.getInfoTypeForString( 'TERRAIN_COAST' )
		
		for i in range(21):
			pPlot = city.getCityIndexPlot(i)
			if ( pPlot.isCity()==true ):
				if ( pPlot.getTerrainType()==tt_coast ):
	                        	pPlot.setPlotType(PlotTypes.PLOT_LAND, True, True)

This causes a CTD. If I test this code by for example replace the last line with 'city.changePopulation(1)', it works: only cities found on coastal waters start with 2 population. But this code just makes the game crash when I want it to set a land plot.
 
If you change the plot type, normally everything on that plot gets destroyed, at least for the change water/land. And self destruction of cities causes a CtD (one of the rare cases where Python can cause a CtD).

Okay, thanks for the info!
This means the plot has to change before the city is built.

Hmm, how do I run a code at the moment I press the 'found city' button?
If that is even the right way to change the plot before the city is built.
 
I once tried making a reclamation modcomp before, but gave up due to the A.I. involved.
I remembered there were ctds too but I believe that was because the sea unit is still there when it transformed into land before the sea unit is destroyed.
Which sounds similar here since you are using a sea unit to settle.

I made a zuiderzee works project before which transforms some coast to land.
It works because all the sea units are pushed away before the tile is converted.

Anyway, just use city.plot()...
Don't bother to loop so much just to get the city plot
 
I've noticed in the past (from a spell I tried to add in a modmod of FfH2) that using python to change a water tile to a land tile while there is a unit on said tile causes a crash. I'm afraid I never really found a way to fix this.

That may well be your problem, as the onCityBuilt code runs before the settler unit is killed.
 
Cleaned up my code according to your suggestion, Platy.

I will check what happens if I settle with a land unit and convert the sea to land.
You'll hear more from me once I am closer to a solution.
 
So long as there is something there, it should crash

I tested before I read this, and it is of course true.
With a Land Domain unit it crashes as well.

I wonder what crashes it though: raising the city, or the unit. Probably both. It'd mean it'd probably also crash if a Fish-bonus would be raised.

Do you have any idea how I could code this:

At the moment the 'found city' button is pressed:
1. All units get pushed away
EDIT: This also means the settling unit should be destroyed.
2. All improvements get removed
3. All bonuses get removed (or pushed away but removed seems the best to me)

Then the plot should be lifted from Coast to Land Plot.

Then the city should be built.
 
Once the found button is pressed, the city is built already.
 
Back
Top Bottom