Mod Component Requests Thread

I just wanted to clarify something with The_J here. I am in the process of adding my King Richard's Crusade wonder (where your units spread state religion when they conquer a foreign city) and I noticed that the python has this in it:

Code:
	def onCityAcquiredAndKept(self, argsList):
		'City Acquired and Kept'
		iOwner,pCity = argsList
		CvUtil.pyPrint('City Acquired and Kept Event: %s' %(pCity.getName()))

But you told me that it should look like this:

Code:
    def onCityAcquiredAndKept(self, argsList): 
        'City Acquired and Kept' 
        iOwner,pCity = argsList 
        ###from here 
        pPlayer = gc.getPlayer(iOwner) 
        if pPlayer.getBuildingClassCount(gc.getInfoTypeForString("BUILDINGCLASS_WHATEVER"))>0: 
            iStateReligion = pPlayer.getStateReligion () 
            if iStateReligion>=0: 
                if not pCity.isHasReligion(iStateReligion): 
                    pCity.setHasReligion(iStateReligion,True,True,True)

Does that mean I am leaving this line, from the first set of code, out?

Code:
CvUtil.pyPrint('City Acquired and Kept Event: %s' %(pCity.getName()))

Sorry if this is an obvious thing, but I basically have no idea what I am doing.
 
But you told me that it should look like this:

Code:
    def onCityAcquiredAndKept(self, argsList): 
        'City Acquired and Kept' 
        iOwner,pCity = argsList 
        ###from here 
        pPlayer = gc.getPlayer(iOwner) 
        if pPlayer.getBuildingClassCount(gc.getInfoTypeForString("BUILDINGCLASS_WHATEVER"))>0: 
            iStateReligion = pPlayer.getStateReligion () 
            if iStateReligion>=0: 
                if not pCity.isHasReligion(iStateReligion): 
                    pCity.setHasReligion(iStateReligion,True,True,True)

Does that mean I am leaving this line, from the first set of code, out?

Code:
CvUtil.pyPrint('City Acquired and Kept Event: %s' %(pCity.getName()))

Sorry if this is an obvious thing, but I basically have no idea what I am doing.

No, don't remove it. Don't remove anything in the python exept when you know what your doing. Usually it's good to place your code after the argslists and before the original code starts to do something.
 
So then you're saying it should look like this?

Code:
	def onCityAcquiredAndKept(self, argsList):
		'City Acquired and Kept'
		iOwner,pCity = argsList
        ###from here 
        pPlayer = gc.getPlayer(iOwner) 
        if pPlayer.getBuildingClassCount(gc.getInfoTypeForString("BUILDINGCLASS_WHATEVER"))>0: 
            iStateReligion = pPlayer.getStateReligion () 
            if iStateReligion>=0: 
                if not pCity.isHasReligion(iStateReligion): 
                    pCity.setHasReligion(iStateReligion,True,True,True)  
        
		CvUtil.pyPrint('City Acquired and Kept Event: %s' %(pCity.getName()))

:confused:

And that will make my units spread my state religion to conquered cities if I have this wonder/building?
 
Yes. But the code seems to be placed oddly. Put the "###from here" on the same line as "iOwner,pCity = argsList". It'll work if you define that buildingclass. Here's the code just incase how it should look like:
Code:
		def onCityAcquiredAndKept(self, argsList):
		'City Acquired and Kept'
		iOwner,pCity = argsList
		###from here 
		pPlayer = gc.getPlayer(iOwner) 
		if pPlayer.getBuildingClassCount(gc.getInfoTypeForString("BUILDINGCLASS_WHATEVER"))>0: 
			iStateReligion = pPlayer.getStateReligion () 
			if iStateReligion>=0: 
				if not pCity.isHasReligion(iStateReligion): 
					pCity.setHasReligion(iStateReligion,True,True,True)  

		CvUtil.pyPrint('City Acquired and Kept Event: %s' %(pCity.getName()))
 
Alright, and I have another question. For the Help line I want the text to say.

Spreads [state religion icon] to conquered cities.

How do I accomplish that? Obviously I want the [state religion icon] bit to show the religious symbol. So if you are Christian it would be a cross.
 
Alright, and I have another question. For the Help line I want the text to say.

Spreads [state religion icon] to conquered cities.

How do I accomplish that? Obviously I want the [state religion icon] bit to show the religious symbol. So if you are Christian it would be a cross.

