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?
Covervalue fails
Moderators: Slitherine Core, BA Moderators
Re: Covervalue fails
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
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
-
- Site Admin
- Posts: 9714
- Joined: Wed Mar 23, 2005 10:35 pm
Re: Covervalue fails
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
Cheers
Pip
follow me on Twitter here
Re: Covervalue fails
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?
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?
-
- Site Admin
- Posts: 9714
- Joined: Wed Mar 23, 2005 10:35 pm
Re: Covervalue fails
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
Cheers
Pip
follow me on Twitter here
Re: Covervalue fails
Is there any function like SetTileCoverflag? as opposite to the existing GetTileCoverFlag?
-
- Site Admin
- Posts: 9714
- Joined: Wed Mar 23, 2005 10:35 pm
Re: Covervalue fails
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
Cheers
Pip
follow me on Twitter here
Re: Covervalue fails
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.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