Sectors

From SphereWiki
Revision as of 18:17, 7 June 2009 by MrSugarCube (talk | contribs) (Created page with '__FORCETOC__ The world is split into fixed-size sectors (by default, 64x64 tiles). Environmental settings (light, weather, etc) are stored on a per-sector basis. Accessing sector...')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The world is split into fixed-size sectors (by default, 64x64 tiles). Environmental settings (light, weather, etc) are stored on a per-sector basis. Accessing sectors in scripts can be accomplished using the SECTOR reference from a character, item or map point object. The following table details the various properties of the sector object in SphereServer:


Properties and Functions

Here is a list of all sector 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
ALLCHARS command R Executes command on all characters inside the sector.
ALLCHARSIDLE command R Executes command on all disconnected characters inside the sector.
ALLCLIENTS command R Executes command on all clients inside the sector.
ALLITEMS command R Executes command on all items inside the sector.
CLIENTS R Gets the number of clients in the sector.
COLDCHANCE RW Gets or sets the chance of snow for the sector.
COMPLEXITY R Gets the number of characters in the sector.
COMPLEXITY.HIGH R Returns 1 if the sector has a high complexity. (less than 5 characters)
COMPLEXITY.MEDIUM R Returns 1 if the sector has a medium complexity. (less than 10 characters)
COMPLEXITY.LOW R Returns 1 if the sector has a low complexity. (10+ characters)
DRY R Sets the weather to dry.
ISDARK R Returns 1 if the light level in the sector is considered to be dark.
ISNIGHTTIME R Returns 1 if the local time of day is between 9pm and 7am.
ITEMCOUNT R Returns the number of items in the sector.
LIGHT RW Gets or sets the light level for the sector.
LOCALTIME R Gets the local time of day, as a descriptive string.
LOCALTOD R Gets the local time of day, in minutes.
RAIN W Sets the weather to raining.
RAINCHANCE RW Gets or sets the chance of rain for the sector.
RESPAWN ALL W Resurrects dead NPC characters (not corpses). If ALL is provided then all sectors will be affected.
RESTOCK ALL W Restocks all NPCs in the sector. If ALL is provided then all sectors will be affected.
SEASON RW Gets or sets the current season in the sector.
SNOW W Sets the weather to snowing.
WEATHER RW Gets or sets the current weather in the sector.