Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Excerpt |
---|
Get Returns the players object associated with the Scavenger faction, even if Scavengers aren't enabledare disabled. |
Syntax
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
var scavs = Players.scavenger; // returns scav players object |
Return value
The Players Object associated with the Scavenger faction.
Notes
The Players Object will be returned even if Scavengers are not present on the map.
This is useful because the players object's .isAlive property is a much more accurate and concise way to determine if there are Scavengers roaming the map than using the native scavengers and scavengerPlayer globals:
- It checks to see if Scavengers are enabled on the map first
- If they are, it checks to see if they actually have any structures or droids
- The result is cached to keep performance high
Scavengers don't have a start position, so:
Players.scavenger.position == undefined
Example
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
var scavsRoamingMap = Players.scavenger.isAlive; |
Div | ||||||
---|---|---|---|---|---|---|
| ||||||
Availability
Requires:
|
Div | ||||
---|---|---|---|---|
| ||||
ContentsJump to:
|
Div | ||
---|---|---|
| ||
See alsoRelated articles:
|
Div | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
Players APITopics:
|