GetTerrainCoverValue(x, y, index)

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

Post Reply
rf900
Staff Sergeant - Kavallerie
Staff Sergeant - Kavallerie
Posts: 339
Joined: Fri May 04, 2012 6:59 am

GetTerrainCoverValue(x, y, index)

Post 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.
AndrewGardner
Slitherine
Slitherine
Posts: 535
Joined: Tue Nov 13, 2012 6:24 pm

Re: GetTerrainCoverValue(x, y, index)

Post 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.
AndrewGardner
Slitherine
Slitherine
Posts: 535
Joined: Tue Nov 13, 2012 6:24 pm

Re: GetTerrainCoverValue(x, y, index)

Post 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.
Post Reply

Return to “Battle Academy : Modders Corner ”