Dawn of Civilization - an RFC modmod by Leoreth

Status
Not open for further replies.
Other than that, I'm not sure if the event "onGreatPersonBorn" is activated in RFC. That could be a DLL or a XML thing, I'm not sure.
You seem to be right, something is missing. Tested it and still got Zhongchi as a Arabian scientist. The WW2 mod seems not to feature any DLL changes, or it comes without the sourcecode, and I don't think XML is capable of affecting Python functions. The only thing I've also found connected to the GP names is this file:
 
That was general bad economy stability (to put it in RFC terms). The depression only came when they shifted away from State Property to Free Market.
 
Definitely no. A Depression caused the USSR to fall apart.

It's actually pretty easy to collapse USSR, you just need to change their economy civic.
Isn't it more like that than total collapse? Russia was never in a civil war or under real communist regime. (I.e. no state)
 
You seem to be right, something is missing. Tested it and still got Zhongchi as a Arabian scientist. The WW2 mod seems not to feature any DLL changes, or it comes without the sourcecode, and I don't think XML is capable of affecting Python functions. The only thing I've also found connected to the GP names is this file:
There is actually one XML file that affects Python callbacks; PythonCallbackDefines.xml, but it doesn't have anything about GP...

Did you try and delete that if statement I mentioned? Because it should actually prevent the renaming to work - unless the GP has no name to begin with. I don't think that is what you want.

I took a closer look at how the WWII mod works and this is what I've gathered:

The C++ calls to Python come in through the CvEventManager module.

The CvWWIIPacEventManager module is basically an add on to the first one, as it inherits everything from the default manager. This is the code that achieves that, by the way:
Code:
class CvWWIIPacEventManager(CvEventManager.CvEventManager, object):
	def __init__(self, *args, **kwargs):
		# initialize base class
		self.parent = CvEventManager.CvEventManager
		self.parent.__init__(self)
		super(CvWWIIPacEventManager, self).__init__(*args, **kwargs)
		# map the initial EventHandlerMap values into the new data structure
		for eventType, eventHandler in self.EventHandlerMap.iteritems():
			self.setEventHandler(eventType, eventHandler)
		# --> INSERT EVENT HANDLER INITIALIZATION HERE <--
		CvCivSpecificGreatPeopleModEventManager.CvCivSpecificGreatPeopleModEventManager(self)
If I'm understanding this correctly, the custom event manager takes over all duties from the default one and also uses the parent's methods. Then it calls an "event handler", CvCivSpecificGreatPeopleModEventManager in this case. (The code is so structured that one could add additional handlers, but this mod uses only the one.)

This is the code that adds the onGreatPersonBorn event to the event manager:
Code:
	def __init__(self, eventManager):
		...
		eventManager.addEventHandler("greatPersonBorn", self.onGreatPersonBorn)
So I guess that should carry over to RFC also.

Can you attach your copies of CvEventManager, CvRFCEventManager and CvRFCEventhHandler so that I can take a look at exactly what you've done.
 
It's the error KaiserBenjamin posted.
Oh, that one. I'm a bit confused now... :confused::crazyeye:

That seems to me as a typo, because the variable causing the exception is obviously called iNewBasestability, when it most likely should be iNewBaseStability (capital "S"). Because this is what the traceback is saying - that your code is trying to read a variable that hasn't been assigned any value. This is what "referenced before assignment" means. (You assign a variable first, then reference it.)

This is a common exception for misspelled variables, functions and the like.
 
Here, Inca and India have skewered dynamic names. I've seen this happen to Babylon and Greece also. Not having a state-religion wouldn't happen to play a factor here, would it? (Font)

Spoiler :
 

Attachments

  • Civ4ScreenShot0135.JPG
    Civ4ScreenShot0135.JPG
    92.8 KB · Views: 608
@Baldyr:
I'm not at home at the moment so I can't apply any of your hints, but thanks again regardless! It seems you are a codesigner of this modmod already :goodjob:

@Cethegus:
I saw this once and supect it's the Zoroastrianism icon causing this (do they have Zoroastrian state religion in your situation?). I really messed with the icon font file without knowing what I was doing, so this probably was to be expected. I'll see what I can do about that.
 
@Cethegus:
I saw this once and supect it's the Zoroastrianism icon causing this (do they have Zoroastrian state religion in your situation?). I really messed with the icon font file without knowing what I was doing, so this probably was to be expected. I'll see what I can do about that.

It's a common mistake. Been there, done that.
And yes, apparently converting to Zoroastrinism has that effect. Tested with another game save since that one was lost.
 
@Baldyr:
I'm not at home at the moment so I can't apply any of your hints, but thanks again regardless! It seems you are a codesigner of this modmod already :goodjob:.
Well, I'm trying to be helpful. I'm new at this Python thing myself and helping out is actually very good for learning. For instance, I haven't delved into the event managers and handlers so much previously, but now I have taken a closer look. But I wouldn't say I have contributed with any actual design. This is where others have contributed a lot, I think. :goodjob:
 
It's a common mistake. Been there, done that.
Does that mean you know how the images in the font file have to be placed?
 
