Terrain Effects on Unit Healt HOW?

zinyak

Chieftain
Joined
Nov 27, 2005
Messages
8
Quote to self :
I was wondering if is it possible to hurt a unit if it stays on a desert or jungle title without any improvement.?? I guess it needs to be done using a python script.

Any idea of where to start? :mischief:

I found how to do it now its time to actualy do it lol, Hope this will give you a clear idea of what i am bout (TRY) to do:

Get All units on Mountain, Jungle, or Desert titles
Check Tech
Damage​

Check for war
Get All units on Enemy territory
Check title improvements
Damage​

Get all unsupplied Cities
Damage​

Wish me luck
 
Sorry !, forgot about rules, anyway, any idea ?? is it even possible to damage units standing on a jungle/mountain title?

I want to do it because it would make the game more "strategic".

Thanks in advance !
 
After looking through the "CIV4FeatureInfos.xml" file there is a health percent tag, but I'm sure that only relates to building cities on that type of terrain. I don't see anything relative to units. I don't see anything in any of the unit XML files either. Sounds like a Python project. Unfortunately, I don't know much about Python yet either.
 
1. Learn python.
2. Look at how other mods are made.
3. Experiment.

Here and here you have information on what functions you can use. They're almost the same so it shouldn't make a diffrence which you use.

My suggestion would be a loop at the start of a players turn looking at all the players units. In that case (and most other cases) CvEventsManager.py is the file you want to edit.
 
Thanks snarko, i was thinking the same think.

I only wanned to find an XML aproach but.. well.. and i know python already, i will post my mod as soon as i get it to work.

Here are my ideas:

- Any title, specially : Jungle / Desert / Ice will damage units per turn if there is not an improvement on that title (so we can simulate supply lines)
- Mountains will be passable but will cause damane on units until some techs are discovered some great defensive bonusses and perhaps vision bonus to units on top of mountains

Any other ideas ?
 
Well.. its almost done, took me a while 'cos my work but i can now:

Identify terrain, improvements, features (jungle or ice), plot types and food. Futher more i can tell when im in hostile territory which makes it even more interesting.

I will release this mod soon and here is a little preview:

- Units who can go over peaks will receive damanage for each title (except choppers), until certain tech is discovered (to be determinated)

- Units moving on jungle/ice/desert titles will be damaged, the amount will be different for each type of combat type, so horse units will be less affected. This will simulate dangerous terrain.

- Units in hostile territory will be damage if they pass over a title with no improvement (town, cottage, farm etc.. but not mines) or with less than 3 food in it, this will be on until the owner of the unit discovers some tech (TBD) this, in order to simulate attrition in times of war.

- And some features i just dont remember.

Now this is going to give defenders a huge advance, so i can use some ideas to balance this one.

Greetings and excuse my poor little english spelling
 
kind of suggests to me that one ability of any camel unit should be resistance to damage from desert..
 
Back
Top Bottom