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

Tsentom1 Python Civics

Discussion in 'Civ4 - Mod Components' started by tsentom1, Nov 1, 2008.

  1. tsentom1

    tsentom1 Bubble Dragon

    Joined:
    Jul 24, 2007
    Messages:
    1,000
    Location:
    New York
  2. Scaramanga

    Scaramanga Brickhead

    Joined:
    Nov 16, 2006
    Messages:
    1,993
    Location:
    Canada
    Respectfully, I find most new civics redundant. What does Suzerainty have that's unique from Bureaucracy? They're almost the same in concept and implementation here (allows you consolidate wealth and raw materials in a centralized location); by the description of suzerainty is seems logical that a bureaucracy would have to be in effect for it to work anyways. Representation covers a number of possible government types including republicism and, in my view, your Parliamentary civic.

    Regards,
     
  3. tsentom1

    tsentom1 Bubble Dragon

    Joined:
    Jul 24, 2007
    Messages:
    1,000
    Location:
    New York
    Well, Suzerainty is -20% wonder cost in all cities and Bureaucracy is +50% production only in the capital. So, no functionally they're completely different, one encourages building up a central city while the other building wonders in multiple cities.

    Additionally, saying those two are the same civic types in the real world is wrong as a suzerainty is completely different than a bureaucracy. if anything it has more akin to vassalage, though historically both were enacted differently hence the different classifications.

    Parliamentary could be argued to be covered under the general term of Representation, though it stands to reason releasing additional civics here is not just for people modding the standard game but also for mods who have edited the civics quite extensively and thus might not have a general 'representation.'

    Regardless, the point of these (and any of my python+xml modcomps) is not necessarily how I structured the bonus - calling it parliamentary or suzerainty - but the python itself which people could then copy and adapt to any civic they want.

    Despite what you said, the bonus of suzerainty encourages almost the exact opposite building plan than bureaucracy - again ones bonus applying to all cities the other only to the capital. Additionally, dismissing the parliamentary simple because I called it that is foolish because it's bonus is not currently found in the default civics (it acts as an antithesis to police state which increases military production whereas this increases noncombatant production).

    Besides, look at the standard civics in the game. Universal Suffrage isn't exactly mutually exclusive to the other government civics (yet it is presented as such). Free Speech really isn't a complete legal system, yet it is its own civic.
     
  4. tsentom1

    tsentom1 Bubble Dragon

    Joined:
    Jul 24, 2007
    Messages:
    1,000
    Location:
    New York
    I changed the bonus of Suzerainty in my most recent patch of Thomas' War, here's the new version for people interested.

    NOTE: My previous Suzerainty civic has been renamed Hegemony and the text files have been updated.

    Suzerainty Civic



    Hegemony Civic

     
  5. OzzyKP

    OzzyKP Chieftain

    Joined:
    Dec 16, 2000
    Messages:
    1,622
    Location:
    Washington, DC USA
    Cool stuff. Do you know how to increase war weariness more than 100%? Or give more than one unhappy to civs without a particular civic? Like with emancipation, but with two or three unhappy per city.
     
  6. tsentom1

    tsentom1 Bubble Dragon

    Joined:
    Jul 24, 2007
    Messages:
    1,000
    Location:
    New York
    Do you mean - war weariness (as in the jail, police state, etc) or + enemy war weariness (as in the statue of zeus). If it's minus, once it reaces -100 you simply suffer no war weariness at all. If it's plus, i'm not sure you can do that with civics without editing the SDK or cheating (by say creating a fake building and having that given to your capital and removed when you switch into and out of the civic).

    This tag in the XML controls the emancipation unhappy:

    Code:
    			<iCivicPercentAnger>400</iCivicPercentAnger>
    If you make the number higher it will be more unhappiness for other civs.
     
  7. Cybah

    Cybah Chieftain

    Joined:
    Jun 22, 2007
    Messages:
    1,480
    Is it possible to script that you cannot declare war on anybody while your civic is pacifism?
     
  8. tsentom1

    tsentom1 Bubble Dragon

    Joined:
    Jul 24, 2007
    Messages:
    1,000
    Location:
    New York
    Yes, and it's actually really easy as the GameUtils file has def canDeclareWar. I used it in my Tesla's 'Peace' Ray wonder.

    For a civic it should look something like this:

    Code:
    	def canDeclareWar(self,argsList):
    		iAttackingTeam, iDefendingTeam = argsList
    
    ## Tesla Start ##
    
    		pPlayer = gc.getPlayer(iAttackingTeam)
    
    		iReligionCivicOption = CvUtil.findInfoTypeNum(gc.getCivicOptionInfo,gc.getNumCivicOptionInfos(),'CIVICOPTION_RELIGION')
    		iPacifism = CvUtil.findInfoTypeNum(gc.getCivicInfo,gc.getNumCivicInfos(),'CIVIC_PACIFISM')
    		iReligionCivic = pPlayer.getCivics(iReligionCivicOption)
    
    		if (iLegalCivic == iPacifism):
    
    			return False
    
    
    ## Tesla End ##
    
    		return True
    
    def canDeclareWar is in the GameUtils file. You'd also need to activate the function in the Python Callbacks XML file.

    That's all just off the top of my head so you may need to tweak it a bit to get it working.
     
  9. Cybah

    Cybah Chieftain

    Joined:
    Jun 22, 2007
    Messages:
    1,480
    thanks so far, but I don't understand:

    edit: this function is provided by your tesla files?

    edit2: nevermind. got it. thanks. :)
     
  10. Cybah

    Cybah Chieftain

    Joined:
    Jun 22, 2007
    Messages:
    1,480
    Is it also possible to script: "You cannot switch to pacifism while at war" ?
     
  11. ZB2

    ZB2 New wave Ideology

    Joined:
    Aug 1, 2006
    Messages:
    678
    Location:
    Europe
    I'm trying to tweak a civic so that one of them grants a modifier to the Barracks building to increase the XP it gives units... Any idea how that can be done?
     
  12. tsentom1

    tsentom1 Bubble Dragon

    Joined:
    Jul 24, 2007
    Messages:
    1,000
    Location:
    New York
    You need to use OnUnitBuilt in the EventManager. Have it check if you have the civic (the same way I have to code check for the civic in the modcomps here). Then have it check if the city has a barracks and if so award experience using something like:

    unit.changeExperience(1, -1, False, False, False)

    with that first 1 (in bold) the amount of extra experience you want to give.
     
  13. Cybah

    Cybah Chieftain

    Joined:
    Jun 22, 2007
    Messages:
    1,480
    is it possible to make a civic which reduces the costs of special buildings (monasteries or others)?
     

Share This Page