Page 1 of 1

GetTerrainCoverValue function

Posted: Mon Sep 29, 2014 9:01 pm
by VR_Nocturne
I can't find the definition. I get the what the function is doing from the name (I can read, honest :D), but there's one thing I don't get.

Okay, often I see the function called with three arguments: x, y, and some number - often 0 or 1.

Now, x and y I can kinda figure out (coords of the tile in question), but what's the 0 or 1 represent?

Speaking of which, where are the cover values defined? Let's say I wanted to make forests 85 cover and increase the fortify bonus of a pill box to 8x - where would I go to do this?

Re: GetTerrainCoverValue function

Posted: Tue Sep 30, 2014 9:07 am
by pipfromslitherine
The cover values are defined in the terrain.txt file. The additional parameter is most likely (I am out of the office) whether to return the value for the 'visible' terrain type vs the actual terrain type.

Cheers

Pip

Re: GetTerrainCoverValue function

Posted: Thu Oct 02, 2014 2:34 am
by VR_Nocturne
Okay, found Terrain.txt.

However, the values in the game are not matching up.

For example, here's the cover entry for Forests:

Code: Select all

[Forest]
.
.
.
COVERVALUE0 30		// % damage inflicted if target is stationary 		
COVERVALUE1 60		// % damage inflicted if target is moving 
COVERVALUE2 30		// % chance of getting bogged down when starting turn in this terrain * % chance of bogging so this /5 /10 is about the right amount. 
COVERVALUE3 0		// is this a fortification? 
And here is what I'm seeing in the game. This is on my map I'm working on but it's the same as in the Skirmish I'm having with my friend (it's not my turn right now or I'd show it from there)
And here is what I'm seeing in the game. This is on my map I'm working on but it's the same as in the Skirmish I'm having with my friend (it's not my turn right now or I'd show it from there)
Forest.jpg (104.4 KiB) Viewed 3024 times

Re: GetTerrainCoverValue function

Posted: Fri Oct 03, 2014 11:14 am
by pipfromslitherine
The tooltip shows (IIRC) the average of the moving and stationary values. The tooltip output is also scripted and so can be tweaked in mods. You can also turn on the advanced tooltips which I think show the raw values.

Cheers

Pip

Re: GetTerrainCoverValue function

Posted: Fri Oct 03, 2014 2:59 pm
by VR_Nocturne
I have detailed tooltips on (are those the advanced ones you're mentioning)?

If so, then even the non-moving and moving values shown are higher than the raw values in code.

I have no mods installed.

Re: GetTerrainCoverValue function

Posted: Fri Oct 03, 2014 5:17 pm
by jcb989
Side question - What is considered "moving" with respect to tiles? Does "hunt mode" qualify as moving by this definition?

Re: GetTerrainCoverValue function

Posted: Fri Oct 03, 2014 5:33 pm
by VR_Nocturne
I believe Hunt mode preserves the max effect of cover, assuming "Hunt" is what the player sees that represents "SneakMode" in the code. (I hope so because I don't think I've ever seen a "Sneak" command)


Edit: I see what the code and the tooltip are doing.

Code is showing the % of damage and the tooltip is showing the inverse.

That's why it's not matching up for the moving/non-moving damage. However, I don't understand the cover rating (or it's purpose). Why not just show the actual values? It would be 2 lines instead of one, so not all that much more "info overload" for most players, imo. Not like the detailed "tooltip" (more like mini-essay :D) for attacking.