Scope functions
Functions that will return a list of objects (in the loosest sense). See Scope.
AllCommands
Section titled “AllCommands”AllCommands()Returns an objectlist of all commands defined in the game.
AllExits
Section titled “AllExits”AllExits()Returns an objectlist of all exits defined in the game.
AllObjects
Section titled “AllObjects”AllObjects()Returns an objectlist of all objects defined in the game.
AllRooms
Section titled “AllRooms”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
Section titled “AllTurnScripts”AllTurnScripts()Returns an objectlist of all turn scripts defined in the game.
GetAllChildObjects
Section titled “GetAllChildObjects”GetAllChildObjects (object)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
Section titled “GetDirectChildren”GetDirectChildren (object)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
Section titled “GetExitsList”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
Section titled “ListVisibleFor”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
Section titled “RemoveDarkObjects”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
Section titled “RemoveLookOnlyExits”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
Section titled “ScopeCommands”ScopeCommands ()Returns an objectlist containing all the commands which are available to the player.
ScopeExits
Section titled “ScopeExits”ScopeExits ()Returns an objectlist containing all the exits which are available to the player (whether locked or not) from the current room.
ScopeExitsForRoom
Section titled “ScopeExitsForRoom”ScopeExitsForRoom(room)Returns an objectlist containing all the exits which are available to the player (whether locked or not) in the specified room.
ScopeInventory
Section titled “ScopeInventory”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
Section titled “ScopeReachable”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
Section titled “ScopeReachableForRoom”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
Section titled “ScopeReachableInventory”ScopeReachableInventory ()Returns an objectlist containing all the objects in the player’s inventory that are in reach.
ScopeReachableNotHeld
Section titled “ScopeReachableNotHeld”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
Section titled “ScopeReachableNotHeldForRoom”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
Section titled “ScopeUnlockedExitsForRoom”ScopeUnlockedExitsForRoom(room)Returns an objectlist containing all the unlocked exits which are available to the player in the specified room.
ScopeVisible
Section titled “ScopeVisible”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
Section titled “ScopeVisibleForRoom”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
Section titled “ScopeVisibleLightsource”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
Section titled “ScopeVisibleNotHeld”ScopeVisibleNotHeld ()Returns an objectlist containing all the visible objects which are not in the player’s inventory.
ScopeVisibleNotHeldForRoom
Section titled “ScopeVisibleNotHeldForRoom”ScopeVisibleNotHeldForRoom (room)Returns an objectlist containing all the visible objects of the specified room which are not in the player’s inventory.
ScopeVisibleNotHeldNotScenery
Section titled “ScopeVisibleNotHeldNotScenery”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
Section titled “ScopeVisibleNotHeldNotSceneryForRoom”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
Section titled “ScopeVisibleNotReachable”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
Section titled “ScopeVisibleNotReachableForRoom”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.