Comments (3)
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.
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.
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)
- Docs: Improve DamageType and UnitSizeType documentation
- Docs: Improve GameType documentation
- Direct_SNP Crash if Not Launched As Admin HOT 1
- Enable stylechecker/linter/analysis tool
- getScreenPosition behaves different for client and module bots HOT 1
- Potential Issues with OnRenegade
- Any possible plans to support higher-level api written in a script language, e.g. python? HOT 2
- Remove ICCup plugin for ChaosLauncher
- Possibly uninitialized data deref in SNP module HOT 4
- Starcraft is started in battle.net now, is the tool still working? HOT 3
- Lack of data? HOT 3
- Phre
- How Can I Use 1.08 Version? HOT 2
- Change replay naming to use mapFileName instead of mapName
- Terran_Barracks unit said unable to train HOT 7
- canBuildHere mineral vs depot check is not correct
- Protoss Assimilator does not fire created even due to wasAlive flag set to true when first created (fix included in issue) HOT 5
- I should be able to nuke if I own a silo containing a nuke even if the nuke is owned by a different player
- I'm going crazy.....bwapi 4.1.2 fail to load HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bwapi.