Space Colonization modmod

Probably a very primitive way but how about having space explorer units that can't settle but instead have a mission that will consume them and place an immovable settler on this tile. The settler could then only settle on this specific tile; while the mission can be availabe only on certain terrains (I think?). And more missions can show up as the tech progresses that allow to settle solar tiles at the time you want.
 
Probably a very primitive way but how about having space explorer units that can't settle but instead have a mission that will consume them and place an immovable settler on this tile. The settler could then only settle on this specific tile; while the mission can be availabe only on certain terrains (I think?). And more missions can show up as the tech progresses that allow to settle solar tiles at the time you want.

That just might work. You already have something like that that with the Construction Ship and Lunar Bulldozer. I'll give it a try. It means an extra turn to build a city, but that's an acceptable tradeoff.
 
Another way would be to start with all off-earth terrains not allowing settling as DH explained. Then give a mission to a settler unit that changes the terrain to a carbon copy with the exception that it can be settled on.

Only problem then would be the AI working with it.

So in thinking outside the code that's probably the closest I can come up with.

Of course, with a little more tag work I can make a tag that specifies at which technologies a mapcategorytype can be settled on - that way spawning barb cities won't spawn until they can by means of tech. But then again, maybe a tag on MapCategoryInfos.xml that enables general barb city spawning on that category type terrain and then one on units to indicate the MapCategoryType(s) they can found on.
 
T-bird: that works too, but strikes me as clunkier. Ultimately,

one on units to indicate the MapCategoryType(s) they can found on

would be the best solution. If I keep modding for a while, eventually I will want to figure out how to do that kind of thing.
 
That alone would not solve the barbarian city spawn problem though because they don't spawn settlers to get cities, they directly spawn cities.

And it is a code fix rather than anything that can be done outside of code. Even the first suggestion requires some python.
 
I discovered AIAndy's implementation of python for mission outcomes, and that solved the problem. Now the Planetary Settler can upgrade into a Planetary Settler (landed) (I'll try to think of more creative names) only on the proper terrains.

Python straight from the UnitInfo file. What will they think of next?

And actually, this is the first time I have done any python with Civ 4. My imagination is now full of possibilities.
 
The only problem with this is that all the python is in the one file and we need to be very careful when updating the SVN that we don't overwrite each others code. It may be possible to semi-modularise it but it will still require care and coordination between modders.
 
DH: I'm a bit confused. The only python code I included is in the Pepper2000_Civ4UnitInfos.xml file in the modmod. Here's the relevant action for the Planetary Settler.

Spoiler :
Code:
        <Actions>
				<Action>
					<MissionType>MISSION_PLANET_LAND</MissionType>
					<iCost>
						<Adapt>
							<ID>ADAPT_DEFAULT</ID>
							<Constant>0</Constant>
						</Adapt>
					</iCost>
					<ActionOutcomes>
						<Outcome>
							<OutcomeType>OUTCOME_UPGRADE_TO_PLANET_SETTLER</OutcomeType>
							<iChance>100</iChance>
							<UnitType>UNIT_PLANETSETTLER</UnitType>
                            <PythonName>PythonTest</PythonName>
                            <Python>
                                def isPossible(unit,plot):
                                    from CvPythonExtensions import CyGlobalContext
                                    gc = CyGlobalContext()
                                    return str(plot.getTerrainType()) == str(gc.getInfoTypeForString('TERRAIN_JUPITER'))
                                def doOutcome(unit,plot,eDefPlayer, eDefUnitType):
                                    return
                                def getDisplay(unit,plot):
                                    from CvPythonExtensions import CyGlobalContext
                                    gc = CyGlobalContext()
                                    return u"Land on the Planet"
                                def getAIValue(unit, plot):
                                    return 1
                            </Python>
						</Outcome>
					</ActionOutcomes>
				</Action>
(Sorry for the wonky formatting)

I'm not doing anything in Assets/Python, or anywhere else outside of this file, so I'm not sure I see where the risk is. But if there is a problem, I'll look for other solutions.
 
I have just discovered that Actions are not cumulative across modules, unlike other lists, which is why captives were not upgrading to other units.
 
Say TB, if I have a CyPlot object in python, is there a simple snippet of code that will tell me its map category? It's not essential for what I am trying to do now, but it would help. And I want to get better at working with python.

DH: that's great. I had thought captive upgrading was taken out on purpose.

In other news, I figured out how to found cities in python. So there's no need for an intermediate planetary landing phase. Planetary settlers will function just like spacecraft settlers, except for restrictions on where they can found (and a few cosmetic differences). It's starting to feel like we're close to an actual, playable space map.
 
Say TB, if I have a CyPlot object in python, is there a simple snippet of code that will tell me its map category? It's not essential for what I am trying to do now, but it would help. And I want to get better at working with python.

DH: that's great. I had thought captive upgrading was taken out on purpose.

In other news, I figured out how to found cities in python. So there's no need for an intermediate planetary landing phase. Planetary settlers will function just like spacecraft settlers, except for restrictions on where they can found (and a few cosmetic differences). It's starting to feel like we're close to an actual, playable space map.

I don't think that MapCategoryTypes has been exposed to python but if it was it's still a data format that I don't know where or if we do have any examples of how it would be pulled up in python but you might be able to figure it out. It's a vector is the thing.
 
Hi, I've the problem with this mod. When I try load C2C appared this message:

Tag: BUILDINGCLASS_LUNAR_BASE in Info class was incorrect Current XML file is:
modules/My_Mods/Pepper2000/Pepper2000_CIV4BuildingInfos.xml

This message repeats with other lunar buildings, please healp me!
 
Hi, I've the problem with this mod. When I try load C2C appared this message:

Tag: BUILDINGCLASS_LUNAR_BASE in Info class was incorrect Current XML file is:
modules/My_Mods/Pepper2000/Pepper2000_CIV4BuildingInfos.xml

This message repeats with other lunar buildings, please healp me!

That's a new one on me. LUNAR_BASE is Faustmouse's building, not mine, but I make reference to it. Did you unload the Lunar Colonization mod? If so, it needs to be included also.
 
That's a new one on me. LUNAR_BASE is Faustmouse's building, not mine, but I make reference to it. Did you unload the Lunar Colonization mod? If so, it needs to be included also.


I think I've fixed it, I put Faustmouse's folder in My_Mods and the error doesn't appear.
 
I think I've fixed it, I put Faustmouse's folder in My_Mods and the error doesn't appear.

Good, but I still want to know why it didn't work originally, since it should have. Has anyone else had this issue?
 
Top Bottom