GetTerrainCoverValue function

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

Post Reply
VR_Nocturne
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 62
Joined: Thu Aug 04, 2011 12:51 am

GetTerrainCoverValue function

Post 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?
pipfromslitherine
Site Admin
Site Admin
Posts: 9920
Joined: Wed Mar 23, 2005 10:35 pm

Re: GetTerrainCoverValue function

Post 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
follow me on Twitter here
VR_Nocturne
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 62
Joined: Thu Aug 04, 2011 12:51 am

Re: GetTerrainCoverValue function

Post 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 3023 times
pipfromslitherine
Site Admin
Site Admin
Posts: 9920
Joined: Wed Mar 23, 2005 10:35 pm

Re: GetTerrainCoverValue function

Post 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
follow me on Twitter here
VR_Nocturne
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 62
Joined: Thu Aug 04, 2011 12:51 am

Re: GetTerrainCoverValue function

Post 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.
jcb989
Colonel - Fallschirmjäger
Colonel - Fallschirmjäger
Posts: 1423
Joined: Fri Nov 05, 2010 12:02 am
Location: Bradenton, Florida

Re: GetTerrainCoverValue function

Post by jcb989 »

Side question - What is considered "moving" with respect to tiles? Does "hunt mode" qualify as moving by this definition?
VR_Nocturne
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 62
Joined: Thu Aug 04, 2011 12:51 am

Re: GetTerrainCoverValue function

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

Return to “Battle Academy 2: Modders Corner”