Requesting following features

I'm afraid I don't understand. Do you have autosaves enabled? In that case you should be able to post one of those...
 
I didn't find the error :D It was TopSecret that found it and also make sure you download the current version in my thread just in case
 
doesn't matter I have it myself :rolleyes:

this bug could also be because of a forest having been removed during the checking or change in territory as I think you fix fixed the unit death one... not sure... lets be more thorough this time :D

however it seems I can't upload for the mintue so I will get back to you
 
right, I checked the log and there it is: Greek valid catapult constructors: (884927088, -65210) (-2147483647, -2147483647) (-2147483647, -2147483647) (1166766952, 1166763784) (19, 36) (-2147483647, -2147483647)

so I have an idea... heres the code itself:
Code:
        def checkUnits(self):
                for pUnit, pPlot in list((pUnit, pUnit.plot()) for pUnit in self.iterateUnits()):
                        if pPlot.getFeatureType() == eForest:
                                if pPlot.isNone() or pUnit.isDead(): continue
                                if isEnemyTerritory(pUnit, pPlot, self.pCivPlayer.get(CyTeam)) or self.isUsed(pUnit): return
                                self.activateOverwatch(pUnit, pPlot)
                                break

I say that in the datastorage there should be very long tuple of tuples which consists of every coordinate possible... and then pPlot i schecked against these?

I made code for generating all plots:
Code:
x = 0
y = 0
VP = (x,y)
while VP <= (82, 51):
    VP = (x, y)
    if y == 51:
        x =+ 1
        y = 0
    else:
        y += 1
logical :D

anyway what do you think (you haven't spoken recently :confused:)
 
(884927088, -65210) (-2147483647, -2147483647) (-2147483647, -2147483647) (1166766952, 1166763784) (19, 36) (-2147483647, -2147483647)
These tuples are supposed to be map coordinates. The only valid one seems to be (19, 36) and I have no idea what those others are all about. :confused:

IIRC the actual exception is caused by this line:
Code:
if pPlot.getFeatureType() == eForest:
I would suggest that this line should appear before the former:
Code:
if pPlot.isNone() or pUnit.isDead(): continue
The code would look like this:
Code:
        def checkUnits(self):
                for pUnit, pPlot in list((pUnit, pUnit.plot()) for pUnit in self.iterateUnits()):
                        [B]if pPlot.isNone() or pUnit.isDead(): continue[/B]
                        if pPlot.getFeatureType() == eForest:
                                if isEnemyTerritory(pUnit, pPlot, self.pCivPlayer.get(CyTeam)) or self.isUsed(pUnit): return
                                self.activateOverwatch(pUnit, pPlot)
                                break
You could test it, while I scramble to get the time to test things myself.
I say that in the datastorage there should be very long tuple of tuples which consists of every coordinate possible... and then pPlot i schecked against these?
I don't think that the invalid plot coordinates are the problem - they are more likely just a symptom of invalid CyUnit and/or CyPlot entries.
 
ok
also what were the errors in my civic function posted ages ago?
 
You basically need to test your code and read the resulting errors. This is the default way of programming. :p

But the errors I could spot right away were:
Code:
def FreeCivic():
        bBasic = True
        pPlayer = gc.getPlayer(eRome)
                if [COLOR="Red"][B]B[/B][/COLOR]basic [COLOR="Red"][B]=[/B][/COLOR] True:
                        pCivic = gc.getInfoTypeForString('CIVIC_REPUBLIC')
                        if pPlayer.isCivic(pCivic):
                                pPlayer.setCivics(0, pCivic)
                                showPopup(senateHeader, freeCivicMessage)
                        else:
                                print "No usable civic for FreeCivic()"
                                
                else:
                        pass
Also, you could rename pCivic something else, like eCivic or iCivic. If this doesn't make sense to you I could explain why. The name doesn't affect performance however.
 
how did I not see those lol and how did I make the = one!?
 
Traceback (most recent call last):

File "CvEventInterface", line 23, in onEvent

File "CvEventManager", line 187, in handleEvent

File "CvEventManager", line 382, in onBeginGameTurn

File "CatapultConstruction", line 178, in process

RuntimeError: dictionary changed size during iteration
ERR: Python function onEvent failed, module CvEventInterface


:rolleyes:

whats this one on about :D

edit:

log from turn

PY:Player 0 Civilization Roman Empire Unit Advanced Archer was killed by Player 28
PY:Player 1 Civilization Greek Empire Unit Archer was killed by Player 0
PY:Player 1 Civilization Greek Empire Unit Galley was killed by Player 0
PY:City Acquired Event: Argos
PY:Player 1's alive status set to: 0
PY:City Acquired and Kept Event: Argos
PY:Rhodes has grown
this is grantExtraXP() calling!

this is grantExtraXP() calling!

PY:Player 28 Civilization Barbarian State Unit Archer was killed by Player 5
PY:Player 5 Civilization Egyptian Empire Unit Warrior was killed by Player 9
this is grantExtraXP() calling!

PY:Memphis has grown
this is grantExtraXP() calling!

PY:Alexandria has grown
PY:Giza has grown
PY:Scone has grown
PY:Corduba has grown
this is grantExtraXP() calling!

PY:Numantia has grown

*** Rebellion Debug ***
Active on Game Turn 149:
<Rebellion.MinorRevolt instance at 0x0EF2CDC8> (city: Thebes, starting turn: 89)
<Rebellion.Resistance instance at 0x0EF2CEB8> (city: Tarsa, starting turn: 145)
***

Greek valid catapult constructors:
 
I'm not sure about versions of files anymore - could you attach your copy of CatapultConstruction.py?
 
ok, however I am away from home so I will have to send you the release version one (after downloading it here, how useful) and make the edits I did last night...

called do not move ;) to stop people moving it :D
 

