Well, I do believe it would be possible to catch any animal units created with a Python call-up and have a script manually change the UnitAIType. Because changing it from UnitAIType.UNITAI_ANIMAL to something else than the default setting should do the trick.
Spoiler:
CvEventManager.py:
Code:
def onUnitCreated(self, argsList):
'Unit Completed'
unit = argsList[0]
[COLOR="Red"] if gc.getUnitInfo(unit.getUnitType()).isAnimal():
unit.setUnitAIType(UnitAITypes.UNITAI_ATTACK)[/COLOR]
What about it doesn't work? I know its possible to change the UnitAIType, and if I give UNITAI_ANIMAL to any unit, it will act like an animal unit. So I'd expect the opposite to be true, also. But I guess not, then.
They don't behave like it. To ensure that "animals" also appear later in my mod, every turn later on some are spawned, but with the attack AI. They can't enter the civs territory, at least that's what i currently remember.
Might be worth again a try to find out what exactly might be needed to change there.
Glad to hear it worked out for you keldath, I used the same code for my own personal mod (wholly unreleased, done more as a learning thing way back)
IIRC, I changed it so that they wouldn't enter cities, it makes sense that they would kill an early settlement, but I just found it so annoying (<-IMHO, probably cause I like to wait a little before training combat units for city defense)
well - i saw the result of the animals, i used in in two dlls i have,
with one it worked with the other - i did a quick test and didnt see animals get in borders,
but i think i need to give those animals a unitai attack, which i did in my first test.
maybe you can write he the code so i can put it in my mod?
**********
on another note -
can some1 help and write a code for me that spawns either barberians and more importantly animals within cultural borders?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.