Try this
Code:
Spreads %F2_Religion to conquered cities.
I'm not sure if it'll return the icon or some kind of description.

EDIT:If that doesn't work, you could also put it like this
Code:
Spreads your state [RELIGION_ICON] to conquered cities.
That adds just the hand, not your state religions symbol.
 
The gods must have it out for me! First I can't get Leo's to work right, now I can't get this one to work right! :cry:

I keep getting a python error for line 953 in the CvEventManager.py, there are a bunch of random pop-ups too that I can't make sense of (they say random stuff like, "line?" "<string>" or random crap like that, but one refers to line 953 in CvEventManager.py.

This is the code I have, I copied a bit before and a bit after so you can see it in context. Line 953, in this case, would be the line that says 'City Acquired and Kept'

Code:
	def onCityAcquired(self, argsList):
		'City Acquired'
		iPreviousOwner,iNewOwner,pCity,bConquest,bTrade = argsList
		CvUtil.pyPrint('City Acquired Event: %s' %(pCity.getName()))
	
		def onCityAcquiredAndKept(self, argsList):
		'City Acquired and Kept'
		iOwner,pCity = argsList
		###from here 
		pPlayer = gc.getPlayer(iOwner) 
		if pPlayer.getBuildingClassCount(gc.getInfoTypeForString("BUILDINGCLASS_CRUSADE"))>0: 
			iStateReligion = pPlayer.getStateReligion () 
			if iStateReligion>=0: 
				if not pCity.isHasReligion(iStateReligion): 
					pCity.setHasReligion(iStateReligion,True,True,True)  

		CvUtil.pyPrint('City Acquired and Kept Event: %s' %(pCity.getName()))
	
	def onCityLost(self, argsList):
		'City Lost'
		city = argsList[0]
		player = PyPlayer(city.getOwner())

Could this have anything to do with having BUG as part of my mod?
 
You see, that you have 2 times def onCityAcquiredAndKept(self, argsList): there, right?
Remove this and the 2 following lines, and then it should work.

its part of a mod im workin on - the full names are too long. If it would be too dificult i wont bother. I just thought itd be fairly straightforward

Simplest thing would be to change just the text of the normal and the short description. But would sure need some hacking around elsewere.
 
You see, that you have 2 times def onCityAcquiredAndKept(self, argsList): there, right?
Remove this and the 2 following lines, and then it should work.

I only have one. One says "def onCityAcquired(self, argsList):" and the other says "def onCityAcquiredAndKept(self, argsList):" any other ideas?
 
Code:
	def onCityAcquired(self, argsList):
		'City Acquired'
		iPreviousOwner,iNewOwner,pCity,bConquest,bTrade = argsList
		CvUtil.pyPrint('City Acquired Event: %s' %(pCity.getName()))
	
		[COLOR="Red"]def onCityAcquiredAndKept(self, argsList):[/COLOR]
		'City Acquired and Kept'
		iOwner,pCity = argsList
		###from here 
		pPlayer = gc.getPlayer(iOwner) 
		if pPlayer.getBuildingClassCount(gc.getInfoTypeForString("BUILDINGCLASS_CRUSADE"))>0: 
			iStateReligion = pPlayer.getStateReligion () 
			if iStateReligion>=0: 
				if not pCity.isHasReligion(iStateReligion): 
					pCity.setHasReligion(iStateReligion,True,True,True)  

		CvUtil.pyPrint('City Acquired and Kept Event: %s' %(pCity.getName()))
	
	def onCityLost(self, argsList):
		'City Lost'
		city = argsList[0]
		player = PyPlayer(city.getOwner())

Could this have anything to do with having BUG as part of my mod?

I'm totally sorry, that was my mistake. I typed it wrong in the example. :sad: :wallbash: Move the one in red to left, like this
Code:
	def onCityAcquired(self, argsList):
		'City Acquired'
		iPreviousOwner,iNewOwner,pCity,bConquest,bTrade = argsList
		CvUtil.pyPrint('City Acquired Event: %s' %(pCity.getName()))
	
	[COLOR="Red"]def onCityAcquiredAndKept(self, argsList):[/COLOR]
		'City Acquired and Kept'
		iOwner,pCity = argsList
		###from here 
		pPlayer = gc.getPlayer(iOwner) 
		if pPlayer.getBuildingClassCount(gc.getInfoTypeForString("BUILDINGCLASS_CRUSADE"))>0: 
			iStateReligion = pPlayer.getStateReligion () 
			if iStateReligion>=0: 
				if not pCity.isHasReligion(iStateReligion): 
					pCity.setHasReligion(iStateReligion,True,True,True)  

		CvUtil.pyPrint('City Acquired and Kept Event: %s' %(pCity.getName()))
	
	def onCityLost(self, argsList):
		'City Lost'
		city = argsList[0]
		player = PyPlayer(city.getOwner())