Does that mean you know how the images in the font file have to be placed?

Sadly, no. :( Since they throw around that much, it can't just be a simple placement issue. I never really looked into it and just fiddled around to meet some ends so I'm not sure if I can help you. I suspect it's a slot issue, though I can't guarantee that.
(When I tried it back who knows when, I replaced Judaism with a simple recoloring of the Christian cross. Guess which religion went awry? Islam.)

Well, I'm currently doing a little experimenting with civics. I don't want to suggest anything without trying it out first so here goes.
Spoiler :
Autocracy:
-changed +2:) from barracks to -50% War Weariness

Representation:
-changed +3:science: from specialists to -50% city number maintenance

Aristocracy:
-allows Slavery

Totalitarianism:
-unlimited spies
-changed -50% War Weariness to +2:) from barracks

Serfdom (->Manorialism, requires Feudalism)
-+50% worker speed

I'll tell you how they work out.
 
It must be a placement issue, since RFCC works fine with the same Zoroastrianism icon. I'll start moving it around some pixels and look what happens.

Your civic ideas seem viable, but wouldn't a SE become too weak without the boost from Representation?

Did you try and delete that if statement I mentioned? Because it should actually prevent the renaming to work - unless the GP has no name to begin with. I don't think that is what you want.
I did that and it worked! Sorry, but I completely misunderstood both you and the code at first, or I wouldn't have gone asking further questions :rolleyes:

That seems to me as a typo, because the variable causing the exception is obviously called iNewBasestability, when it most likely should be iNewBaseStability (capital "S"). Because this is what the traceback is saying - that your code is trying to read a variable that hasn't been assigned any value. This is what "referenced before assignment" means. (You assign a variable first, then reference it.)

This is a common exception for misspelled variables, functions and the like.
That's clear to me. I was only wondering why the error appeared exactly in this situation.

Either a problem is detected when starting the mod ("compile error") or when trying to use that code for the first time ("runtime error"). The latter was the case here. But the line in question (line 600, with the lowercase 's') was inside of an if-condition that can't have possibly been true (it was pPlayer.getEra() >= 4, i.e. Industrial Age, while we were still in the Renaissance).

That aside, now that the unique GP name algorithm works, I need your help in finding names for Babylonia, Portugal, Netherlands, Maya and Khmer. The mod I used was meant for warlords and so they're not included. Byzantium would also be nice to have, as they're planned to become playable later anyway. Three names for each category (except great spies, who don't get unique names) would suffice. So if you've got any ideas or links to lists that have already been done (I'm sure there are), I'd be very grateful.
 
I did that and it worked!
:lol: What a relief! :goodjob:
Either a problem is detected when starting the mod ("compile error") or when trying to use that code for the first time ("runtime error"). The latter was the case here. But the line in question (line 600, with the lowercase 's') was inside of an if-condition that can't have possibly been true (it was pPlayer.getEra() >= 4, i.e. Industrial Age, while we were still in the Renaissance).
Ah, now I'm following you. The variable pPlayer refers to a player object. If it was a game object your reservation would be valid. Clearly the player in question was in the industrial age. :p

So you have to differentiate between the current game era and the era each player is recently in. How exactly these things relate to each-other is somewhat unclear to me, but I did actually test this the other week. :rolleyes: I've forgotten. :p

If you wanna change it to game era (instead of player era) you need to go:
Code:
if cg.getGame().getEra() => 4:
alternatively:
Code:
if CyGame().getEra() => 4:
(The second one is shorter, but I'm thinking that the first one is more efficient.)
 
This is strange. India's throwing the name off even when being Theocracy+Patriarchate. If it matters any, they're Buddhist shrine-holders.
I also reverted Representation back to +3:science:/specialist in my try-out. I had overlooked State Property and realized you had already addressed City numbers. :sad:
 
@Baldyr:
The error occured in the third turn after the American spawn. And they start in the Renaissance ... but as I'm typing this I realise that there are many other civs in that game that might very well be already in the Industrial Age :crazyeye:

I've done the Byzantine GP hashmap entry, by the way. Don't know why I started with them, but after I've done some research about Byzantine emperors, patriarchs, Greek Fire and the Hagia Sophia, I was nearly finished already :lol: The only thing missing are decent Byzantine merchants.
 
@Baldyr:
The error occured in the third turn after the American spawn. And they start in the Renaissance ...
Are you sure the error occurred on the American turn? Could it have been some other Civ that triggered the code in question?

Otherwise you might need to review the American Techs, as there would be some there that's prompting them to start in the Industrial Era. Where would one check what era a Tech belongs to, by the way? The XML? :confused:
 
It could very well have been caused in another civ's turn. I just completely disregarded this possibility first ...
 
Confirmed: The religions whose icons need refining when representing state religion are Zoroastrinism (regular) and Buddhism (holy city). The rest are fine.
 
Buddhism too? I didn't even change that ...

Ah, that made sense. The Zoroastrianism symbol is neighboring the Buddhist holy city symbol and seems to have overwritten the border mark between both symbols, so that their boundaries were screwed up. Currently testing my first fix.
 
Status
Not open for further replies.
Top Bottom