Defines the player ID for the scavenger faction on the map. |
The scavenger player always uses a fixed player slot on maps, depending on the number of players the map is designed to accommodate.
maxPlayers: | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
---|---|---|---|---|---|---|---|---|---|
scavengerPlayer value: | 7 | 7 | 7 | 7 | 7 | 7 | 8 | 9 | 10 |
Human / AI player id range: (remember they are zero-indexed | 0..1 | 0..2 | 0..3 | 0..4 | 0..5 | 0..6 | 0..7 | 0..8 | 0..9 |
If there are no scavengers on the map (scavengers == false
), the value of scavengerPlayer will be -1.
If you are making a custom scavfact.js (the AI script that controls the scavenger faction), scavengerPlayer == me
.
Remember the scavengerPlayer
constant is only available in Warzone 3.2 and above.
// this is normal way of doing things... if (scavengers) { // scavengers are enabled var scavDroids = enumDroid(scavengerPlayer); // get a list of their droids } // but this approach is probably better... if (scavengerPlayer!=-1) { // there are actually scavs on the map var scavDroids = enumDroid(scavengerPlayer); // get a list of their droids } |
Because of bug #3123 early betas weren't able to get lists of scavenger objects via the enumDroid() and enumStruct() functions - they would throw an error stating that the player ID was invalid. In that scenario, the only way for an AI to get information about scavengers is via objects passed in to events such as eventAttacked() and eventObjectSeen().
If the .player property of the attacker or detected object matches the following criteria, it's a scavenger:
maxPlayers ≤ object.player < 12
So, you can get a rough idea of where scavengers are via eventAttacked() when one attacks you, then build a sensor at that location (or send a sensor droid) to see if you can get more scavenger objects via eventObjectSeen().
There appear to be issues enumerating scavenger structures and droids from within rules.js.
It is currently not possible to determine the colour of the scavenger player from within the JS API.
AvailabilityRequires:
|
ContentsJump to: |
See alsoRelated articles:
|