Scavenger player number

Get some help with creating maps or modding.
Need a map editor or other tools, look here!
User avatar
aubergine
Professional
Professional
Posts: 3462
Joined: 10 Oct 2010, 00:58

Scavenger player number

Post by aubergine »

In FlaME, scavs get player number "S". Does anyone know what that translates to in the actual game?

On 2 player maps, S --> 3

On 4 player maps, S --> 7 (I think?)

What number are they on 3, 5, 6, 7, 8, 9 and 10 player maps?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Cyp
Evitcani
Evitcani
Posts: 784
Joined: 17 Jan 2010, 23:35

Re: Scavenger player number

Post by Cyp »

Code: Select all

int scavengerSlot()
{
	// Scavengers used to always be in position 7, when scavengers were only supported in less than 8 player maps.
	// Scavengers should be in position N in N-player maps, where N ≥ 8.
	return MAX(game.maxPlayers, 7);
}
User avatar
aubergine
Professional
Professional
Posts: 3462
Joined: 10 Oct 2010, 00:58

Re: Scavenger player number

Post by aubergine »

They are still player #3 in 2 player maps like sk-startup...?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Cyp
Evitcani
Evitcani
Posts: 784
Joined: 17 Jan 2010, 23:35

Re: Scavenger player number

Post by Cyp »

aubergine wrote:They are still player #3 in 2 player maps like sk-startup...?
Not as far as I know.
User avatar
aubergine
Professional
Professional
Posts: 3462
Joined: 10 Oct 2010, 00:58

Re: Scavenger player number

Post by aubergine »

They are - I just checked. On 2 player maps, scavenger faction has always been player #3. On bigger maps (3+ players) the code you posted is correct, but it looks like it might need updating to properly accommodate the 2 player map scenario.

EDIT: Player #3 as in the player id is 3, not 2.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Cyp
Evitcani
Evitcani
Posts: 784
Joined: 17 Jan 2010, 23:35

Re: Scavenger player number

Post by Cyp »

Weird... Do scavengers actually work on 2-player maps?
User avatar
aubergine
Professional
Professional
Posts: 3462
Joined: 10 Oct 2010, 00:58

Re: Scavenger player number

Post by aubergine »

Yes - see sk-startup 2 player map (bundled with warzone). It's one of my favourite maps for testing stuff out so I use it regularly.

On 2 player maps the scavs player index has always been 3, test it out via the debug menu.

EDIT: If for some reason that gets changed to player index 7, please make sure that something changes in the JS API so I can version detect and accommodate the change. Ideally the scavengerPlayer global (already in Master and 3.2 IIRC) should be added to the API for 3.1 branch sooner rather than later.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
aubergine
Professional
Professional
Posts: 3462
Joined: 10 Oct 2010, 00:58

Re: Scavenger player number

Post by aubergine »

Docs for scavengerPlayer JS API global: https://warzone.atlassian.net/wiki/disp ... ngerPlayer

Backport script to make that available in pre-3.2 APIs: https://warzone.atlassian.net/wiki/disp ... rPlayer.js
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Cyp
Evitcani
Evitcani
Posts: 784
Joined: 17 Jan 2010, 23:35

Re: Scavenger player number

Post by Cyp »

I tested in the debug menu on Sk-Startup, and the scavengers seemed to be player 7, not player 3. How are you getting something different?
User avatar
aubergine
Professional
Professional
Posts: 3462
Joined: 10 Oct 2010, 00:58

Re: Scavenger player number

Post by aubergine »

Ah, I was running an old master release to do some JS API auditing. Yes, they are player 7 now. Hrm, now I need to work out what version that change was made to... They were certainly player 3 (on 2 player maps) back in 3.1 beta 1.

Out of interest, why not just always have scavs be game.maxPlayers? Then there will always be sequential numbering of all active players in the game... 0..X = normal/AI players, X+1 = scavs
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Cyp
Evitcani
Evitcani
Posts: 784
Joined: 17 Jan 2010, 23:35

Re: Scavenger player number

Post by Cyp »

The reason for not just always using game.maxPlayers was for compatibility with already-existing 2- and 4-player maps, where the scavengers were in position 7.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Scavenger player number

Post by Per »

That is strange. From what I can remember, scavengers for old <=8 player maps have always been player index 7.