EDIT: BTW, is the text working?
 
The text didn't work, there was just a U with an accent mark over it instead of a symbol. I think all of these problems have to do with BUG (and not the code itself), I have been trying to get help in THIS THREAD where Afforess and EmperorFool are trying to help me, but I don't really understand what they are telling me to do because I basically make art and this stuff is confusing as hell to me.

So if you want to help that might be a good place to do it, I put you around a page back in case you want to read up on what is happening.
 
Could someone add 3 levels of culture?
-30,000 Impressive
-150,000 Mythic
-300,000 Angelic
The numbers are for Epic speed with the others done proportionately. It also means expanding the cultural radius by 3 more squares. Also, allow a one city Angelic culture victory.

I would like a deep sea boat that covers 9 squares, the 1 it sits on and the 8 surrounding (I believe that would come to 9 food and 9 commerce).

And how about using settlers to expand the city's fat cross by settling one settler in an adjacent square and settling him so as to not form another city but to instead increase the city's workable squares by 1.

Thanks
 
This is where requests go right? Let's see if a modder will bite.

I keep forgetting to draft when running Nationhood in my Globe Theatre city. Ideally a main screen counter showing you the number of drafts you've performed this turn would be enough to remind me.

Thanks in advance.
 
Okay, I'm still playing around with the XML files.

Okay, I know, for example, there is an option for buildings to add food yield to all tiles, either land or see. Is there a way for a building to add only food yield to certain improvements?

Or would I have to go to the improvement itself? I looked there, and they only had yield bonus due to resource or technology.

Still being city dependent, I'd think itd have to be the building script that did it.

For example I want a building "Advanced Agricultural Infrastructure" just for example, and it will add +1 Food to every farm in the radius. Is there code to support this?
 
I'd like to request a couple more wonders, not the art or anything, but just the python to make it work. I thought all of these existed already but apparently they do not:
  • Flavian Amphitheatre - Can train UUs of conquered cities. So if you conquer a Byzantine city you should be able to build a Cataphract. I'd really like it if you could also train your UU in that city provided it doesn't replace the UU of that civ. If it does, your UU should win out.
  • Petra - desert tiles in city radius gets +1 food, +1 hammer, +2 commerce, +6 culture, +2 merchant GPPs; requires market and desert
  • Sydney Opera House - I know Tsentom has one already, but it is too civic-specific. I'd like mine just to give a free great artist and have +1 Happiness per theatre.
  • Trafalgar Square - Again, I think Tsentom has one but I'm not sure if it is like this exactly, this was AbsintheRed's idea: +50% naval unit production, +2 xp for naval units, +6 culture, +2 GPPs (no focus); city must be coastal

Now, I know there are a lot of requests there, so I can understand if they can't all be done. If any can be done with only XML I could probably handle that, but I'd like to be able to add these wonders like this to my mod. If any already exist, or exist bot not exactly like this (and can be changed easily) that'd be nice to know too. :goodjob:
 
Flavian Amphitheatre: Use tsentom's Flavian Amphitheatre as base, and change the things related to buildings to units.

For Petra, use tsentom's Great Mosque Of Djenne or the Ice Hotel, and change the values.

Sydney Opera House: That's just XML ;).

Trafalgar Square: Should also be just XML ;).
 
Flavian Amphitheatre: Use tsentom's Flavian Amphitheatre as base, and change the things related to buildings to units.

For Petra, use tsentom's Great Mosque Of Djenne or the Ice Hotel, and change the values.

Sydney Opera House: That's just XML ;).

Trafalgar Square: Should also be just XML ;).

Thank you sir. :goodjob:

EDIT: Although Tsentom1's Flavian Amphitheatre says "Can capture enemy UBs" I want you to have the ability to build enemy UUs in cities you conquer. Which is slightly different than capturing the UB, in fact you can't really capture an enemy UU when you conquer a city at all.
 
Top Bottom