Page 1 of 1
Covervalue fails
Posted: Fri Oct 02, 2015 1:48 pm
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 (115.57 KiB) Viewed 3836 times

- wire2.jpg (134.95 KiB) Viewed 3836 times
Re: Covervalue fails
Posted: Fri Oct 02, 2015 2:10 pm
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
Re: Covervalue fails
Posted: Fri Oct 02, 2015 3:15 pm
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
Re: Covervalue fails
Posted: Fri Oct 02, 2015 3:25 pm
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?
Re: Covervalue fails
Posted: Fri Oct 02, 2015 6:15 pm
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
Re: Covervalue fails
Posted: Sat Oct 03, 2015 5:49 am
by enric
Is there any function like SetTileCoverflag? as opposite to the existing GetTileCoverFlag?
Re: Covervalue fails
Posted: Mon Oct 05, 2015 3:35 pm
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
Re: Covervalue fails
Posted: Mon Oct 05, 2015 3:55 pm
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.