Mod-Modders Guide to Fall Further

It's an overflow issue. Something else is writing into that array when it shouldn't (negative or overlimit value in a nearby array), the number is off from MAX_INT by what was being written. Definitely a bug.


Potentially the city thing is linked to it. Probably from me changing a MAX_PLOTS to a getNumCityPlots() or whatever the variable is.
 
Could it be linked to this?

I added this:
Code:
.def("getFlavorValue", &CvLeaderHeadInfo::getFlavorValue, "int (int i)")
To CyInfosInterface3.cpp in order to expose the function. However, as I see this:
Code:
.def("flavorValue", &CyUnit::flavorValue, "int (FlavorTypes eFlavor)")
I think I may have done an error.
 
Yes, it is in another file. Forgot to mention it. That's a strange bug, then... Would severely mess up flavor-compliant things, won't it?

By the way, is there a way to modify the civics buttons displayed when trading with a rival? It would be neat to make it so Undercouncil doesn't appear...
 
Strange python exception:
list index out of range
indexError
File "CvTechChooser", line 671 in updateTechRecords
File "CvTechChooser", line 76 in interfaceScreen
File "CvScreensInterface", line 109...
It happened after a long shot of AiAutoplay (150+ turns). I noticed that the AI seemingly wasn't pursuing any research anymore... When I got control again, I opened the tech screen and clicked on one tech and got the exception.

I don't get why it's bugging... And I don't know if this prevents the AI from researching of if it's just cosmetic.
 
Potentially the city thing is linked to it. Probably from me changing a MAX_PLOTS to a getNumCityPlots() or whatever the variable is.

I think this part is wrong, as it doesn't consider cities with plot radius of 1 (in CvCity.cpp).
Code:
int CvCity::getNumCityPlots()
{
    if (getPlotRadius() == 3)
    {
        return 37;
    }
    return 21;
}

EDIT : I see something strange also:

Code:
int CvCity::[COLOR="red"][B]getPlotRadius[/B][/COLOR]() const
{
    return [COLOR="Red"][B]m_iPlotRadius[/B][/COLOR];
}

void CvCity::setPlotRadius(int iNewValue)
{
    if (iNewValue != getPlotRadius())
    {
        [COLOR="Red"][B]m_iPlotRadius = iNewValue[/B][/COLOR];
        CvPlot* pLoopPlot;
        [COLOR="red"][B]if (iNewValue < getPlotRadius())[/B][/COLOR]
        {
            for (int iI=8; iI<NUM_CITY_PLOTS; iI++)
            {
                /*That workers in outliing plots are not struck there...*/
                if (isWorkingPlot(iI) == true)
                {
                    setWorkingPlot(iI, false);
                }
            }
        }
        for (int iI=8; iI<NUM_CITY_PLOTS; iI++)
        {
            pLoopPlot = plotCity(getX_INLINE(), getY_INLINE(), iI);
            if (pLoopPlot != NULL)
            {
                pLoopPlot->updateWorkingCity();
            }
        }
        updateFeatureHealth();
        updateFeatureHappiness();
    }
}

EDIT2 : I check to confirm, and when I remove the limit to 1 plot radius for the city, then the problem disappears. May you confirm it's a bug and correct for next release ? :)
 
I think I may deserve big quick death. My python exception? Well, guess what? I was trying to force an AI to pursue a tech I told it it can't research :crazyeye:

I spend the whole day trying to figure that out. Talk about wasting time.
 
Baron Duin Halfmorn and his Werewolf promotion.
What is the name of the Python file handling it and what is the name of the functions used for it?
 
The find on the getCityPlots or whatever is gold. I am quite certain that is causing us one of the index errors, hadn't planned on radius 1 cities for that function. I'll see if I can think of a handy mathematical function that accomodates variable plot radii (should possibly be one.... but with the clipped corners might be hard to think of).

