The_Space_Cows
Chieftain
- Joined
- Mar 18, 2023
- Messages
- 16
I'm making a mod where after adopting a social policy, the player will get +1 gold or culture or something whenever they discover a new tile. Detecting when a player discovers a new tile is hard.
Using DLL - VMC there is an event, GameEvents.TileRevealed, which triggers when a unit gains sight over a tile previously hidden by the fog of war (but still a discovered tile). I can use this to detect if the tile was revealed for the first time by any player, but not if it was revealed for the first time by specifically the player who revealed it sadly.
In the base game there is an method Plot.IsVisible which I believe returns true if the a player has discovered the tile (given that there is another method called IsRevealed). But the logic for keeping track of every tile that every unit might have sight of on its next move is a nightmare I do not want to deal with.
I would like to detect when a player reveals a tile for their first time, regardless of whether or not other players have discovered it. Does anyone know a way to do this?
Using DLL - VMC there is an event, GameEvents.TileRevealed, which triggers when a unit gains sight over a tile previously hidden by the fog of war (but still a discovered tile). I can use this to detect if the tile was revealed for the first time by any player, but not if it was revealed for the first time by specifically the player who revealed it sadly.
In the base game there is an method Plot.IsVisible which I believe returns true if the a player has discovered the tile (given that there is another method called IsRevealed). But the logic for keeping track of every tile that every unit might have sight of on its next move is a nightmare I do not want to deal with.
I would like to detect when a player reveals a tile for their first time, regardless of whether or not other players have discovered it. Does anyone know a way to do this?