Requesting following features

Ok, quick fix time. Change line 532 in Rebellion to these lines:
Code:
        if pRebelHQ:
            pRebelHQ.setRebelHQ()
And regarding the Civilzation name forms, there is yet another error in the CivPlayer module. (Due from changing around code without testing everything all of the time.) Copy-paste the method I posted above (which is from a later version than yours) to replace the present defunct getName() method.

I'm working on a brand new version (release candidate) of CivPlayer while coding on G&G. You will be able to use it as-is in your mod also, once its finished. It has new functionality and also works with non-scenario type mods (where several players may or may not have the same civilization attribute).

ps. Don't miss the two post on the previous page.
 
unfortunalty I never did change the calendar to anything different so it does start at -4000 :lol:
any way: I will attepmt to fix the rebels (Will it be just ERE or civil war as well?)

edit: didn't see page 41, I saw the previous 2 but not this :lol:!
 
unfortunalty I never did change the calendar to anything different so it does start at -4000 :lol:
But you can still change it. Either in the WBS or with Python. I don't see the problem.

any way: I will attepmt to fix the rebels (Will it be just ERE or civil war as well?)
The error resided in the CivilWar class, so the ERE class got fixed by inheritance.
 
but changing calendar will change the dates for the events and I will need to make it completly from stratch ( the calendar that is). I am planing on a 1.31 patch which would fix any problems and maybe add a new calendar....

I don't completly understand about how to edit the DawnofMan.py bit...
where is the function you defined put and what will the long line right at the begining (I forgot it's name :lol:) look like?

this is my getname():
Code:
        def getName(self, bLong=None):
                """
                Returns the Civilization name (string) in its adjective form by default. By setting
                the optional bLong parameter to True the method will instead return the full
                civilization name, and a False value will in turn return the short form.
                """
                if bLong == None:
                        name = self.get(CyPlayer).getCivilizationAdjective(0)
               [B] if[/B] bLong:
                        name = self.get(CyPlayer).getCivilizationDescription(0)
                else:
                        name = self.get(CyPlayer).getCivilizationShortDescription(0)
                return str(name)

the only thing different from the two is one says if and one elif... does this really fix the problem? We will have to find out...
 
but changing calendar will change the dates for the events and I will need to make it completly from stratch ( the calendar that is).
What dates? What events? Do you realize that the isDate() or whatever function you're using works with any calendar? And how many events have you defined exactly? How difficult would it be to change those data constants? :confused:

I don't completly understand about how to edit the DawnofMan.py bit...
where is the function you defined put and what will the long line right at the begining (I forgot it's name :lol:) look like?
It was a method belonging to a class, and it goes anywhere inside the body of the class. Just give it a try. ;)

And the method includes everything from that monster of a line - so it replaces it. Just have a closer look! ;)

And you get extra credit if you figure out how the one missing el in elif makes all the difference! ;)
 
A hint - this is how you probably would have defined the function:
Code:
        def getName(self, bLong=None):
                """
                Returns the Civilization name (string) in its adjective form by default. By setting
                the optional bLong parameter to True the method will instead return the full
                civilization name, and a False value will in turn return the short form.
                """
                if bLong == None:
                        name = self.get(CyPlayer).getCivilizationAdjective(0)
                if bLong[B] == True[/B]:
                        name = self.get(CyPlayer).getCivilizationDescription(0)
                else:
                        name = self.get(CyPlayer).getCivilizationShortDescription(0)
                return str(name)
Now look at it and do the logic, line by line...
 
hmmm well my guess at the el would be that python "grammer" only allows 1 if followed by infinite elifs followed by 1 else...
so maybe if there are 2 ifs then the first is ignored and python somehow corrects itself by saying... "ok I have none but I don't know how to use it therefore I would have to say that the statement is false through no mention of true and therefore return short desc" (silly python :lol:)

am I right?:D

ok I understand now I was having a moment of stupidity (I have a cold see...) will post back with results of quick fix etc...


edit: I wrote this before you posted post 806 so I got it on my own (if it is right that is...) Btw I have started to stop using == true for the moment (being a little braver :D) Also I wouldn't know the turns corresponding to the new dates so it would make it a little confusing (so untill I wok it out I can't do as far as im concerned). Nice that isdate() does anything :D
 
Yeah, this is exactly why you shouldn't be careless with if and elif. It does matter which you use. Well, sometimes it does. But it pays off to keep you logic straight always.
 
what can I use my extra credit points for? :lol:

edit: since changing the civ player to elif this error appeared on loading:

Traceback (most recent call last):
File "<string>", line 1, in ?
File "<string>", line 52, in load_module
File "CvEventInterface", line 13, in ?
File "<string>", line 52, in load_module
File "CvEventManager", line 12, in ?
File "<string>", line 52, in load_module
File "CvScreensInterface", line 22, in ?
File "<string>", line 52, in load_module
File "CvDawnOfMan", line 6, in ?
File "<string>", line 52, in load_module
File "eNums", line 14, in ?
File "CivPlayer", line 37, in pointer
File "CivPlayer", line 28, in Civ
KeyError: 'Hellenic Rebels'

And this has never appeared before... what is it saying? My eNums:

