1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Space Colonization modmod

Discussion in 'C2C mod mods' started by pepper2000, Jan 22, 2016.

  1. Faustmouse

    Faustmouse Deity

    Joined:
    Jan 31, 2012
    Messages:
    3,523
    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.
     
  2. pepper2000

    pepper2000 King

    Joined:
    Apr 14, 2013
    Messages:
    899
    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.
     
  3. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    28,550
    Gender:
    Male
    Location:
    Las Vegas
    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.
     
  4. pepper2000

    pepper2000 King

    Joined:
    Apr 14, 2013
    Messages:
    899
    T-bird: that works too, but strikes me as clunkier. Ultimately,

    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.
     
  5. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    28,550
    Gender:
    Male
    Location:
    Las Vegas
    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.
     
  6. pepper2000

    pepper2000 King

    Joined:
    Apr 14, 2013
    Messages:
    899
    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.
     
  7. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,549
    Gender:
    Male
    Location:
    Canberra, Australia
    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.
     
  8. pepper2000

    pepper2000 King

    Joined:
    Apr 14, 2013
    Messages:
    899
    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.
     
  9. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,549
    Gender:
    Male
    Location:
    Canberra, Australia
    Does that actually work!:scan::clap::wow: If it does great.

    Normally it goes in the CvRandomEventInterface.py which is a pain.
     
  10. pepper2000

    pepper2000 King

    Joined:
    Apr 14, 2013
    Messages:
    899
  11. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    28,550
    Gender:
    Male
    Location:
    Las Vegas
  12. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,549
    Gender:
    Male
    Location:
    Canberra, Australia
    I have just discovered that Actions are not cumulative across modules, unlike other lists, which is why captives were not upgrading to other units.
     
  13. pepper2000

    pepper2000 King

    Joined:
    Apr 14, 2013
    Messages:
    899
    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.
     
  14. Faustmouse

    Faustmouse Deity

    Joined:
    Jan 31, 2012
    Messages:
    3,523
    Thats really awesome! :eek:
    Looking forward for it!
     
  15. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    28,550
    Gender:
    Male
    Location:
    Las Vegas
    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.
     
  16. Sussudio

    Sussudio Chieftain

    Joined:
    May 24, 2016
    Messages:
    28
    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!
     
  17. pepper2000

    pepper2000 King

    Joined:
    Apr 14, 2013
    Messages:
    899
    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.
     
  18. Sussudio

    Sussudio Chieftain

    Joined:
    May 24, 2016
    Messages:
    28
    No, where i download this mod? Thanks.
     
  19. Sussudio

    Sussudio Chieftain

    Joined:
    May 24, 2016
    Messages:
    28

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

    pepper2000 King

    Joined:
    Apr 14, 2013
    Messages:
    899
    Good, but I still want to know why it didn't work originally, since it should have. Has anyone else had this issue?
     

Share This Page