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

Quick Modding Questions Thread

Discussion in 'Civ4 - Creation & Customization' started by kiwitt, Jan 27, 2010.

  1. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,708
    Location:
    UK
    hmmm.. that seems reasonable, but looking at fury road mod, it uses public maps and gets the desired effect. (only it's four map scripts show up)
     
  2. Angry Bird

    Angry Bird Chieftain

    Joined:
    Mar 23, 2015
    Messages:
    14
    How to make religions to disappear in python?
     
  3. ProjectMaximus

    ProjectMaximus Chieftain

    Joined:
    Aug 7, 2014
    Messages:
    21
    Hi everyone, I would like to fix this small issue (you can see on attached pic.) in Beyond The Sword, Rise Of Mankind mode.

    On the scoreboard (right bottom) when I moving the mouse over the civilization name which I want to contact with , pop-up widget appears (left bottom) and shows both full and short names ('descriptions') of the civs.

    As doubling it looks little bit silly for me...

    How can I remove one of them?
    Actually how can I edit this widget? Where can I find the moddable file for this?

    I would appreciate for any help. :)

    Thanks
     

    Attached Files:

  4. isenchine

    isenchine Empress

    Joined:
    Oct 18, 2010
    Messages:
    1,774
    Location:
    Brussels, Belgium
    If I were you, first, I would have a look at Python\Screens\CvMainInterface.py. That's the file responsible for the display of the main screen + the city screen.

    But if you can't change it there, then it was changed in the dll (probably by the mod itself).

    PS: I don't have the mod so it's up to you.
     
  5. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,539
    Gender:
    Male
    Location:
    Canberra, Australia
    I would look at Platyping's Inquisition mod for the actual python code to remove a religion from a city.
     
  6. clanky4

    clanky4 Emperor

    Joined:
    Jul 11, 2012
    Messages:
    1,262
    Location:
    USA
    Nobody expects the Playping's Inquisition modcomp.
     
  7. Angry Bird

    Angry Bird Chieftain

    Joined:
    Mar 23, 2015
    Messages:
    14
    Why corporation symbols without "star" in citybar are not visible?
     
  8. Angry Bird

    Angry Bird Chieftain

    Joined:
    Mar 23, 2015
    Messages:
    14
    Thx, but I've found another way :)
     
  9. Merkava120

    Merkava120 Oberleutnant

    Joined:
    Feb 2, 2013
    Messages:
    387
    Gender:
    Male
    Location:
    Socially distant
    Could anyone tell me how to give cities to a certain civilization through python? I want to spawn the Byzantines (using Spawn a Civ) and then give a bunch of the Roman cities to them.
     
  10. Angry Bird

    Angry Bird Chieftain

    Joined:
    Mar 23, 2015
    Messages:
    14
    How to make foreign borders to change where units spawn in the certain plot or set borders without city?
     
  11. Herostratus

    Herostratus Grim Harbinger of Things to Come

    Joined:
    Jul 24, 2009
    Messages:
    116
    I want to adjust Platy's Pantheon wonder to apply the extra happiness only to the city in which it's built.

    I think one or both of these are the relevant sections of the python code; anybody know how to limit it to the city the Pantheon is in?
    Code:
    	def onTechAcquired(self, argsList):
    		'Tech Acquired'
    		iTechType, iTeam, iPlayer, bAnnounce = argsList
    		# Note that iPlayer may be NULL (-1) and not a refer to a player object
    ## The Pantheon Start ##
    		if iTechType == gc.getBuildingInfo(gc.getInfoTypeForString("BUILDING_PANTHEON")).getObsoleteTech():
    			pTeam = gc.getTeam(iTeam)
    			if pTeam.getBuildingClassCount(gc.getInfoTypeForString("BUILDINGCLASS_PANTHEON")) == 1:
    				for iPlayerX in range(gc.getMAX_CIV_PLAYERS()):
    					pPlayerX = gc.getPlayer(iPlayerX)
    					if pPlayerX.getBuildingClassCount(gc.getInfoTypeForString("BUILDINGCLASS_PANTHEON")) == 1:
    						(loopCity, iter) = pPlayerX.firstCity(false)
    						while(loopCity):
    							for iReligion in range(gc.getNumReligionInfos()):
    								if loopCity.isHasReligion(iReligion):
    									loopCity.changeExtraHappiness(-1)
    							(loopCity, iter) = pPlayerX.nextCity(iter, false)
    						break
    ## The Pantheon End ##
    Code:
    	def onReligionSpread(self, argsList):
    		'Religion Has Spread to a City'
    		iReligion, iOwner, pSpreadCity = argsList
    		player = PyPlayer(iOwner)
    ## The Pantheon Start ##
    		pPlayer = gc.getPlayer(iOwner)
    		if pPlayer.getBuildingClassCount(gc.getInfoTypeForString("BUILDINGCLASS_PANTHEON")) == 1:
    			obsoleteTech = gc.getBuildingInfo(gc.getInfoTypeForString("BUILDING_PANTHEON")).getObsoleteTech()
    			pTeam = gc.getTeam(pPlayer.getTeam())
    			if pTeam.isHasTech(obsoleteTech) == false or obsoleteTech == -1:
    				pSpreadCity.changeExtraHappiness(1)
    ## The Pantheon End ##
     
  12. Angry Bird

    Angry Bird Chieftain

    Joined:
    Mar 23, 2015
    Messages:
    14
    Why does civilization die if autoplay has been triggered in "def onGameStart"?
    Code:
    	def onGameStart(self, argsList):
    		'Called at the start of the game'
    ##autoplay
    		if (con.pAssyria.isHuman() == 1):
    			CyGame().setAIAutoPlay(20)
     
  13. isenchine

    isenchine Empress

    Joined:
    Oct 18, 2010
    Messages:
    1,774
    Location:
    Brussels, Belgium
    None of them actually.

    onTechAcquired checks if the building has been obsoleted by the tech acquired to cancel its effects.

    onReligionSpread adds the effect each time a religion has spread to one of your cities.

    onBuildingBuilt is the place to start and the code to change in the first place.

    onTechAcquired, onReligionSpread and onCityAcquired should be changed then.

    onCityRazed would become useless then since the effect would be cancelled anyway.
     
  14. idols11

    idols11 Chieftain

    Joined:
    May 27, 2013
    Messages:
    3
    How hard is it to create a mod? I am asking because I have no programming experience other than in one year of school.

    I would like to alter gameplay but not graphics. How much work would it take and how much time spent learning the programming languages?
     
  15. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,708
    Location:
    UK
    There are 3 'levels' of code in civ modding.

    XML:
    This is where most of the basic changing happens for things like adding units, buildings, techs, civics, etc. and where you change their stats.

    This takes as long as it takes to read a few turtorials on doing specific things.

    Python:
    This lets you do more things and in differing levels of dificulty, this controls a lot of the HUD and screen interface stuff. Along with being able to do many other things. (look at some of the python based mods/mod components to see what people have been able to do (and sometimes not do) with python.

    SDK/C++(I think I can never remember if it is C+ or C++!):
    This is the source code of the game, and allows you to do the biggest and baddest things, and affect just about everything in the game. (Mods Like RoM:AND, C2C and the amazing Fallout: Tame The Waste :p Have custom Source Code.)

    As for how long it would take you to learn the code, that really depends on how long it takes you to learn coding languages. You could read a few tutorials and start playing around with some things fairly quickly, other things may take a whole lot longer to learn.

    It really depends on how big you want your changes to be, and whether or not there are mods/mod components to do what you want. So whether you would just mod mods, or whether you would be coding content from scratch.

    If all you want is to make new units, buildings, techs, etc. or change their existing stats, then all of that can be done in the XML and is no more difficult than word processing, once you had read a few tutorials or the modiki to see how it works and what things you need or want to change.
     
  16. idols11

    idols11 Chieftain

    Joined:
    May 27, 2013
    Messages:
    3
    Thanks Lib.SPi't

    One question, is it easier to mod civ 5 than civ 4?
     
  17. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,708
    Location:
    UK
    debatable, it is 'supposed' to be easier to mod civ 5, or at least they tried to approach it with modding in mind.

    I tried modding Civ 5 before and got just about no where with it. That could mean I am rubbish, or I approached Civ 4 when I had more energy, but I found Civ 4 to be more straight forward.

    I think part of it with Civ 5 is that it was more complicated to get started, I vaguely remember having a real headache trying to get the files and mod setup and ready to be fiddled with, where as Civ 4 you just make a folder in the mods and then copy the folder/file structure of the bits you want to change and it is game on.

    I think some of that comes from the auto-install, auto-find, steam workshop type stuff with Civ 5.

    Civ 5 also replaced python with LUA, which is supposed to be a less 'greedy' programming language, so you can do more and maintain performance.

    I think the big question is, how deep do you want your changes to be, and which game do you enjoy playing more.

    I actually prefer Civ 4. So if they were the same difficulty I would stick with 4.

    One thing would be to read a 'how to' tutorial for both civ 4 and 5 on adding a building, and then decide for yourself which sounds easier.

    In Civ 4 adding a building and adding a unit are more or less the same task, especially if you are not interested in graphics.

    With Civ 5 I don't know.
     
  18. idols11

    idols11 Chieftain

    Joined:
    May 27, 2013
    Messages:
    3
    Thanks I'll take a look at Civ 5 then.
     
  19. Angry Bird

    Angry Bird Chieftain

    Joined:
    Mar 23, 2015
    Messages:
    14
    How to set culture for plots without city?
     
  20. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,405
    Gender:
    Male
    Location:
    Leblanc
    That would be either CyPlot.setCulture(iPlayer, iNewValue) or CyPlot.changeCulture(iPlayer, iChange).

    Not sure how the Python API works here but you might need to add additional parameters that affect if cultural control and unit presences should be updated as well.

    Also, note that city culture and plot culture are two entirely independent values.
     

Share This Page