Mercury314
Chieftain
- Joined
- Sep 6, 2007
- Messages
- 43
I was hoping someone could provide me with some insight.
I am currently using the onImprovementBuilt function from the CustomEventManager.
Here, I want to trigger an event at the moment an improvement is built.
Now triggering the event itself is not a problem, however, the onImprovementBuilt function offers no way of establishing the player (or unit and through that the player) responsible for building the improvement (which is information I need).
All it provides me with is the type of improvement and its location.
I thought about checking for a worker unit on the location, but this isn't foolproof because other players may place a worker at the same location. I also thought of checking to see who's turn it is, but because turns take place simultaneously this also doesn't allow me to determine the correct player.
Does anyone have an idea how I can establish the player who actually built the improvement? I would much appreciate the help (and I'll mention you in my mod's credits too ^_^)
I am currently using the onImprovementBuilt function from the CustomEventManager.
Here, I want to trigger an event at the moment an improvement is built.
Now triggering the event itself is not a problem, however, the onImprovementBuilt function offers no way of establishing the player (or unit and through that the player) responsible for building the improvement (which is information I need).
All it provides me with is the type of improvement and its location.
I thought about checking for a worker unit on the location, but this isn't foolproof because other players may place a worker at the same location. I also thought of checking to see who's turn it is, but because turns take place simultaneously this also doesn't allow me to determine the correct player.
Does anyone have an idea how I can establish the player who actually built the improvement? I would much appreciate the help (and I'll mention you in my mod's credits too ^_^)