Server Markers

From Multiverse

Jump to: navigation, search

Contents

Overview

A marker identifies a point in space in your world. You create a marker by placing it with World Editor. At run-time, each marker has a corresponding Marker object. Markers have a 3D location, orientation, and optional properties and are tied to the instance in which they were loaded. Markers may have built-in features such as point sounds, particle effects, and spawn generators.

For more information on working with markers in World Editor, see World Editor Tasks.

In previous releases, markers were called "waypoints" in the server.

Built-in features

The point sound and particle effect features cause equivalent objects to be spawned in the world. When a player can perceive the object, then the particle effect or sound is enabled on the client. A marker can have multiple point sounds and particle effects.

Spawn generator features cause the creation of spawn generator in the MobManagerPlugin. See the tools documentation for details on configuring a spawn generator.

Marker Properties

Configure marker properties in the World Editor. Select a marker, then in the Properties tab, select "NameValue" and click the "..." button. The properties shown there are available via the corresponding server Marker object.

For details, see World Editor Tasks.

Accessing Markers

You can access Markers with three methods of InstanceClient:

In each case, the first argument to each method is the instance ID (a long, or 64-bit integer).

Finding Markers

Markers can be searched using the Server Object Search API. Use the following search parameters:

  • objectType: Marker.OBJECT_TYPE
  • query: instance of Marker.Search
  • selection: instance of SearchSelection with flags Marker.PROP_POINT, Marker.PROP_ORIENTATION, Marker.PROP_PROPERTIES.

The Marker.Search must have an instance oid (you can only search within a single instance). Marker.Search is a PropertySearch sub-class so you can search by marker property.

The search result is Marker objects with the selected information. Only the marker PROP_* flags are supported (property name selection is not supported). SearchSelection flags RESULT_KEYED and RESULT_KEY_ONLY are both supported.

queryProps = HashMap()
# Add matching properties to queryProps
search = PropertySearch(queryProps)

# Get the instance name and instance template name
selection = SearchSelection()
selection.addProperty(InstanceClient.TEMPL_INSTANCE_NAME)
selection.addProperty(InstanceClient.TEMPL_INSTANCE_TEMPLATE_NAME)

# Search using the default format
instances = SearchManager.searchObjects(ObjectTypes.instance, search, selection)
print "1: " + str(instances)

# Get collection of SearchEntry
selection.setResultOption(SearchSelection.RESULT_KEYED)
instances = SearchManager.searchObjects(ObjectTypes.instance, search, selection)
print "2: " + str(instances)

# Get collection of instance oids
selection.setResultOption(SearchSelection.RESULT_KEY_ONLY)
instances = SearchManager.searchObjects(ObjectTypes.instance, search, selection)
print "3: " + str(instances)
Personal tools