Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Excerpt

An array of player starting positions on the map.

 

Overview

When you start a game, you see starting positions shown on the map preview – 'startPositons' is an array of Position objects defining the co-ordinates of those starting positions.

The array indexes are position numbers, not player IDs. So startPositions[0] returns a position object for starting position 0.

To work out what position a particular player is in, use:

startPositions[playerData[playerID].position]

You can use start positions to get an idea of where player bases are on the map. Note, however, that players (especially humans) might choose to build their base (or some of it) somewhere else on the map.

Properties

Each (numerically referenced) element in the array contains an object that defines the x,y of a starting position on the map.

PropertyTypeDescriptionGame Version
xNumberThe x co-ordinate of the player's starting position3.1 Beta 1
yNumberThe y co-ordinate of the player's starting position3.1 Beta 1
typeConstantPOSITION3.1 Beta 11

Examples

Code Block
themeRDark
languagejavascript
titleWhat is my starting position?
linenumberstrue
// work out what position I started in
var myStartPosition = playerData[me].position;
// now get the map coords of that position
var myStartXY = startPositions[myStartPosition];
 
// trace to console
console("Position "+myStartPosition+" at (x,y): "+myStartXY.x+","+myStartXY.y);
Div
classbox ping notice

The array index is not the player ID, it is the position ID on the map.

Div
classbox
Availability
Status
colourGreen
title3.1 b1+

Requires:

  • Warzone 3.1 Beta 1 and above
  • The return value was updated in Warzone 3.1 beta 11
Div
classbox
Contents

Jump to:

Table of Contents
maxLevel5

Div
classbox

See also

Related articles: