There is no good way to know what position an artillery unit is going to fire at. This is a two part problem...
- If the gunner is a player, then there is no clean way to know the selected map position in the artillery computer, or the position at the time of firing. MapSingleClick EH doesn't work, and getArtilleryComputerSettings doesn't return target position. You have to resort to somewhat complicated loops and process the UI, like in this forum post.
- If gunner is AI, there is no way to know where the unit is firing. Of course, if you're making it fire via doArtilleryFire etc then you will already know the target, but not if the gun is firing by itself. Fired EH doesn't work for this purpose.
Possible solutions:
- In the player case, getArtilleryComputerSettings could be made to return the currently targeted position, or some variant of MapSingleClick EH that works with the artillery computer.
- However, that won't apply to the AI gunner (I assume). In which case, perhaps an ArtilleryFired EH or similar could be helpful that returns the target position and other artillery computer settings if applicable, along with the projectile, gunner etc. If this method covers both AI and player cases then I think it will be preferred than #1 above.
These are lay-person suggestions, there might be better ways to do this!