Covervalue fails

Download scenarios and talk about scenario design.
Moderators: Slitherine Core, BA Moderators

Moderators: Slitherine Core, BA Moderators

Post Reply
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

Covervalue fails

Post by enric »

I noticed that when a tile has been defined as Forest and with a some blocking tree, if you add wire the tile cover values disappears.
For example an infantry in wood should not be spotted but if the tile as Wire the tile is like Open ground.

In the example the infantry may fire suppression to one of the wood tiles, but not to the other because it contains wire.

The question is, is there a way to fix it with scripting?
wire1.jpg
wire1.jpg (115.57 KiB) Viewed 3312 times
wire2.jpg
wire2.jpg (134.95 KiB) Viewed 3312 times
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

Re: Covervalue fails

Post by enric »

Posting more info

IF you ask for

Log("GetTileCoverFlag",GetTileCoverFlag(tilex,tiley));

you get 0 or 1, and it seems that when two TERRAINS are in the same place it takes preference the
COVERFLAGS 0

Should be a way to give priority to
COVERFLAGS 1 i.e. is there are more than a type, the 1 should take preference logically
pipfromslitherine
Site Admin
Site Admin
Posts: 9714
Joined: Wed Mar 23, 2005 10:35 pm

Re: Covervalue fails

Post by pipfromslitherine »

I think that the results are indeterminate if there are two objects on a tile which alter the cover value. You could try removing them and applying them in the opposite order to see if it will give you the result you want.

Cheers

Pip
follow me on Twitter here
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

Re: Covervalue fails

Post by enric »

But this won't solve the problem, as I made a scenario where the player may deploy some wire, so the wire will be always the last on the tile.
Either way I tried different order in the editor and the result is always the same. It seems that COVERFLAGS 0 takes over any other.

Can COVERFLAGS be another value than 0/1 ?, for example a -1 for indicating that don't interfere with other objects COVERFLAGS ?
Have you any suggestion?
pipfromslitherine
Site Admin
Site Admin
Posts: 9714
Joined: Wed Mar 23, 2005 10:35 pm

Re: Covervalue fails

Post by pipfromslitherine »

Coverflags can be other values yes, its a 32bit in. The system uses bit 0 to determine LOS operation, so in theory you could use the other bits to do stuff if that works for you.

Cheers

Pip
follow me on Twitter here
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

Re: Covervalue fails

Post by enric »

Is there any function like SetTileCoverflag? as opposite to the existing GetTileCoverFlag?
pipfromslitherine
Site Admin
Site Admin
Posts: 9714
Joined: Wed Mar 23, 2005 10:35 pm

Re: Covervalue fails

Post by pipfromslitherine »

Unfortunately not. You COULD try looking for any forest object when you place down the wire, and removing it, then placing it back down (although could be tricky to make it go back to the same place!) in the order needed to get the terrain value you want...

Cheers

Pip
follow me on Twitter here
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

Re: Covervalue fails

Post by enric »

pipfromslitherine wrote:Unfortunately not. You COULD try looking for any forest object when you place down the wire, and removing it, then placing it back down (although could be tricky to make it go back to the same place!) in the order needed to get the terrain value you want...

Cheers

Pip
I tricked by adding a Wire with a coverflag = 1, when the user place the wire I look at the target tile (GetTileCoverFlag) and place a Wire coverflag 1 if appropriate.
Post Reply

Return to “Battle Academy 2: Scenario Design”