Versions Compared

Key

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

Functions for labelling objects...

 

What are labels?

Section
Column

A label is a string that can be associated with an object, and later used to retrieve that object:

  • A label can only be associated with one object at a time
  • An object can have multiple labels at the same time

They are mostly used to provide named references for map-placed objects, such as structures and areas, so that scripts can retrieve them without needing to use hard-coded object or co-ordinate references.

Column

Image Modified

Which objects can be labelled?

You can label any of the Warzone Objects, with the exception of Data objects:

Section
Column
width33%

(tick) Game objects:

Child pages (Children Display)
pageGame objects

Column
width33%

(tick) Location objects:

Child pages (Children Display)
pageLocation Objects

Column
width33%

(error) Data objects

Child pages (Children Display)
pageData Objects

Notes:

  • When a Game object gets destroyed its associated label is removed.
  • Location objects are removed when they no longer have any labels associated with them.
  • Apparently, groups can be labelled as well.

How do I create labels?

There are three ways to create labels:

  • Use a map editor, like FlaME, to define and label an object
  • Define them manually in the labels.ini file associated with a map – remember to specify the "label" property!
  • Create a custom location object in a script and use addLabel() to label it

There are discussions taking place in the forums and also a wiki page that propose possible naming conventions for labels.

Are they private to my script?

No - labels and their associated objects are shared between all scripts, including those running on network peers:Image Removed. And this is perhaps the most important thing to understand when using labels.

<more info to follow>

Are they persistent?

Labels are stored in save games, and will be restored when they are loaded.

Labels defined in a map or labels.ini can be changed at runtime, by assigning those labels to some other object, and those changes will persist in save games, but not the original map or labels.ini. So, if you start a new game, the original labels from the map or labels.ini will be reinstated.

Div
classbox
Availability
Status
colourYellow
title3.1 b2+

Requires:

  • Warzone 3.1 Beta 2 or above
  • Warzone 3.2 or above recommended

The majority of label features were added or improved in Warzone 3.2

Div
classbox
Contents

Jump to:

Table of Contents
maxLevel5

Include Page
.jslinks-labels
.jslinks-labels