EmperorFool
Deity
You've got several syntax errors in there (def vs. Def, must have () after kill call), and it doesn't use upgrade (but maybe that's okay), but it looks okay at first glance. Better to run it and see what happens. 

You've got several syntax errors in there (def vs. Def, must have () after kill call), and it doesn't use upgrade (but maybe that's okay), but it looks okay at first glance. Better to run it and see what happens.![]()
I guess to mention the command setImmobileTimer is to late now...
You've got several syntax errors in there (def vs. Def, must have () after kill call), and it doesn't use upgrade (but maybe that's okay), but it looks okay at first glance. Better to run it and see what happens.![]()
Traceback (most recent call last):
File "CvScreensInterface", line 657, in handleInput
File "CvMainInterface", line 3207, in handleInput
File "MineWarfare", line 237, in ActivateMine
ArgumentError: Python argument types in
CyPlayer.initUnit(CyPlayer, CyUnit, int, int, int, int, CvPythonExtensions.DirectionTypes)
did not match C++ signature:
initUnit(class CyPlayer {lvalue}, int, int, int, enum UnitAITypes, enum DirectionTypes)
pPlayer.initUnit(iUnitUnArmedNavalMine, iPlotX, iPlotY, DefaultUnitAI, DirectionTypes.NO_DIRECTION )
DefaultUnitAI = "UNIT_AI_ATTACK"
DefaultUnitAI = UnitAITypes.UNIT_AI_ATTACK
Weird, the error makes it look like it knows what to do, but I see a problem it's not reporting.
Change
Code:DefaultUnitAI = "UNIT_AI_ATTACK"
to this
Code:DefaultUnitAI = UnitAITypes.UNIT_AI_ATTACK
According to the error message you are passing in pUnit as the first argument, but I don't see it in your code. Did you change it from what you posted earlier?
AttributeError: type object 'CvPythonExtensions.UnitAITypes' has no attribute 'UNIT_AI_ATTACK'
DefaultUnitAI = UnitAITypes.UNIT_AI_ATTACK
DefaultUnitAI = UnitAITypes.NO_UNITAI
As for setImmobileTimer(), I would guess that's used by the events that allow you to choose to have a unit in the city remain "busy" for X turns to handle guarding the food or whatever. It counts down every turn until it reaches zero and then makes the unit mobile again. While you could use this by setting its value to 10000000 or something that will never reach zero, I think I prefer creating a new unit instead. It allows you to have different graphics, too.
SDK, I forget where...
PM Jdog, he knows.
Would be expensive to calculate, "at least 2 tiles away" would look doable though. (Not owned, and not adjancent to owned)Question: Is there code that could identify plots that are 3 to 5 squares away from an enemy cultural border?
That's just it. No.Question: Is there code that could identify geograhical choke points outside of cultural borders?
I believe subs aren't hunted either so that means no. There is no seek&destroy code in bts afaik.Lastly, is there any seek out and destroy python code that I could use for the mine sweepers? Note: I have the destroy side working. I just need a way to compel the AI to seek out mines.
I agree with Fuyu, I don't know why you aren't doing this in the SDK. You'd have much more power and control there.
Why someone with your obvious programming talent with your ideas is still coding in python for this stuff is beyond me.
Would be expensive to calculate, "at least 2 tiles away" would look doable though. (Not owned, and not adjancent to owned)
Isn't it obvious? Once you commit to changing the DLL through SDK, the mod becomes incompatible with and must compete against all of the major mods.