Mod Component Requests Thread

I recall there was a modcomp that generated Great General points per turn regardless of combat. Maybe it was a wonder effect? I want to use it as a civic effect. Does anyone know where to look?
 
i cant recall such a modcomp.
sounds like it should be an sdk thing, not sure if the python is exposed to the GP counters.
I'm 99% sure it was a python wonder effect.
I'll have to go through some mods wonders...
 
I have found it!

Python:
        if pPlayer.getBuildingClassCount(gc.getInfoTypeForString("BUILDINGCLASS_CYRUS_CYLINDER")) == 1:
            Power = pPlayer.getPower() + pTeam.getVassalPower()
            pPlayer.changeCombatExperience(min(10, Power/iGameTurn))

Now I just have to find out how to change it from a wonder effect into a civic effect and to generate 1 Great General point per city of player instead of an amount based on score.


EDIT:
Maybe this...
Python:
        if pPlayer.getBuildingClassCount(gc.getInfoTypeForString("CIVIC_WARLORDS")) == 1:
            pPlayer.changeCombatExperience(min(pPlayer.getNumCities())
 
Last edited:
Hi Nexus.
Your Civic is not a building, so 'buildingClass' is not going to be the right choice.

You will need to do this with 'hasCivicOption' (see Api below, its the 337th function listed of CyPlayer).
Careful you need to give an argument, i.e. basically you have to tell which civic 'column' it is into


If you do trials and you fail, reach to me again and I can look and do an example on one of my civics
 
I did this message (above) on my phone, and then had a doubt...
So I did the code for you, and figured "isCivic" is a better function. Not sure what Platyping wanted to do with the current power etc. but you can just put any value (I did with 6 in my test). Of course you'll need to put the Civic you want to use in there, not Barbarism


Code:
    def onBeginPlayerTurn(self, argsList):
        'Called at the beginning of a players turn'
        iGameTurn, iPlayer = argsList
    
        #2.41 for Nexus
        pPlayer = gc.getPlayer(iPlayer)       
        iTeam = pPlayer.getTeam()
        pTeam = gc.getTeam(iTeam)       
        
        iCivic = gc.getInfoTypeForString("CIVIC_BARBARISM")
        if gc.getPlayer(iPlayer).isCivic(iCivic):           
            Power = pPlayer.getPower() + pTeam.getVassalPower()
            if iGameTurn != 0 :
                #pPlayer.changeCombatExperience(min(10, Power/iGameTurn))
                pPlayer.changeCombatExperience(6)
 
Your Civic is not a building, so 'buildingClass' is not going to be the right choice.
Yeah, after shutting down my PC realised that it can't be good.

So I did the code for you, and figured "isCivic" is a better function. Not sure what Platyping wanted to do with the current power etc. but you can just put any value (I did with 6 in my test). Of course you'll need to put the Civic you want to use in there, not Barbarism
Great thanks. I'll try it :)
 
@P&nny
Okay, so here's the code I wrote:

Python:
        pPlayer = gc.getPlayer(iPlayer)
        iTeam = pPlayer.getTeam()
        pTeam = gc.getTeam(iTeam)

        iCivic = gc.getInfoTypeForString("CIVIC_WARLORDS")
        if gc.getPlayer(iPlayer).isCivic(iCivic):
            if iGameTurn != 0 :
                pPlayer.changeCombatExperience(pPlayer.getNumCities())

It does exactly what I wanted :D
Thanks for pointing me to the right direction :beer:
 
Back
Top Bottom