Difference between revisions of "Rooms"

From SphereWiki
Jump to: navigation, search
(moved Rooms to ROOMDEF)
 
Line 1: Line 1:
#REDIRECT [[ROOMDEF]]
+
__FORCETOC__
 +
Within [[Regions|regions]] you can also define rooms, which are basically 'sub-regions' that exist inside the area which may represent buildings within a town or a boss room within a dungeon. Accessing rooms in scripts can be accomplished using the ROOM reference from a [[Characters|character]], [[Items|item]] or [[Map Points|map point]] object, or the ROOM.room_id reference from the [[Server|server]] object. The following table details the various properties of the room object in SphereServer:
 +
 
 +
 
 +
==Properties and Functions==
 +
Here is a list of all room 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. The properties from the [[ROOMDEF|room definition]] can also be accessed from the room object. If an attempt is made to execute (not read) a command that does not exist on the room, then the command will be called on all sectors that touch the room area.
 +
 
 +
{| border="1" cellspacing="4" cellpadding="4"
 +
| '''Name''' || '''Read/Write''' || '''Description'''
 +
|-
 +
| [[ALLCLIENTS]] ''command'' || W || Executes ''command'' on all clients inside the room boundaries.
 +
|-
 +
| [[CLIENTS]] || R || Gets the total number of clients that are inside the sectors that touch the room.
 +
|-
 +
| [[MAP]] || R || Gets the map that the room exists on.
 +
|-
 +
| [[RECT]] || R || Gets the number of rectangles that this room is made from.
 +
|-
 +
| [[RECT]]''.n'' || R || Gets the nth rectangle that this room is made from.
 +
|-
 +
| [[UID]] || R || Gets the room's unique ID in the world.
 +
|}
 +
 
 +
[[Category: Reference Compendium]]
 +
[[Category: Objects]]

Revision as of 22:12, 10 June 2009

Within regions you can also define rooms, which are basically 'sub-regions' that exist inside the area which may represent buildings within a town or a boss room within a dungeon. Accessing rooms in scripts can be accomplished using the ROOM reference from a character, item or map point object, or the ROOM.room_id reference from the server object. The following table details the various properties of the room object in SphereServer:


Properties and Functions

Here is a list of all room 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. The properties from the room definition can also be accessed from the room object. If an attempt is made to execute (not read) a command that does not exist on the room, then the command will be called on all sectors that touch the room area.

Name Read/Write Description
ALLCLIENTS command W Executes command on all clients inside the room boundaries.
CLIENTS R Gets the total number of clients that are inside the sectors that touch the room.
MAP R Gets the map that the room exists on.
RECT R Gets the number of rectangles that this room is made from.
RECT.n R Gets the nth rectangle that this room is made from.
UID R Gets the room's unique ID in the world.