eHellenicRebels = pointer("Hellenic Rebels", playerID)
eRome = pointer("Rome", playerID)
eGreece = pointer("Greece", playerID)
eGaul = pointer("Gaul", playerID)
eBrittania = pointer("Brittania", playerID)
eCarthage = pointer("Carthage", playerID)
eEgypt = pointer("Egypt", playerID)
eGermania = pointer("Germania", playerID)
ePictia = pointer("Pictia", playerID)
eItalianRebels = pointer("Italian Rebels", playerID)
eNubianRebels = pointer("Nubian Rebels", playerID)
eNumidianRebels = pointer("Numidian Rebels", playerID)
eGallicRebels = pointer("Gallic Rebels", playerID)
eBrythonRebels = pointer("Brython Rebels", playerID)
eGermanicRebels = pointer("Germanic Rebels", playerID)
ePictishRebels = pointer("Pictish Rebels", playerID)
eIberia = pointer("Iberia", playerID)
eGreekColonies = pointer("The Greek Colonies", playerID)
and the bits mentioned from civplayer:

Code:
def pointer(name, iIndex):
        """
        Wraps up the Civ() function and the CivPlayer.get() method into a coherent, easy-to-use
        multipurpose function. There are two arguments; name (string) and iIndex (integer).
        They refer to the Civilization name short form and the type of reference being requested.
        The valid iIndex values are playerID, CyPlayer, teamID, CyTeam and PyPlayer.
        """
        return Civ(name).get(iIndex)
and
Code:
def Civ(name):
        """
        Returns a ready-to-use CivPlayer class instance for use with class methods. The name argument
        (string) refers to the short form av the Civilization name of the player associated with it.
        """
        return CivPlayer.Civilizations[name]
 
This traceback is emanating from CvDawnOfMan and it basically means that it is trying to import the Utils module before CivPlayer has been initialized via CvEventManager. If you skip the eNums module and use plain integer values (instead of eRome and so forth) it should be ok. This is in reference to the CvDawnOfMan.getBodyString() method - not anything else.

Again, me not testing things before posting them is causing problems. :p
 
would you happen to know what the integers are perchance?
 
All players are indexed with integer values from zero and up. You define these in the WBS.
 
would this be it?

0: "TXT_KEY_DAWN_OF_MAN_ROME",
1: "TXT_KEY_DAWN_OF_MAN_GREECE",
3: "TXT_KEY_DAWN_OF_MAN_BRITTANIA",
4: "TXT_KEY_DAWN_OF_MAN_GAUL",
5: "TXT_KEY_DAWN_OF_MAN_CARTHAGE",
6: "TXT_KEY_DAWN_OF_MAN_EGYPT",
7: "TXT_KEY_DAWN_OF_MAN_GERMANIA",
8: "TXT_KEY_DAWN_OF_MAN_PICTIA",
 
Yeah, not being able to use the enums is kinda defeating the point of using a dictionary, but at least it should work. A simple tuple array would work also, but there would have to be some additional code to make the default Dawn of Man text to be displayed in case someone tries to play a minor Civ. But perhaps that's none of your concern?

A tuple setup could look like this:
Code:
tDawnOfManBodyStrings = (
    "TXT_KEY_DAWN_OF_MAN_TEXT_ROME",
    "TXT_KEY_DAWN_OF_MAN_TEXT_CARTHAGE",
    )
It would be indexable with the PlayerType, like:
Code:
bodyTag = tDawnOfManBodyStrings[ePlayer]
 
I like the dictionary so I will stick with that for the time being less there is any problems
 
yeah I found later on... btw, If I wanted to add a print command to the rebels module where would I put it (because I want to see in the debug file swhat rbellion triggered when, as the picts had some sort of rebellion then and I only knew because it told me the rebels died. (not running ctrl and z atm)). also I am playing as the carthagians and conquored syracuse and let my axeman leave the city to catch a worker when rebellion happened! my response was this: "What? Oh... I forgot about that...". the player will definatly get a suprise or 2 from that :D
 
You can basically put print statements anywhere in the code. Just try it. Laws of logic apply.

All of these modules have been full of such debug lines originally - I deleted them only when I knew things worked as they should.

If you like, I could add a debug feature to say the Rebellion module that gives you all the data when things happen. What would have to be included, you think?

Also, look in the CatapultConstruction module: There is a debug() function that I used for testing. It is currently disabled by commenting out the function call line, but it could serve as inspiration for a more elaborate debugging setup. You can enable it (uncomment the commented out line) and see what it does.
 
hmm something is not right... Egpyt had some sort of rebellion (didn't give me the message as I didn't know the city)... and then my warrior wondered up to say hi to the nubians and they were already at war with me so the reset diplomacy might not be working as intended... Also after Syracuse came out fo resistance I immediatly got a rebellion (presumably domestic, need to add specfic messages...) which spawned 5 swordsmen (with reenforments) while I only had 2 axes in the city (hadn't hooked up my iron yet..). Needless to say what happened... Is it meant to spawn 1 right after the other like that? (I forget these things). I will have to tweak the %ages a little...

Regarding the debugg I would like a message stating what rebellion is happening, where, and to who as well as unit spawns... how long untill I could have that up and running?
 
Back
Top Bottom