Simple Python Things

For the hill builder thing you have done (to lazy to look up name since im already typing) pioneer tank, could you also have it so it can turn land into ocean? Sort of like an artificial bay sort of thing

Also could it do a reverse of what it does now? Remove the hill

EDIT: also I could probably observe wether or not it works, just create a completely flat map, place an ai, give them a bunch of the pioneer tanks, AI autoplay for a bunch of turns and see if its used
 
For the hill builder thing you have done (to lazy to look up name since im already typing) pioneer tank, could you also have it so it can turn land into ocean? Sort of like an artificial bay sort of thing

I think I tested that, and it will destroy every unit on the transformed plot -> not a good idea.

Also could it do a reverse of what it does now? Remove the hill

Easy stuff, you can also do that yourself, since it only requires changing one variable in the Python file. The rest is XML.

EDIT: also I could probably observe wether or not it works, just create a completely flat map, place an ai, give them a bunch of the pioneer tanks, AI autoplay for a bunch of turns and see if its used

If the stats for the fake improvement are okay, then the AI will also use it, but it's not really aware of it...which can be a pretty mess.
 
surely you could teleport the units on the tile off onto an adjectent tile before turning into ocean? or am I wrong?
 
I didn't bother to check nearest land. I just dumped all to first coastal city since mine was converting water to land, so it is more of dumping naval units.

For land to water, again safest way out is first coastal city, because there is a chance that the land plot is a fort. Which means there can be naval and air units on the plot. If you dump naval units to a land plot, you will definitely get an error.
 
changing terrain is pretty easy, but the main thing is does the AI know when n where to use it?
Mine was world projects so I didnt care about that, but if yours is worker actions, AI is definitely needed
 
AI is not as needed though i beleive. you said it yourself when we were talking about a project that changed land into water, water is not as valuable as land. The only real reason you would use it is to stretch the ocean to a city, but even that its not always better.

Overall not to important since it doesnt really give the player a huge advantage
 
Not true.
If you keep changing water to land, you end up turning a coastal city into a non coastal city.
Coastal city obviously has more benefits than non coastal city, like ability to build naval buildings and units.

Since for my project, I made sure the city remains coastal after the python effects, that is not an issue.

But if yours is a worker action with no restrictions, AI may just use it randomly or never at all.
Also, you may end up reclaiming all across 2 continents making naval units totally useless.

Thus, without restrictions and AI considerations, it is a bad idea
 
Is importatn what you want from
I use land/water and water/land change from GrenMod by MasterLexx. Works it fine :)
In this system you can make change in city FC and in xml you can set turn number :)
 
