merge succes,
i love this mod.
thanks alot.
if ((ImprovementTypes) GC.getBuildInfo(eBuild).getImprovement() != eOldImprovement)
if ((ImprovementTypes) GC.getBuildInfo(eBuild).getImprovement() != NO_IMPROVEMENT && (ImprovementTypes) GC.getBuildInfo(eBuild).getImprovement() != eOldImprovement)
This looks potentially quite good. I've been wanting improvements to have cultural borders for a while.
Not yet. I am working on this and the World Builder screen right now.Does this work with improvements purchased in advanced start?
I thought it did, but I check before I said so.. and it doesn't. I must need to reword an if statement. I will fix this and have a new version uploaded tonight.Does this work with improvements that grow to other improvements over time, like cottages do? (I'd like to see this merged into FfH, where forts upgrade to Castles and then Citadels.)
Yes, this could be done in Python.Is there any way an improvement's nationality can be changed, such as when a fort is captured by an enemy? If not automatic, could this at least be altered in python (which would mean that in FfH I could easily add a spell with the ability to change an improvement's owner)?
# This will clear the Culture Control of the current Improvement
pPlot.clearCultureControl(pPlot.getCultureControlOwner(), pPlot.getX(), pPlot.getY(), pPlot.getImprovementType(), False)
# This will change the Improvement on the plot
pPlot.setImprovementType(iNewImprovement)
# Now add the Culture Control for the new Improvement
pPlot.addCultureControl(iNewPlayer, pPlot.getX(), pPlot.getY(), iNewImprovement, True)
# And incase the new Improvement's Culture Control Range is smaller then the old one
pPlot.updateCultureControl(pPlot.getX(), pPlot.getY(), 10, True)
The short answer is, yes I am considering this, but I have a few other projects to complete before I come back and start adding any new functionality to this mod.Also, have you considered making it so that the improvement's culture could depend on the size/strength of the units fortified on the plot? That is ideally how I'd like forts' influence to work.
if (bFinished)
{
// < JCultureControl Mod Start >
if ((ImprovementTypes) GC.getBuildInfo(eBuild).getImprovement() != NO_IMPROVEMENT && (ImprovementTypes) GC.getBuildInfo(eBuild).getImprovement() != eOldImprovement)
{
plot()->setImprovementOwner(getOwner());
plot()->clearCultureControl(plot()->getCultureControlOwner(), plot()->getX_INLINE(), plot()->getY_INLINE(), eOldImprovement, false);
plot()->addCultureControl(getOwner(), plot()->getX_INLINE(), plot()->getY_INLINE(), (ImprovementTypes) GC.getBuildInfo(eBuild).getImprovement(), true);
}
// < JCultureControl Mod End >
if (bFinished)
{
// < JCultureControl Mod Start >
if ((ImprovementTypes) GC.getBuildInfo(eBuild).getImprovement() != NO_IMPROVEMENT && (ImprovementTypes) GC.getBuildInfo(eBuild).getImprovement() != eOldImprovement)
{
plot()->setImprovementOwner(getOwner());
plot()->clearCultureControl(plot()->getCultureControlOwner(), plot()->getX_INLINE(), plot()->getY_INLINE(), eOldImprovement, false);
plot()->addCultureControl(getOwner(), plot()->getX_INLINE(), plot()->getY_INLINE(), (ImprovementTypes) GC.getBuildInfo(eBuild).getImprovement(), true);
[B]plot()->updateCultureControl(plot()->getX_INLINE(), plot()->getY_INLINE(), 10, true);[/B]
}
// < JCultureControl Mod End >
void CvPlot::doImprovementUpgrade()
{
if (getImprovementType() != NO_IMPROVEMENT)
{
ImprovementTypes eImprovementUpdrade = (ImprovementTypes)GC.getImprovementInfo(getImprovementType()).getImprovementUpgrade();
if (eImprovementUpdrade != NO_IMPROVEMENT)
{
if (isBeingWorked() || GC.getImprovementInfo(eImprovementUpdrade).isOutsideBorders())
{
changeUpgradeProgress(GET_PLAYER(getOwnerINLINE()).getImprovementUpgradeRate());
if (getUpgradeProgress() >= GC.getGameINLINE().getImprovementUpgradeTime(getImprovementType()))
{
setImprovementType(eImprovementUpdrade);
}
}
}
}
}
void CvPlot::doImprovementUpgrade()
{
if (getImprovementType() != NO_IMPROVEMENT)
{
ImprovementTypes eImprovementUpdrade = (ImprovementTypes)GC.getImprovementInfo(getImprovementType()).getImprovementUpgrade();
if (eImprovementUpdrade != NO_IMPROVEMENT)
{
if (isBeingWorked() || GC.getImprovementInfo(eImprovementUpdrade).isOutsideBorders())
{
changeUpgradeProgress(GET_PLAYER(getOwnerINLINE()).getImprovementUpgradeRate());
if (getUpgradeProgress() >= GC.getGameINLINE().getImprovementUpgradeTime(getImprovementType()))
{
[B]// < JCultureControl Mod Start >
PlayerTypes eCultureControlOwner = getCultureControlOwner();
clearCultureControl(getCultureControlOwner(), getX_INLINE(), getY_INLINE(), getImprovementType(), false);
addCultureControl(eCultureControlOwner, getX_INLINE(), getY_INLINE(), eImprovementUpdrade, true);
updateCultureControl(getX_INLINE(), getY_INLINE(), 10, true);
// < JCultureControl Mod End >[/B]
setImprovementType(eImprovementUpdrade);
}
}
}
}
}
What happened with improvement-controlled plots after its civilisation destroyed?
In my test game they becomes impassable and stay belong to that civ.
Also, when i destroyed an enemy city with many improvements around that terrirory becomes no one`s, as was expected. But when i builded fort there, control over coptured lands returned to enemy.
I think its wrong..
You may have to run through all of the plots on the map whenever a civ dies, and clear the tiles that way.I'm using this mod in a game with a friend of mine, accually playing Civ4 instead of just modding it, and we notice this as well. I'm glad to get some confirmation from someone else. I will look into this aswell.![]()