Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OnUnitIdle override not working #301

Open
marcus1337 opened this issue May 1, 2019 · 3 comments
Open

OnUnitIdle override not working #301

marcus1337 opened this issue May 1, 2019 · 3 comments

Comments

@marcus1337
Copy link

I am following the tutorial here but when I try to print a simple string after overriding OnUnitIdle nothing happens.

This is what I use:
virtual void OnUnitIdle(const Unit* unit) final { std::cout << "TEST" << std::endl.......
Then I create a worker and let it do nothing, but there is no message in the console window.

@piroxiljin
Copy link

I have find out that acquiring of observation is broken because the game sets flag "has_cloak" for some units, but set CloakState to CloakUnknown. sc2api considers this value as error and stops receiving observation.

So, naive solution is to update the convertion routine for CloakState in the sc2_proto_to_pods.cc file.

I'm not sure what the reason of this changes in protocol and don't know if it is a correct solution. But you can try to cherry pick the observation-fix branch from my fork

@marcus1337
Copy link
Author

Cool, I will try it out.

@marcus1337
Copy link
Author

The fix worked for OnUnitIdle, but now OnGameStop() don't get called

    virtual void OnGameStop() final {
        cout << "TEST " << endl;
        Control()->SaveReplay("LastSave.SC2Replay");
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants