OnUnitCreated is not getting called for starting units in replays
When playing you get this callback for your starting units. In replays you don't.
For some reason in replays, ObservationImp::UpdateObservation is getting called twice before ControlImp::IssueEvents.
@KevinCalderone just a quick question regarding OnUnitCreated.
Is it called when the player has clicked "build this unit" or is it called after it has actually finished producing?
It is called when it finishes producing.
@KevinCalderone Is it possible to trigger an event upon issuing such a command?
You can get it from Observation()->GetRawActions(). That is the list of all actions the user performed since the last gameloop.
That will contain more than just train actions through. To get what the train/build ability_id is for a specific unit, you can look it up at UnitTypeData::ability_id in Observation()->GetUnitTypeData().
I see this issue was referenced in a PR which is already merged. Was this solved?