Hi, I have a in my old burned computer somewhere in the old apartment, but here is the code that I wrote and which I use in HrochMod.
Spoiler :
PHP:
############################LAND_WATER/WATER_LAND###########################
                iWaterland1 = gc.getInfoTypeForString('IMPROVEMENT_WATERLAND1')
                iWaterland2 = gc.getInfoTypeForString('IMPROVEMENT_WATERLAND2')
                #GreenMod: get city for terraform checks
                if (iImprovement==iWaterland1 or iImprovement==iWaterland2):
                        bCityCheck = 0
                        for x in [-2,-1,0,1,2]:
                                for y in [-2,-1,0,1,2]:
                                        if CyMap().plot(iX +x, iY +y).isCity() == 1:
                                                iCityX = iX +x
                                                iCityY = iY +y
                                                pCity = CyMap().plot(iX +x, iY +y).getPlotCity()
                                                bCityCheck = 1

                #GreenMod: water and land switching, PART1
                if iImprovement==iWaterland1:
                        #if built on water (coast), for later upgrade to land
                        if pPlot.getTerrainType() == 5:
                                #not city near, so delete it
                                if not bCityCheck == 1:
                                        pPlot.setImprovementType(-1)
                        else:
                        #if on land and has just been upgraded to, make to water
                                pPlot.setImprovementType(-1)
                                pPlot.setTerrainType(5, 1, 1)

                #GreenMod: now the other direction, terraform, PART2
                if iImprovement==iWaterland2:
                        #if built on land (any), for later upgrade to water
                        if not pPlot.getTerrainType() == 5:
                                #not city near, so delete it
                                if not bCityCheck == 1:
                                        pPlot.setImprovementType(-1)
                        else:
                        #if on water and has just been upgraded to, make to land
                                pPlot.setImprovementType(-1)
                                #city terrain will be terrain of new land
                                iNewTerrain = 2
                                iNewTerrain = CyMap().plot(iCityX, iCityY).getTerrainType()
                                pPlot.setTerrainType(iNewTerrain, 1, 1)
                                #ocean next to new land? becomes coast now
                                for x in [-1,0,1]:
                                        for y in [-1,0,1]:
                                                if CyMap().plot(iX +x, iY +y).getTerrainType() == 6:
                                                        CyMap().plot(iX +x, iY +y).setTerrainType(5, 1, 1)

                #GreenMod: recalculate city graphics after terraform, PART3
                if (iImprovement==iWaterland1 or iImprovement==iWaterland2):
                        #reset or remove harbor and drydock if no coast near
                        iHarbor = gc.getCivilizationInfo(pCity.getCivilizationType()).getCivilizationBuildings(gc.getInfoTypeForString("BUILDINGCLASS_HARBOR"))
                        iLighthouse = gc.getCivilizationInfo(pCity.getCivilizationType()).getCivilizationBuildings(gc.getInfoTypeForString("BUILDINGCLASS_LIGHTHOUSE"))
                        iDrydock = gc.getCivilizationInfo(pCity.getCivilizationType()).getCivilizationBuildings(gc.getInfoTypeForString("BUILDINGCLASS_DRYDOCK"))
                        iCustomHouse = gc.getCivilizationInfo(pCity.getCivilizationType()).getCivilizationBuildings(gc.getInfoTypeForString("BUILDINGCLASS_CUSTOM_HOUSE"))
                        if pCity.isCoastal(10):
                                if pCity.isHasBuilding(iHarbor):                                     
                                        pCity.setNumRealBuilding(iHarbor, 0)
                                        pCity.setNumRealBuilding(iHarbor, 1)
                                else:
                                        pCity.setNumRealBuilding(iHarbor, 1)
                                        pCity.setNumRealBuilding(iHarbor, 0)
                                        
                                if pCity.isHasBuilding(iLighthouse):
                                        pCity.setNumRealBuilding(iLighthouse, 0)
                                        pCity.setNumRealBuilding(iLighthouse, 1)
                                else:
                                        pCity.setNumRealBuilding(iLighthouse, 1)
                                        pCity.setNumRealBuilding(iLighthouse, 0)
                                        
                                if pCity.isHasBuilding(iDrydock):
                                        pCity.setNumRealBuilding(iDrydock, 0)
                                        pCity.setNumRealBuilding(iDrydock, 1)
                                else:
                                        pCity.setNumRealBuilding(iDrydock, 1)
                                        pCity.setNumRealBuilding(iDrydock, 0)

                                if pCity.isHasBuilding(iCustomHouse):
                                        pCity.setNumRealBuilding(iCustomHouse, 0)
                                        pCity.setNumRealBuilding(iCustomHouse, 1)
                                else:
                                        pCity.setNumRealBuilding(iCustomHouse, 1)
                                        pCity.setNumRealBuilding(iCustomHouse, 0)
                                        
                        else:
                                pCity.setNumRealBuilding(iHarbor, 0)
                                pCity.setNumRealBuilding(iLighthouse, 0)
                                pCity.setNumRealBuilding(iDrydock, 0)
                                pCity.setNumRealBuilding(iCustomHouse, 0)

                #gmend

##################################HRADY_START##################################
 
Oh I assumed I was going to try it with the water thing as well. That way i only have to do it once (if they only do hills + not water, then I know what AI can do), I was waiting on that, so if you want to merge what hrochland gave you I can do it.

Also I would suggest adding the thing were it removes hill and creates fatland, because possibly (doubt it but posisble) AI wants flatland instead, so maybe they recognize the hills, just dont want them
 
Do you want xml what have Master Lexx for Land/water water/land ?
models what he use for terraforming time are in basic civ4 - in improvementinfos are Waterland1 and waterland2
 
Back
Top Bottom