Rooms

From SphereWiki
Revision as of 14:18, 20 July 2013 by Ben (talk | contribs) (Updated room with tag functions)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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.
CLEARTAGS prefix W Removes all TAGs from the room that start with the given prefix.
CLIENTS R Gets the total number of clients that are inside the sectors that touch the room.
EVENTS +/-regiontype_defname RW Gets a list of attached room events, or adds or removes a room event to or from the room.
ISEVENT.regiontype_defname R Returns 1 if the room has a specified room event attached.
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.
TAGAT.index R Gets a TAG at the given zero-based index.
TAGAT.index.KEY R Gets the name of the TAG at the given zero-based index.
TAGAT.index.VAL R Gets the value of the TAG at the given zero-based index.
TAGCOUNT R Gets the number of TAGs stored on the room.
TAGLIST W Outputs a list of the room's TAGs.
UID R Gets the room's unique ID in the world.

Triggers

Here is a list of all room triggers. Click on the trigger name for more detailed information such as arguments and examples.

Name Description
@Enter Fires when a character enters the room.
@Exit Fires when a character exits the room.
@Step Fires whenever a character takes a step within the room.