Hopefully that is the only error along those lines :) Thanks for debugging things so well guys, most productive vacation ever so far ;) (Still no time to actually touch the code myself though, but I'll be sure to fix it as soon as I get a chance)
 
The find on the getCityPlots or whatever is gold. I am quite certain that is causing us one of the index errors, hadn't planned on radius 1 cities for that function. I'll see if I can think of a handy mathematical function that accomodates variable plot radii (should possibly be one.... but with the clipped corners might be hard to think of).

Any chance you get anything but 0, 1, 2 or 3 ? I think not before Civ 5 :D
0 => 1
1 => 9 (+8)
2 => 21 (+12)
3 => 37 (+16)

[4 => ? (+18 ? :) )]

Hopefully that is the only error along those lines :) Thanks for debugging things so well guys, most productive vacation ever so far ;) (Still no time to actually touch the code myself though, but I'll be sure to fix it as soon as I get a chance)

No problem. In the mean time I will stay on PlotRadius 2.
And anyway if we can find a way to pay back a little for the help you keep offering us ;)
 
The find on the getCityPlots or whatever is gold. I am quite certain that is causing us one of the index errors, hadn't planned on radius 1 cities for that function. I'll see if I can think of a handy mathematical function that accomodates variable plot radii (should possibly be one.... but with the clipped corners might be hard to think of).

Hopefully that is the only error along those lines :) Thanks for debugging things so well guys, most productive vacation ever so far ;) (Still no time to actually touch the code myself though, but I'll be sure to fix it as soon as I get a chance)
Are you talking about this too? I don't see any effect of this error in game but it really messes up the Debug log... Seems related to UnitStatistics or something.

By the way, xienwolf, have you any idea where I could look to fix the overflow issue? I searched all flavor occurrences in all files but didn't find anything suspect.
 
I don't remember that python debug log you linked, but that isn't likely connected to this at all. This IS quite likely the source of your Flavor values being messed up though.

And correct, thus far plot radius of 3 is the highest we allow, but someone might go and decide to let the Kurio use the CoaTS in a mod-mod, and I'd like the code to allow them to play with that if they really desire to :)
 
I don't remember that python debug log you linked, but that isn't likely connected to this at all. This IS quite likely the source of your Flavor values being messed up though.
Well, I searched a bit and it seems to begin just after the placement of the Guardian of Pristin Pass:
Spoiler :
Code:
Possible Guardian Plots: 33

Assigned Guardian of Pristin Pass to (34,25) in Area 32770.

unit created

24578X52

initialize object first!

UnitStats

<CvPythonExtensions.CyPlot object at 0x1F63D420>

AverageOddsHighest

sdObjectGetVal

initialize object first!

UnitStats
But I see that it spawns the Ring of Carcer just after... Maybe the problem is with Brigit, who would be the "unit created"? It seems to be messed up in the UnitStats, don't you think?
 
My guess is that FlavourMod creates Brigit and then kills it directly (not doing it led to duplicate brigits) and it upsets UnitStatistics because the brigit killed hadn't been "initialized". Of course, it may be another thing... and if I'm right, I don't get why the error log come so often in game.

No idea how to fix it, though...
 
The promotion accomplishes nothing, it is all handled in his unitinfos.

But where is the Python code for the thing?
I want to create a duplicate unit but that would have a diferent spawn.
 
Is there any xml tags for affecting the enemy's withdrawal chance through a promotion ?

I was thinking, I'd like to make a "Merciful" promotion for an elohim unit, that increases the withdrawal of both parties.
 
But where is the Python code for the thing?
I want to create a duplicate unit but that would have a diferent spawn.

There is none. Towards the bottom of his unitentry should be a line for unitcreatedfromcombat, and then below that a line with the chance. It's all done via XML tags.



@ Warkirby: As far as I know, there are none. Although Ahwaric just made something like that for Orbis... need to look at it.
 
There is none. Towards the bottom of his unitentry should be a line for unitcreatedfromcombat, and then below that a line with the chance. It's all done via XML tags.

Thanks a trilion.

But one more thing, is there a way to make it so that spawning occurs only when a certain type of unit is defeted.

Esentialy, I want to make a hero that will transform defeted slaves, and only slaves into Liberated Slaves.
 
Back
Top Bottom