Skip to content

Scope functions

Functions that will return a list of objects (in the loosest sense). See Scope.

AllCommands()

hard-coded

Returns an objectlist of all commands defined in the game.

AllExits()

hard-coded

Returns an objectlist of all exits defined in the game.

AllObjects()

hard-coded

Returns an objectlist of all objects defined in the game.

AllRooms()

Returns an objectlist of all objects defined in the game that have “isroom” set to true. This will generally be all the rooms in the game.

AllTurnScripts()

hard-coded

Returns an objectlist of all turn scripts defined in the game.

GetAllChildObjects (object)

hard-coded

Returns an objectlist containing all objects directly or indirectly contained by the parent object (i.e. including all children of children etc.)

For example, if object A contains object B, and object B contains object C, then GetAllChildObjects(A) returns a list containing B and C.

Use GetDirectChildren instead if you only want children directly contained (in the above example, only B).

GetDirectChildren (object)

hard-coded

Returns an objectlist containing all objects directly contained by the parent object.

Use GetAllChildObjects instead to return all objects directly or indirectly contained (i.e. including children of children).

GetExitsList ()

Returns an objectlist containing the exits from the current room that should be mentioned to the player: ScopeExits with scenery exits and look-only exits filtered out.

ListVisibleFor (object character)

Returns an object list containing all the items worn by the character that are visible, i.e., not covered by another garment. For the current player, pass game.pov.

For more on handling wearable objects, see here.

RemoveDarkObjects (objectlist)

Returns an objectlist: the given list filtered down to objects that should still be visible in the dark - lightsources, plus anything the player is directly holding. Used when building a room’s visible-objects list in the dark.

RemoveLookOnlyExits (objectlist)

Returns an objectlist: the given list of exits with any exits flagged lookonly filtered out. Used by GetExitsList so look-only exits are excluded from the exit list shown to the player.

ScopeCommands ()

Returns an objectlist containing all the commands which are available to the player.

ScopeExits ()

Returns an objectlist containing all the exits which are available to the player (whether locked or not) from the current room.

ScopeExitsForRoom(room)

Returns an objectlist containing all the exits which are available to the player (whether locked or not) in the specified room.

ScopeInventory ()

Returns an objectlist containing all the visible objects which the player has in their inventory.

Used to populate the “Inventory” list, and the list of objects returned by the “inventory” command

ScopeReachable ()

Returns an objectlist containing all the objects which the player can currently reach.

All objects in this scope can be interacted with directly by the player.

This is the union of two lists - ScopeReachableNotHeld (all objects the player can reach in the current room, but are not in the inventory) and ScopeReachableInventory (all the objects the player can reach in their inventory) - plus the player object itself, so that commands can be applied to the player.

ScopeReachableForRoom (room)

Returns an objectlist containing all the objects which are reachable in the specific room.

All objects in this scope can be interacted with directly by the player.

If the player is in the specified room, this function returns the union of two lists - ScopeReachableNotHeldForRoom (all objects the player can reach in the current room, but are not in the inventory) and ScopeReachableInventory (all the objects the player can reach in their inventory) - plus the player object itself. Otherwise it returns ScopeReachableNotHeldForRoom, with no player object in it.

ScopeReachableInventory ()

Returns an objectlist containing all the objects in the player’s inventory that are in reach.

ScopeReachableNotHeld ()

Returns an objectlist containing all the objects which the player can reach in the current room (not including those the player currently has in their inventory).

These objects are in the current room and can be interacted with, but they’re not in the player’s inventory.

ScopeReachableNotHeldForRoom (room)

Returns an objectlist containing all the objects which the player can reach in the specified room (not including those the player currently has in their inventory).

These objects are in the specified room and can be interacted with, but they’re not in the player’s inventory.

ScopeUnlockedExitsForRoom(room)

Returns an objectlist containing all the unlocked exits which are available to the player in the specified room.

ScopeVisible ()

Returns an objectlist containing all the objects which the player can currently see.

These objects can be looked at.

It is the union of two lists - ScopeVisibleNotHeld (all the objects the player can see which are not in the inventory) and ScopeInventory (all the visible objects in the inventory).

ScopeVisibleForRoom (room)

Returns an objectlist containing all the objects in the specified room which the player could see.

These objects can be looked at.

If the player is in the specified room, it is the union of two lists - ScopeVisibleNotHeldForRoom (all the objects the player can see which are not in the inventory) and ScopeInventory (all the visible objects in the inventory). Otherwise it returns the list ScopeVisibleNotHeldForRoom.

ScopeVisibleLightsource (string light strength)

Returns an objectlist containing the visible objects and exits (from ScopeVisible and ScopeExits) that are lightsources with the given light strength (“weak” or “strong” - see SetObjectLightstrength). Used by CheckDarkness to decide whether a dark room is lit.

ScopeVisibleNotHeld ()

Returns an objectlist containing all the visible objects which are not in the player’s inventory.

ScopeVisibleNotHeldForRoom (room)

Returns an objectlist containing all the visible objects of the specified room which are not in the player’s inventory.

ScopeVisibleNotHeldNotScenery ()

Returns an objectlist containing all the visible objects which are not in the player’s inventory, and which are not scenery (having a “scenery” attribute set to “true”).

Used to populate the “Objects” part of the “Places and Objects” list.

ScopeVisibleNotHeldNotSceneryForRoom (room)

Returns an objectlist containing all the visible objects in the specified room which are not in the player’s inventory, and which are not scenery (having a “scenery” attribute set to “true”).

ScopeVisibleNotReachable ()

Returns an objectlist containing all the objects which the player can see but cannot reach.

All objects in this scope can be seen, but can’t be interacted with as they are either “far away” or inside a transparent container.

ScopeVisibleNotReachableForRoom (room)

Returns an objectlist containing all the objects in the specified room which the player can see but cannot reach.

All objects in this scope can be seen, but can’t be interacted with as they are either “far away” or inside a transparent container.