platyping
Sleeping Dragon
Cvgameutils.
Disable all the unwanted civics with big chunks of if else
Disable all the unwanted civics with big chunks of if else
All I found with civics wasCvgameutils.
Disable all the unwanted civics with big chunks of if else
def canDoCivic(self,argsList):
ePlayer = argsList[0]
eCivic = argsList[1]
return False
def cannotDoCivic(self,argsList):
ePlayer = argsList[0]
eCivic = argsList[1]
return False
[COLOR="Red"]#[/COLOR] def canDoCivic(self,argsList):
[COLOR="Red"]#[/COLOR] ePlayer = argsList[0]
[COLOR="Red"]#[/COLOR] eCivic = argsList[1]
[COLOR="Red"]#[/COLOR] return False
[COLOR="Red"]#[/COLOR] def cannotDoCivic(self,argsList):
[COLOR="Red"]#[/COLOR] ePlayer = argsList[0]
[COLOR="Red"]#[/COLOR] eCivic = argsList[1]
[COLOR="Red"]#[/COLOR] return False
All I found with civics wasIf I change it toCode:def canDoCivic(self,argsList): ePlayer = argsList[0] eCivic = argsList[1] return False def cannotDoCivic(self,argsList): ePlayer = argsList[0] eCivic = argsList[1] return False
Would that work ? i.e. not run that function.Code:[COLOR="Red"]#[/COLOR] def canDoCivic(self,argsList): [COLOR="Red"]#[/COLOR] ePlayer = argsList[0] [COLOR="Red"]#[/COLOR] eCivic = argsList[1] [COLOR="Red"]#[/COLOR] return False [COLOR="Red"]#[/COLOR] def cannotDoCivic(self,argsList): [COLOR="Red"]#[/COLOR] ePlayer = argsList[0] [COLOR="Red"]#[/COLOR] eCivic = argsList[1] [COLOR="Red"]#[/COLOR] return False
if ((GET_PLAYER(getOwnerINLINE()).getUnitClassCount(eUnitClass)) >= ((pCity->getNumBonuses((BonusTypes)GC.getUnitInfo(eUnit).getPrereqAndBonus())) * 9))
{
return false;
}
I've added this:
to CvPlot::canTrain to limit some units to a number per resource eg 9 horsemen per horse.Code:if ((GET_PLAYER(getOwnerINLINE()).getUnitClassCount(eUnitClass)) >= ((pCity->getNumBonuses((BonusTypes)GC.getUnitInfo(eUnit).getPrereqAndBonus())) * 9)) { return false; }
it seems to ignore the "*9" and just limit the unit to 1 per resource. I've moved the brackets around to no avail.
if (!pCity->hasBonus((BonusTypes)GC.getUnitInfo(eUnit).getPrereqAndBonus()))
UnitClassTypes eUnitClass = (UnitClassTypes) GC.getUnitInfo( eUnit ).getUnitClassType();
if( GC.getUnitInfo(eUnit).getPrereqAndBonus() != NO_BONUS )
if ((GET_PLAYER(getOwnerINLINE()).getUnitClassCount(eUnitClass)) >= ((pCity->getNumBonuses((BonusTypes)GC.getUnitInfo(eUnit).getPrereqAndBonus())) * 9) )
return false;
How do you get the game to Auto-Play without losing your current nation?
I discovered the game.aiplay console command, but that kills your civ.
I just tried it again with code cut and pasted from your post and it still allows only 1 unit per resource controlled, rather than 9 as it is supposed to. do you mean it was allowing 9 units per resource when you tried it?
I put it in CvPlot because that's where the resources were already referenced. my C++ is totally hack so I try to have as much done for me already as possible.
I wish I had made a save. I was attacking two new custom ships in a game. One a transport steamer with 7 strength and the other a dreadnought with strength 22 and my Destroyers and/or Battleships were attacking the weaker Steamers first. I can't reproduce it. I know that empty transports defend before a transport carrying a unit but that wasn't the case here. I believe the Dreadnought was damaged but the Steamers were at full health but that can't be the reason can it? The Steamers can't pillage or blockade if that matters - but they can attack so they're not quite like Transports.
It doesn't matter whether X can pillage, blockade, damaged or what.
Unless it has cargo inside, all that matters is who is the better defender against that particular attacker.
If a Knight is attacking, naturally a Pikeman will defend, even though a Longbowman is usually better against other units.
However, if the Longbowman is Level 20 with tons of promotions, then it becomes the better defender.
Of course, if the Pikeman is half dead, then the Longbowman is better as well.
Thus, if your Dreadnought is already sinking... the Steamer may become the better defender.