Git Product home page Git Product logo

Comments (3)

dgant avatar dgant commented on July 30, 2024 1

Game.getLastError() provides this information: https://bwapi.github.io/class_b_w_a_p_i_1_1_game.html#ac10b6a4c8fb868151bef1901b859f44e

The different kinds of errors: https://bwapi.github.io/namespace_b_w_a_p_i_1_1_errors.html

from bwapi.

heinermann avatar heinermann commented on July 30, 2024 1

BWAPI doesn't have this functionality yet.

The way lastError works is it gets set during a function call and does not change otherwise. If there would be multiple errors only the first is returned, i.e. not enough minerals for the frame that you called it on, not the frame that Starcraft processes the command. So a command can succeed in BWAPI but fail in Starcraft (no error feedback).

For example, I issue a command to a unit (e.g., attack), and then I call this function immediately (next line of code) after I issue the command to a unit. Will the error code get updated in the same frame, if some error is expected to the command I just issued (e.g., the target of an attack command does not exist)?

If there's a problem with the command BWAPI will return false and set lastError to something, then you can check it with getLastError. But if you successfully issued the command in BWAPI but the target disappeared (thus making it invalid) and it gave an error in Starcraft you wouldn't get any feedback.

Same with ordering a worker to construct something, if another unit runs in the way there's no way to get feedback from BWAPI specifically for that.

from bwapi.

hongdal avatar hongdal commented on July 30, 2024

Game.getLastError() provides this information: https://bwapi.github.io/class_b_w_a_p_i_1_1_game.html#ac10b6a4c8fb868151bef1901b859f44e

The different kinds of errors: https://bwapi.github.io/namespace_b_w_a_p_i_1_1_errors.html

If in the same frame, there are multiple errors happening, I guess in this case some of those errors will be overwritten. Is that correct?

If I call getLastError() multiple times in the same frame, is it possible that I can get different error types?
For example, I issue a command to a unit (e.g., attack), and then I call this function immediately (next line of code) after I issue the command to a unit. Will the error code get updated in the same frame, if some error is expected to the command I just issued (e.g., the target of an attack command does not exist)?

from bwapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.