Page 1 of 1

GetTerrainCoverValue(x, y, index)

Posted: Fri Jul 19, 2013 7:33 pm
by rf900
I am trying to find a good cover position to unload a unit. But using this function it gives me strange values, seems to give higher values to worse tile cover positions.

These are using index 0:
For example a road tile returns 65, when in game puts cover 18%
Light fortification returns 25, in game is 68
Forest returns 30, in game is 55

Is there another function that returns true cover value? I can work with the current one, but will need to understand it better, other indexes give different values.

Re: GetTerrainCoverValue(x, y, index)

Posted: Sat Jul 20, 2013 12:00 am
by AndrewGardner
Cover value 0 is the % of damage applied to stationary or hunting targets, cover value 1 is the % of damage applied to moving targets. The number reported to players is 100 minus the average of the two values.

The COVERVALUES are specified (and explained) in Data/Terrain.txt.

Re: GetTerrainCoverValue(x, y, index)

Posted: Sat Jul 20, 2013 1:06 am
by AndrewGardner
For armoured targets, the details of how the cover values are used are different, but as with HE, a high number means less cover.