|
|
|
|
|
by ALittleLight
2453 days ago
|
|
One problem I'm having, when manually editing the code, is using Math functions. Ideally, I'd like to calculate the square root of an expression, but whenever I try to use Math functions I get the error "The Callee's type is MemberExpression which is not allowed". Any advice? |
|
Second, all available functions are accessible by clicking the question mark that shows in the script editor. Some Math functions like "abs", "floor", and "ceil" are exposed to users, but "sqrt" is not. This means that you would have to either write your own implementation or convince me to add it to the game. When I hear "sqrt" in Bot Land, I assume you want to find the distance between two objects, in which case you may be able to use the built-in "getDistanceTo" function. It can either take in an entity or two arguments representing (X, Y) coordinates and returns the Manhattan distance between the bot and the target.
If there's another scenario where you'd like the square root, I'd be glad to consider either accommodating the scenario or just adding access to Math.sqrt directly. If we go that route though, you wouldn't have access to whatever results from it before ~Tuesday of this week at the earliest.