Blizzard / s2client-api

StarCraft II Client - C++ library supported on Windows, Linux and Mac designed for building scripted bots and research using the SC2API.
MIT License
1.66k stars 281 forks source link

Collected Vespene score remains 0 during the whole match #286

Open Necdilzor opened 6 years ago

Necdilzor commented 6 years ago

Hello there,

I've been trying to use this API and wanted to register every 10 seconds the current scores of the player. When I use the following code on the OnStep() method

const sc2::ObservationInterface* obs = Observation();
const struct sc2::Score& score = obs->GetScore();
std::cout << "> collected_minerals - " << score.score_details.collected_minerals << std::endl;
std::cout << "> collected_vespene - " << score.score_details.collected_vespene << std::endl;

for some reason collected_vespene remains 0 during the whole match but every other score updates consistently (strangely enough, when a player starts collecting vespene gas the score score.score_details.collection_rate_vespene will update correctly).

I wrote me code directly expanding the replay.cc example.

Thank you.