PPQ_Purple
Purple Cube (retired)
- Joined
- Oct 11, 2008
- Messages
- 5,764
I like the new resource icons in that screenshot.
Ditto. What mod are they from?I like the new resource icons in that screenshot.
I like the new resource icons in that screenshot.
It's from Realism InvictusDitto. What mod are they from?
Can you use traits to increase the rate of the building wonders? Like Organised boosts the production of courthouses.
I tried and I cant see the effect on the unit card, but there no crash when i load the XML. Is it hidden?
Industrious trait?Can you use traits to increase the rate of the building wonders? Like Organised boosts the production of courthouses.
I tried and I cant see the effect on the unit card, but there no crash when i load the XML. Is it hidden?
Sorry this was me being half asleep when writing the post. Individual Units and buildings gain faster production depending on traits,(settlers for expansive, theatre for creative) can individual wonders gain such a boost from traits? I've tested it, but i'm such a noob i'm not sure if its my incompetence or it it doesn't fundamentally work, but it didn't work for me, even though the game loaded fine after i edited the XML.You talk about wonders, Courthouses (ordinary city improvements), and units (unit cards?). I am confused.
You should be able to do it the same way all the other buildings do it. As in just add your trait to <ProductionTraits> on the building.Sorry this was me being half asleep when writing the post. Individual Units and buildings gain faster production depending on traits,(settlers for expansive, theatre for creative) can individual wonders gain such a boost from traits? I've tested it, but i'm such a noob i'm not sure if its my incompetence or it it doesn't fundamentally work, but it didn't work for me, even though the game loaded fine after i edited the XML.
def cannotTrain(self,argsList):
pCity = argsList[0]
eUnit = argsList[1]
bContinue = argsList[2]
bTestVisible = argsList[3]
bIgnoreCost = argsList[4]
bIgnoreUpgrades = argsList[5]
## New Code
if eUnit == gc.getInfoTypeForString('UNIT_WARRIOR'):
pPlayer = gc.getPlayer(iPlayer)
if pPlayer.getUnitClassCount(gc.getInfoTypeForString('UNIT_WARRIOR')) == 2:
return True
return False
def cannotTrain(self,argsList):
pCity = argsList[0]
eUnit = argsList[1]
bContinue = argsList[2]
bTestVisible = argsList[3]
bIgnoreCost = argsList[4]
bIgnoreUpgrades = argsList[5]
## New Code
if eUnit == gc.getInfoTypeForString('UNIT_WARRIOR'):
pPlayer = gc.getActivePlayer()
if pPlayer.getUnitClassCountPlusMaking('UNITCLASS_WARRIOR') > 1:
return True
return False
Hiya, I'm trying to limit the number of Warriors to 2 per player.
<UnitClassInfo>
<Type>UNITCLASS_WARRIOR</Type>
<Description>TXT_KEY_UNIT_WARRIOR</Description>
<iMaxGlobalInstances>-1</iMaxGlobalInstances>
<iMaxTeamInstances>-1</iMaxTeamInstances>
<iMaxPlayerInstances>2</iMaxPlayerInstances>
<iInstanceCostModifier>0</iInstanceCostModifier>
<DefaultUnit>UNIT_WARRIOR</DefaultUnit>
</UnitClassInfo>
Does group of units mean unit type or something else?I'm working on making it a limit on a certain group of units. "You can only have up to X of any of the following". The Warrior is just a stand-in while I figure it out. That means it's gotta be Python.
I'm trying to write something like this:Does group of units mean unit type or something else?
def cannotTrain(self,argsList):
pCity = argsList[0]
eUnit = argsList[1]
bContinue = argsList[2]
bTestVisible = argsList[3]
bIgnoreCost = argsList[4]
bIgnoreUpgrades = argsList[5]
## New Code
if eUnit == gc.getInfoTypeForString('UNIT_WARRIOR') or eUnit == gc.getInfoTypeForString('UNIT_ARCHER'):
pPlayer = gc.getActivePlayer()
if (pPlayer.getUnitClassCountPlusMaking('UNITCLASS_WARRIOR') + pPlayer.getUnitClassCountPlusMaking('UNITCLASS_ARCHER')) > 2:
return True
return False
I'm trying to write something like this:
Python:def cannotTrain(self,argsList): pCity = argsList[0] eUnit = argsList[1] bContinue = argsList[2] bTestVisible = argsList[3] bIgnoreCost = argsList[4] bIgnoreUpgrades = argsList[5] ## New Code if eUnit == gc.getInfoTypeForString('UNIT_WARRIOR') or eUnit == gc.getInfoTypeForString('UNIT_ARCHER'): pPlayer = gc.getActivePlayer() if (pPlayer.getUnitClassCountPlusMaking('UNITCLASS_WARRIOR') + pPlayer.getUnitClassCountPlusMaking('UNITCLASS_ARCHER')) > 2: return True return False
Which would, in theory, allow each player to have 1 Warrior, 2 Warriors, 1 Archer, 2 Archers, or 1 Warrior and 1 Archer, but no more.
But it doesn't do anything at all. I've probably written it wrong.
<UnitClassInfo>
<Type>UNITCLASS_BASE_UNITS</Type>
<Description>TXT_KEY_UNIT_BASE_UNITS</Description>
<iMaxGlobalInstances>-1</iMaxGlobalInstances>
<iMaxTeamInstances>-1</iMaxTeamInstances>
<iMaxPlayerInstances>2</iMaxPlayerInstances>
<iInstanceCostModifier>0</iInstanceCostModifier>
<DefaultUnit>UNIT_BASE_WARRIOR</DefaultUnit>
</UnitClassInfo>
<UnitInfo>
<Class>UNITCLASS_BASE_UNITS</Class>
<Type>UNIT_BASE_WARRIOR</Type>
<UniqueNames>
</UniqueNames>
...
<UnitInfo>
<Class>UNITCLASS_BASE_UNITS</Class>
<Type>UNIT_BASE_ARCHER</Type>
<UniqueNames>
</UniqueNames>
...
That's an interesting solution, but wouldn't it create a whole heap of problems if every single unit type in the game had to be reclassified as a new unit class?? I think a Python solution would not require any modification to the unit classes at all.Try something like this:
Python:<UnitClassInfo> <Type>UNITCLASS_BASE_UNITS</Type> <Description>TXT_KEY_UNIT_BASE_UNITS</Description> <iMaxGlobalInstances>-1</iMaxGlobalInstances> <iMaxTeamInstances>-1</iMaxTeamInstances> <iMaxPlayerInstances>2</iMaxPlayerInstances> <iInstanceCostModifier>0</iInstanceCostModifier> <DefaultUnit>UNIT_BASE_WARRIOR</DefaultUnit> </UnitClassInfo> <UnitInfo> <Class>UNITCLASS_BASE_UNITS</Class> <Type>UNIT_BASE_WARRIOR</Type> <UniqueNames> </UniqueNames> ... <UnitInfo> <Class>UNITCLASS_BASE_UNITS</Class> <Type>UNIT_BASE_ARCHER</Type> <UniqueNames> </UniqueNames> ...
And of course the UNIT_BASE_WARRIOR could be designed exactly like the UNIT_WARRIOR, etc.
I'm guessing that, mainly, you're missing getInfoTypeForString calls for the UNITCLASS_... strings. I'm surprised that you're not getting an exception (popup or PythonErr.log, if enabled in CivilizationIV.ini); getUnitClassCountPlusMaking expects an integer. Well, perhaps the string is getting converted implicitly somehow.Any ideas what I've done wrong, please?
gc.getPlayer(pCity.getOwner())
print "cannotTrain call"
should suffice; gets written to PythonDbg.log if logging is enabled in CivilizationIV.ini.)