units losing lifepoints terraindependent

Zarg

Chieftain
Joined
Feb 7, 2003
Messages
10
Location
Europe
hi all,

i want to create a mod for cIV. a lot of things i want to realize are possible by editing the xml files. but for one thing i didnt find a solution.

i want that units lose lifepoints (percentage or a fixed value) every turn depending on which terrain they are. this should avoid that an early warrior can discover a whole continent early in the game. buildings like forts should prevent the units from losing lifepoints.

i checked the xml references in the wikis and didnt find suitable tags. maybe i missed something ? i didn't deal with python yet. is it possible to realize this with a script ?

i would be very thankful for some ideas of more experienced modders ...

zarg
 
You will want to intercept the onUnitMove python event in CvEventManager.py. That way you can capture each move the unit makes instead of just where they end up.

It should be easy enough to do. Just check the tile they are in and take whatever actions you would like.

The challenge will eb that the AI wont understand where the damage is coming from and may kill itself traveling about.
 
thanks for the infos. it seems that python is the way to go.

ofcourse youre right that the ai will be a problem. i didnt realize that until i couldnt fall asleep yesterday and been thinking about cIV.

need another sleepless night to find a possible solution - maybe ;-)
 
Back
Top Bottom