Attachments

Without testing anything out, this should amend my mistake causing the exception:
Code:
def process():
        if not CatapultOverwatch.bEnabled: return
        [B]lDeletePlayers = list()[/B]
        for ePlayer, pCatapultOverwatch in overwatchDict.iteritems():
                debug(ePlayer, pCatapultOverwatch)
                if not pCatapultOverwatch.pCivPlayer.isAlive():
                        [B]lDeletePlayers.append(ePlayer)[/B]
                elif not pCatapultOverwatch.constructionTimer():
                        pCatapultOverwatch.checkUnits()
        [B]for ePlayer in lDeletePlayers:
                del overwatchDict[ePlayer][/B]
Basically, I can't delete defunct players from the dictionary while I'm iterating the same dictionary. Makes sense, and I simply added a separate additional process for deleting those entries.
 
so, why is it in there? What was it meant to do and why isn't it needed? Of course I could be completly wrong
 
The dictionary stores information on on-going catapult construction, and is organized by player. But once a player is eliminated these dictionary entries should be deleted also.

Note that the code posted above is the amended version that you should use. (Compare with the original function!) Its supposed to do the same thing, but actually work. :p
 
with out me having to look... what was the original like then how does it differ?
 
I believe it looked like this:
Spoiler :
Code:
def process():
        if not CatapultOverwatch.bEnabled: return
        for ePlayer, pCatapultOverwatch in overwatchDict.iteritems():
                debug(ePlayer, pCatapultOverwatch)
                if not pCatapultOverwatch.pCivPlayer.isAlive():
                        [B]del overwatchDict[ePlayer][/B]
                elif not pCatapultOverwatch.constructionTimer():
                        pCatapultOverwatch.checkUnits()
The highlighted line is invalid, apparently ("dictionary changed size during iteration"). Because the for-in loop is iterating the same dictionary (overwatchDict).

The problem is of course that I missed to test this myself - the eventuality that some player constructing a catapult is killed off. Sorry for that... :p
 
lucky that after you fixed the other bug I went and killed greece the turn after :p I was annoyed at them for giving me an exception :p Providing this works my Patch testing empire can rule over Italy, Greece, byzantium and turkey! (I am going that way to fully in game test byzantium :D)
 
All this testing is actually also an integral part of any software design, so keep up the good work finding all those bugs! :goodjob:
 
:D From adding new unit art the other day I found a bug in how some of the units were named which forced me to unpak the art files and change some of egypts unit's names as I have never tested with the latest art for eygpt (which I found would cause errors all over the place :D) I never found this before the pak :D let's hope nobody has played with eypgt yet ;)
 
Back
Top Bottom