Difference between revisions of "Map Points"

From SphereWiki
Jump to: navigation, search
m
(Properties and Functions)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
{{Languages|Map_Points}}
 +
 
__FORCETOC__
 
__FORCETOC__
 
A map point is a specific location on a world map, defined by X, Y, Z and M coordinates. Map point references, such as ''P'' from the [[Characters|character]]/[[Items|item]] object and ''MAP(x,y,map)'' from the [[Server|server]] object can be used to access additional information about a map point such as what static items exist at the location. The following tables detail the various properties of map points in SphereServer:
 
A map point is a specific location on a world map, defined by X, Y, Z and M coordinates. Map point references, such as ''P'' from the [[Characters|character]]/[[Items|item]] object and ''MAP(x,y,map)'' from the [[Server|server]] object can be used to access additional information about a map point such as what static items exist at the location. The following tables detail the various properties of map points in SphereServer:
Line 22: Line 24:
 
{| border="1" cellspacing="4" cellpadding="4"
 
{| border="1" cellspacing="4" cellpadding="4"
 
| '''Name''' || '''Read/Write''' || '''Description'''
 
| '''Name''' || '''Read/Write''' || '''Description'''
 +
|-
 +
| [[COMPONENTS]] || R || Gets the number of components of the [[MULTI]] at the location.
 +
|-
 +
| [[COMPONENTS]]''.n.ID'' || R || Gets the ID of the nth component at the location. (zero-based)
 +
|-
 +
| [[COMPONENTS]]''.n.MULTI'' || R || Gets the UID of the MULTI item.
 +
|-
 +
| [[COMPONENTS]]''.n.Z'' || R || Gets the Z level of the nth component at the location. (zero-based)
 +
|-
 +
| [[COMPONENTS]]''.n.KEY'' || R || Gets the ''KEY'' property from the [[ITEMDEF]] of the nth component at the location. (zero-based)
 
|-
 
|-
 
| [[ISNEARTYPE]] ''type, distance, check_multis'' || R || Returns 1 if an item exists within ''distance'' tiles of the location whose [[TYPE]] matches a specified type.
 
| [[ISNEARTYPE]] ''type, distance, check_multis'' || R || Returns 1 if an item exists within ''distance'' tiles of the location whose [[TYPE]] matches a specified type.
Line 38: Line 50:
 
|-
 
|-
 
| [[TERRAIN]] || R || Gets the terrain's ID at the location.
 
| [[TERRAIN]] || R || Gets the terrain's ID at the location.
 +
|-
 +
| [[TERRAIN]].Z || R || Gets the terrain's Z level at the location.
 
|-
 
|-
 
| [[TYPE]] || R || Gets the terrain's TYPE at the location.
 
| [[TYPE]] || R || Gets the terrain's TYPE at the location.

Latest revision as of 18:55, 9 February 2023

Help
Available languages


A map point is a specific location on a world map, defined by X, Y, Z and M coordinates. Map point references, such as P from the character/item object and MAP(x,y,map) from the server object can be used to access additional information about a map point such as what static items exist at the location. The following tables detail the various properties of map points in SphereServer:


References

References return pointers to other objects (e.g. the REGION reference allows you to access the region that contains the map point). These can either be accessed by using <REFNAME> to return the UID (1 for object types that don't have UIDs) of the object or 0 if it doesn't exist, or by using <REFNAME.KEY> where KEY is a valid property/function/reference for the REFNAME object. Click on the name for more detailed information such as usage and examples.

Name Read/Write Description
REGION R Gets the region that contains the map point.
ROOM R Gets the room that contains the map point.
SECTOR R Gets the sector that contains the map point.


Properties and Functions

Here is a list of all map point properties and functions. If a function is marked as readable then it can return a value when used as <KEY>. Click on the name for more detailed information such as usage and examples.

Name Read/Write Description
COMPONENTS R Gets the number of components of the MULTI at the location.
COMPONENTS.n.ID R Gets the ID of the nth component at the location. (zero-based)
COMPONENTS.n.MULTI R Gets the UID of the MULTI item.
COMPONENTS.n.Z R Gets the Z level of the nth component at the location. (zero-based)
COMPONENTS.n.KEY R Gets the KEY property from the ITEMDEF of the nth component at the location. (zero-based)
ISNEARTYPE type, distance, check_multis R Returns 1 if an item exists within distance tiles of the location whose TYPE matches a specified type.
M
MAP
R Gets the location's map number.
STATICS R Gets the number of static items at the location.
STATICS.n.ID R Gets the ID of the nth item at the location. (zero-based)
STATICS.n.COLOR R Gets the hue of the nth item at the location. (zero-based)
STATICS.n.Z R Gets the Z level of the nth item at the location. (zero-based)
STATICS.n.KEY R Gets the KEY property from the ITEMDEF of the nth item at the location. (zero-based)
TERRAIN R Gets the terrain's ID at the location.
TERRAIN.Z R Gets the terrain's Z level at the location.
TYPE R Gets the terrain's TYPE at the location.
X R Gets the X coordinate of the location.
Y R Gets the Y coordinate of the location.
Z R Gets the Z coordinate of the location.