-
Notifications
You must be signed in to change notification settings - Fork 13
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
Promise for condition #95
Comments
@JernejHabjan I'd never considered adding support for async condition functions as I'd always thought of condition checks as being instantaneous (preferably inexpensive) operations while the actions themselves would represent long-running operations. I guess the options are:
If the latter is not a valid option for you then I'd be happy to consider the former, I haven't had much in the way of feedback for this library and a fresh perspective is always welcome. |
Hey. Yes promisey action would work in my case. It's just maybe something to consider to also support that? |
I can't think of any downsides to implementing this and it could be useful when we have to rely on inexpensive async operations to get our condition result. I will do this for the next release. Thanks |
## Changes - IsInRange is now promisey task until this is resolved - nikkorn/mistreevous#95 - attack branch is working with await for cooldown - attack branch auto-stops if target is dead - added Log task for easier debugging
Example:
I have an example for "CanMoveToTarget" which returns Promise because in the background I'm using easystarjs to find path, which works async.
Error
Uncaught Error: error stepping tree: expected condition function 'CanMoveToTarget' to return a boolean but returned '[object Promise]'
The text was updated successfully, but these errors were encountered: