- Unfortunately, no. However, improvements may have the bActAsCity tag (check citadels) which may work for you.
Ok... thats even easier, thx
- Unfortunately, no. However, improvements may have the bActAsCity tag (check citadels) which may work for you.
for i in xrange(pUnit.getNumInvisibleTypes()):
if (pUnit.getInvisibleType(i) > 0):
do stuff
Unfortunately setInvisibleType is not available in python, so you can't set it as not being invisible. Nor is setSeeInvisibleType so you can't make your unit able to see it either, unless you give it a promotion which allow it.
Ok... thats even easier, thx
Thanks snarko, that was the missing piece. Exactly what I needed. I'm not sure if I want to set the unit visible (if it's easy to do, I'll probably give a promotion that makes them visible, and then have it expire at the end of the turn). What I *do* want to do is damage every deceptive unit that's trying to hide or disguise its nationality.
(Meh, I don't see an easy way to set a unit Visible with a promotion. So maybe I'll give the caster SEE INVISIBLE for a turn...)
Thanks snarko, that was the missing piece. Exactly what I needed.
He wrote out the code that I'd already described, you know.
OK, I'm bashing my head against a brick wall trying to do the simplest things, so I figured it open it up to the brains trust as mine has evidently gone AWOL.
I wanted to hack some of the units from Colonisation into the game to beef up the guilds a little. If I ever get anywhere I'll put it up online for your delectation and derision. After a bit of a fight I got a Grigori Statesman with the Inquisitor ability at Code of Laws. Even got it to use the right art!
Next up a Fisherman 'cos sometimes it's easier to travel five tiles across land rather than sail all the way round the Cape of Good Hope. I've copied and pasted the text from my statesman entry and changed the class to Fisherman, likewise the UnitClassInfo. However when I load I get a cryptic error about unitClass_Fisherman. I'm sure it's something incredibly simple that I'm missing, but I'm jiggered if I can spot it.
Files enclosed.
<Civ4UnitClassInfos xmlns="x-schema:Magpie_CIV4UnitSchema.xml">
[COLOR="Red"]<UnitClassInfos>[/COLOR]
<UnitClassInfo> <!-- STATESMAN -->
<Type>UNITCLASS_STATESMAN</Type>
<Description>Grigori Statesman</Description>
<iMaxGlobalInstances>-1</iMaxGlobalInstances>
<iMaxTeamInstances>-1</iMaxTeamInstances>
<iMaxPlayerInstances>-1</iMaxPlayerInstances>
<iInstanceCostModifier>0</iInstanceCostModifier>
<DefaultUnit>UNIT_STATESMAN</DefaultUnit>
</UnitClassInfo>
[COLOR="Red"]</UnitClassInfos>
<UnitClassInfos>[/COLOR]
<UnitClassInfo>
<Type>UNITCLASS_FISHERMAN</Type>
<Description>Fisherman</Description>
<iMaxGlobalInstances>-1</iMaxGlobalInstances>
<iMaxTeamInstances>-1</iMaxTeamInstances>
<iMaxPlayerInstances>-1</iMaxPlayerInstances>
<iInstanceCostModifier>0</iInstanceCostModifier>
<DefaultUnit>UNIT_FISHERMAN</DefaultUnit>
</UnitClassInfo>
[COLOR="Red"]</UnitClassInfos>[/COLOR]
</Civ4UnitClassInfos>
<Civ4UnitClassInfos xmlns="x-schema:Magpie_CIV4UnitSchema.xml">
[COLOR="Red"]<UnitClassInfos>[/COLOR]
<UnitClassInfo> <!-- STATESMAN -->
<Type>UNITCLASS_STATESMAN</Type>
<Description>Grigori Statesman</Description>
<iMaxGlobalInstances>-1</iMaxGlobalInstances>
<iMaxTeamInstances>-1</iMaxTeamInstances>
<iMaxPlayerInstances>-1</iMaxPlayerInstances>
<iInstanceCostModifier>0</iInstanceCostModifier>
<DefaultUnit>UNIT_STATESMAN</DefaultUnit>
</UnitClassInfo>
<UnitClassInfo>
<Type>UNITCLASS_FISHERMAN</Type>
<Description>Fisherman</Description>
<iMaxGlobalInstances>-1</iMaxGlobalInstances>
<iMaxTeamInstances>-1</iMaxTeamInstances>
<iMaxPlayerInstances>-1</iMaxPlayerInstances>
<iInstanceCostModifier>0</iInstanceCostModifier>
<DefaultUnit>UNIT_FISHERMAN</DefaultUnit>
</UnitClassInfo>
[COLOR="Red"]</UnitClassInfos>[/COLOR]
</Civ4UnitClassInfos>
Well, you could say that. Except that what you described caused an exception on any unit that wasn't invisible, and he let me know about the pUnit.getNumInvisibleTypes() function which was the missing piece that I mentioned.
Not that I don't appreciate your help either way!
Next up a Fisherman 'cos sometimes it's easier to travel five tiles across land rather than sail all the way round the Cape of Good Hope. I've copied and pasted the text from my statesman entry and changed the class to Fisherman, likewise the UnitClassInfo. However when I load I get a cryptic error about unitClass_Fisherman. I'm sure it's something incredibly simple that I'm missing, but I'm jiggered if I can spot it.
Thanks guys. I'd better sneak away quietly. There appear to be a host of ninjas in this thread
for i in xrange(pUnit.getNumInvisibleTypes()):
if (pUnit.getInvisibleType(i) > 0):
do stuff
pUnit.getNumInvisibleTypes() > 0
If you want an entirely new variable on plots, it would have to be done in the DLL. It is a VERY simple addition, though, in just CvPlot(cpp and h), CyPlot(cpp and h), and CyPlotInterface.
Last three are just for python access.