Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Comment:
Migrated to Confluence 5.3
Overview
Excerpt |
---|
Find out if a specific droid can reach a specific location |
...
from |
...
it's current location |
...
. |
...
Image Removed
...
. |
...
. |
...
...
Availability
Warzone 3.1 Beta 1 and above.
Syntax
Code Block | |
---|---|
|
...
| |||||
var returnValue = droidCanReach(droid, x, y); |
Image Added
Parameters
Parameter | Type | Mandatory |
---|
...
Notes | Game version | |||
---|---|---|---|---|
droid | Droid object | An object representing the droid that will be travelling to x,y | 3.1 Beta 1 | |
x | Number | The x co-ordinate of the destination | 3.1 Beta 1 | |
y | Number | The y co-ordinate of the destination | 3.1 Beta 1 |
Return value
Value | Type |
---|
...
Notes | Game version | ||
---|---|---|---|
true | Boolean | From its current location, the droid can reach x,y | 3.1 Beta 1 |
false | Boolean | The droid is unable to reach x,y from its current position | 3.1 Beta 1 |
<error> | Error | Invalid parameters or droid not found. | 3.1 Beta 1 |
Notes
Some other functions already include this check – such as pickStructLocation() and orderDroidLoc().
The function ignores player built structures (tank traps, walls, etc) and features (trees, skyscrapers, etc). The assumption is that you'll blow them up on the way to your destination.
In Warzone 3.1 RC3 and earlier, droids will not automatically shoot at obstacles that block their route. In Warzone 3.1.0 and above, they will shot at blocking obstacles.
Example
Code Block | |
---|---|
|
...
| |||||
if ( droidCanReach(droid, x, y) ) { // do stuff } |
Div | ||||||
---|---|---|---|---|---|---|
| ||||||
Availability
Requires:
|
Div | ||||
---|---|---|---|---|
| ||||
ContentsJump to:
|
Div | ||
---|---|---|
| ||
See alsoRelated articles:
|