GetLayerName

From Spheriki

Jump to: navigation, search

Returns the name of the given layer of the current map, as seen in the map editor.


Contents

Usage

string GetLayerName();


Examples

This example finds out which layer of the current map is called "base" and sets the input person to that layer. If there are multiple layers with this name, then it will find the lowest one, and if there are no layers with this name, the input person's layer will not be changed.

var num_layers = GetNumLayers();
for (i=0;i<num_layers)
{
  if (GetLayerName(i) == "base")
  {
    break;
  }
}

if (i < num_layers)
  SetPersonLayer(GetInputPerson(), i);


Notes

  • This function will only work while the map engine is running.


See also

Personal tools