Internal Core.aslx functions
Most games shouldn’t need to call these directly.
_DoRemove
Section titled “_DoRemove”_DoRemove(object)_DoWear
Section titled “_DoWear”_DoWear(object)_GetList
Section titled “_GetList”_GetList(char, slot)_GetOuterForGarment
Section titled “_GetOuterForGarment”_GetOuterForGarment(char, garment)_GetSlotArmour
Section titled “_GetSlotArmour”_GetSlotArmour(char, slot)_GetWornClothingLocation
Section titled “_GetWornClothingLocation”_GetWornClothingLocation()_SetGarmentAlias
Section titled “_SetGarmentAlias”_SetGarmentAlias(object)_SetMultistate
Section titled “_SetMultistate”_SetMultistate(object)_SetVerbList
Section titled “_SetVerbList”_SetVerbList(garment, list, s)_SetVerbsForGarment
Section titled “_SetVerbsForGarment”_SetVerbsForGarment(garment)AddExternalStylesheet
Section titled “AddExternalStylesheet”AddExternalStylesheet(stylesheet)AddStatusAttributesForElement
Section titled “AddStatusAttributesForElement”AddStatusAttributesForElement (status, element, statusAttributes)AddToResolvedNames
Section titled “AddToResolvedNames”AddToResolvedNames(var, result)BlockingMessage
Section titled “BlockingMessage”BlockingMessage(blocked, prefix)CheckLimits
Section titled “CheckLimits”CheckLimits(object, prefix)ClearMenu
Section titled “ClearMenu”ClearMenu()ClearPageDialogueState
Section titled “ClearPageDialogueState”ClearPageDialogueState()CloseObject
Section titled “CloseObject”CloseObject (object)CommandLink
Section titled “CommandLink”CommandLink (string command, string link text)Returns a string containing the XML required to display a hyperlink. When the hyperlink is clicked, the specified player command will be run. For example:
msg (CommandLink("undo", "Click here to undo the previous turn"))outputs a link titled “Click here to undo the previous turn” - when clicked, the “undo” player command is run.
See also: ObjectLink
CompareNames
Section titled “CompareNames”CompareNames(name, value, obj, fullmatches, partialmatches)ContainsAccessible
Section titled “ContainsAccessible”ContainsAccessible (object parent, object child, boolean reachable)Returns a boolean.
ContainsReachable
Section titled “ContainsReachable”ContainsReachable (object parent, object child)Returns a boolean.
ContainsVisible
Section titled “ContainsVisible”ContainsVisible (object parent, object child)Returns a boolean.
CreateGiveMenuList
Section titled “CreateGiveMenuList”CreateGiveMenuList(object)CreateUseMenuList
Section titled “CreateUseMenuList”CreateUseMenuList(object)DisableMenu
Section titled “DisableMenu”DisableMenu()DisableMenuOutputSection
Section titled “DisableMenuOutputSection”DisableMenuOutputSection(section)DisplayHttpLink
Section titled “DisplayHttpLink”DisplayHttpLink(string displaylink,string url, boolean https)Displays a weblink in the gamewindow. Clicking on displaylink will open the url in an external webbrowser. You can specify to use HTTPS or not.
DoAskTell
Section titled “DoAskTell”DoAskTell(object, text, property, defaultscript, defaulttemplate)DoDrop
Section titled “DoDrop”DoDrop(object, ismultiple)DoTake
Section titled “DoTake”DoTake(object, ismultiple)EndOutputSection
Section titled “EndOutputSection”EndOutputSection(name)EscapeQuotes
Section titled “EscapeQuotes”EscapeQuotes(s)FormatStatusAttribute
Section titled “FormatStatusAttribute”FormatStatusAttribute(attr, value, format)GenerateMenuChoices
Section titled “GenerateMenuChoices”GenerateMenuChoices(dictionary, objects)GetCommandBarFormat
Section titled “GetCommandBarFormat”GetCommandBarFormat()GetCoordinateOwner
Section titled “GetCoordinateOwner”GetCoordinateOwner(playerobject)GetCurrentLinkTextFormat
Section titled “GetCurrentLinkTextFormat”GetCurrentLinkTextFormat()GetCurrentTextFormat
Section titled “GetCurrentTextFormat”GetCurrentTextFormat(colour)GetDefaultPrefix
Section titled “GetDefaultPrefix”GetDefaultPrefix(object)Should be defined by the language library (but is only used within the language library, so it is safe to not define this if it is not used). When usedefaultprefix is in use for an object, this should generate the relevant default.
GetDescriptor
Section titled “GetDescriptor”GetDescriptor(object)GetKeywordsMatchStrength
Section titled “GetKeywordsMatchStrength”GetKeywordsMatchStrength(keywords, input)GetLinkTextColour
Section titled “GetLinkTextColour”GetLinkTextColour()GetPlacesObjectsList
Section titled “GetPlacesObjectsList”GetPlacesObjectsList()Required by Quest Viva so it can display the “Places and Objects” list. Returns ScopeVisibleNotHeldNotScenery with the player object excluded.
GetScope
Section titled “GetScope”GetScope(variable, value, objtype)GetScoping
Section titled “GetScoping”GetScoping(scopestring, variable)GetTaggedName
Section titled “GetTaggedName”GetTaggedName (object, string type, stringlist verbs)Returns a string.
This function was removed in Quest 5.4
GetUniqueElementName
Section titled “GetUniqueElementName”GetUniqueElementName (string element name)Returns a string containing the specified name - if necessary with a number added to ensure it is an unused element name.
Grid_AddNewShapePoint
Section titled “Grid_AddNewShapePoint”Grid_AddNewShapePoint (int x, int y)On the custom grid drawing layer, adds a new point to a shape. To draw a custom shape, call this function for each point on the shape, then call Grid_DrawShape to complete the drawing.
Grid_CalculateMapCoordinates
Section titled “Grid_CalculateMapCoordinates”Grid_CalculateMapCoordinates (room, playerobject)Grid_ClearCustomLayer
Section titled “Grid_ClearCustomLayer”Grid_ClearCustomLayer ()Clears the custom grid drawing layer - everything drawn with Grid_DrawLine, Grid_DrawArrow, Grid_DrawSquare and similar - without affecting the auto-generated room/exit layout underneath it.
Grid_DrawArrow
Section titled “Grid_DrawArrow”Grid_DrawArrow (string id, int x1, int y1, int x2, int y2, string border, int borderwidth)On the custom grid drawing layer, draws an arrow of the specified border colour and thickness from (x1,y1) to (x2,y2). The id is arbitrary - if reused, the existing arrow with the same id will be removed.
Grid_DrawGridLines
Section titled “Grid_DrawGridLines”Grid_DrawGridLines (int x1, int y1, int x2, int y2, string border)On the custom grid drawing layer, draws a grid with line of the specified border from (x1,y1) to (x2,y2).
Grid_DrawImage
Section titled “Grid_DrawImage”Grid_DrawImage (string id, string url, int x, int y, int width, int height)On the custom grid drawing layer, draws the image from the specified URL. The id is arbitrary - if you re-use the same id, the existing image will be removed.
Grid_DrawLine
Section titled “Grid_DrawLine”Grid_DrawLine (int x1, int y1, int x2, int y2, string border, int borderwidth)On the custom grid drawing layer, draws a line of the specified border colour and thickness from (x1,y1) to (x2,y2).
Grid_DrawPlayerInRoom
Section titled “Grid_DrawPlayerInRoom”Grid_DrawPlayerInRoom(room)Grid_DrawRoom
Section titled “Grid_DrawRoom”Grid_DrawRoom (room, redraw, playerobject)Grid_DrawShape
Section titled “Grid_DrawShape”Grid_DrawShape (string id, string border, string fill, double opacity)On the custom grid drawing layer, draws an arbitrary shape. First, specify all points using Grid_AddNewShapePoint. Then call this function to place the drawing on the grid, with the specified border and fill colour and opacity between 0 and 1. The id is arbitrary - if reused, an existing shape will be replaced with this one.
Grid_DrawSquare
Section titled “Grid_DrawSquare”Grid_DrawSquare (string id, int x, int y, int width, int height, string text, string fill)On the custom grid drawing layer, draws a square at (x,y) with the specified width and height. A fill colour and some text to display in the centre of the square can also be specified.
Grid_DrawSvg
Section titled “Grid_DrawSvg”Grid_DrawSvg (string instance id, string symbol id, int x, int y, int width, int height)On the custom grid drawing layer, draws the specified SVG file (the symbol id must have been previously loaded using Grid_LoadSvg. The instance id is arbitrary - if you re-use the same instance id, the existing symbol will be removed.
Grid_GetGridCoordinateForPlayer
Section titled “Grid_GetGridCoordinateForPlayer”Grid_GetGridCoordinateForPlayer(playerobject, room, coordinate)Grid_GetPlayerCoordinateDictionary
Section titled “Grid_GetPlayerCoordinateDictionary”Grid_GetPlayerCoordinateDictionary(playerobject)Grid_GetPlayerCoordinatesForRoom
Section titled “Grid_GetPlayerCoordinatesForRoom”Grid_GetPlayerCoordinatesForRoom(playerobject, room)Grid_GetRoomBooleanForPlayer
Section titled “Grid_GetRoomBooleanForPlayer”Grid_GetRoomBooleanForPlayer(playerobject, room, attribute)Grid_LoadSvg
Section titled “Grid_LoadSvg”Grid_LoadSvg (string data, string id)Loads and SVG file and associates it with an id, so it can subsequently be drawn on the custom grid drawing layer using Grid_DrawSvg.
The data parameter is the raw file data for the SVG file - you can load a string with file data using the GetFileData function.
Grid_Redraw
Section titled “Grid_Redraw”Grid_RedrawGrid_SetCentre
Section titled “Grid_SetCentre”Grid_SetCentre (int x, int y)Scrolls the grid map so that (x, y) is centred in the view, instead of automatically following the player.
Grid_SetGridCoordinateForPlayer
Section titled “Grid_SetGridCoordinateForPlayer”Grid_SetGridCoordinateForPlayer(playerobject, room, coordinate, value)Grid_SetRoomBooleanForPlayer
Section titled “Grid_SetRoomBooleanForPlayer”Grid_SetRoomBooleanForPlayer(playerobject, room, coordinate, value)Grid_SetScale
Section titled “Grid_SetScale”Grid_SetScale(scale)Grid_ShowCustomLayer
Section titled “Grid_ShowCustomLayer”Grid_ShowCustomLayer (boolean visible)Shows or hides the custom grid drawing layer (see Grid_ClearCustomLayer), independently of the auto-generated grid map layer underneath it.
HandleCommand
Section titled “HandleCommand”HandleCommand (command)Parses the specified command.
HandleGiveTo
Section titled “HandleGiveTo”HandleGiveTo(object1, object2)HandleMenuTextResponse
Section titled “HandleMenuTextResponse”HandleMenuTextResponse(input)HandleMultiVerb
Section titled “HandleMultiVerb”HandleMultiVerb(object, property, object2, default)HandleNextCommandQueueItem
Section titled “HandleNextCommandQueueItem”HandleNextCommandQueueItem()HandlePageTextResponse
Section titled “HandlePageTextResponse”HandlePageTextResponse(input)HandleSingleCommand
Section titled “HandleSingleCommand”HandleSingleCommand(command)HandleSingleCommandPattern
Section titled “HandleSingleCommandPattern”HandleSingleCommandPattern(command, thiscommand, varlist)HandleUseOn
Section titled “HandleUseOn”HandleUseOn(object1, object2)HideOutputSection
Section titled “HideOutputSection”HideOutputSection(name)HidePreviousTurnOutput
Section titled “HidePreviousTurnOutput”HidePreviousTurnOutput()Hides the output that was shown for the previous turn, leaving only the current turn’s text visible in the transcript.
InitConjugation
Section titled “InitConjugation”InitConjugation()InitInterface
Section titled “InitInterface”InitInterfaceDoes not return a value.
Quest Viva will look for a function called InitInterface in any ASLX file, and if one exists then it will be called when the game begins, and also when loading a saved game.
Core.aslx defines an implementation of a InitInterface function. It does the following:
- sets up the default game fonts and colours
- sets up compass direction names
- sets titles of panes (“Inventory”, “Places and Objects” etc.)
- shows or hides panes depending on the showpanes option
InitPOV
Section titled “InitPOV”InitPOV(oldPOV, newPOV)InitStatusAttributes
Section titled “InitStatusAttributes”InitStatusAttributes()InitVerbsList
Section titled “InitVerbsList”InitVerbsListIsGameRunning
Section titled “IsGameRunning”IsGameRunning ()Returns a boolean indicating whether the game is currently running (i.e. false when the game has finished).
JS_GridSquareClick
Section titled “JS_GridSquareClick”JS_GridSquareClick(parameterstring)JSSafe
Section titled “JSSafe”JSSafe(s)ListObjectContents
Section titled “ListObjectContents”ListObjectContents(object)Lists the contents of the specified object, only if isopen and listchildren are set.
MapPOVCoordinate
Section titled “MapPOVCoordinate”MapPOVCoordinate(sourcedata, targetdata, name, offset)MapPOVCoordinates
Section titled “MapPOVCoordinates”MapPOVCoordinates(source, target)MergePOVCoordinates
Section titled “MergePOVCoordinates”MergePOVCoordinates()ObjectForTextProcessor
Section titled “ObjectForTextProcessor”ObjectForTextProcessor(objectname)ObjectLink
Section titled “ObjectLink”ObjectLink (object)Returns a string containing the XML required to display a hyperlink for the specified object, with its display verbs.
See also: CommandLink
OnEnterRoom
Section titled “OnEnterRoom”OnEnterRoom (oldRoom)Does not return a value.
OpenObject
Section titled “OpenObject”OpenObject(object)P(s)ParamsForTextProcessor
Section titled “ParamsForTextProcessor”ParamsForTextProcessor()Populate
Section titled “Populate”Populate (string regex, string input)There is also an optional cache ID parameter:
Populate (string regex, string input, string cache ID)The input must be a match for the regular expression, or an error occurs.
Returns a stringdictionary, keyed by the group names in the regular expression, with values set to the resolved regex groups.
Use a cache ID for improved performance if you repeatedly test strings against the same regular expression. The compiled regular expression will be cached and used again for subsequent calls to Populate (or GetMatchStrength or IsRegexMatch ) using the same cache ID.
For example, given this regex which matches the text “put (object name) on (object name)”:
put (<object1>.*) on (<object2>.*)Passing this to the Populate function with an input “put book on shelf” will return a stringdictionary where object1=“book” and object2=“shelf”.
See also GetMatchStrength, IsRegexMatch
ProcessTextCommand
Section titled “ProcessTextCommand”ProcessTextCommand(section, data)ProcessTextCommand_Colour
Section titled “ProcessTextCommand_Colour”ProcessTextCommand_Colour(section, data)ProcessTextCommand_Command
Section titled “ProcessTextCommand_Command”ProcessTextCommand_Command(section, data)ProcessTextCommand_Counter
Section titled “ProcessTextCommand_Counter”ProcessTextCommand_Counter(section, data)ProcessTextCommand_Either
Section titled “ProcessTextCommand_Either”ProcessTextCommand_Either(section, data)ProcessTextCommand_Eval
Section titled “ProcessTextCommand_Eval”ProcessTextCommand_Eval(section, data)ProcessTextCommand_Exit
Section titled “ProcessTextCommand_Exit”ProcessTextCommand_Exit(section, data)ProcessTextCommand_Format
Section titled “ProcessTextCommand_Format”ProcessTextCommand_Format(section, data)ProcessTextCommand_GetNextLinkId
Section titled “ProcessTextCommand_GetNextLinkId”ProcessTextCommand_GetNextLinkId()ProcessTextCommand_Here
Section titled “ProcessTextCommand_Here”ProcessTextCommand_Here(section, data)ProcessTextCommand_If
Section titled “ProcessTextCommand_If”ProcessTextCommand_If(section, data)ProcessTextCommand_Img
Section titled “ProcessTextCommand_Img”ProcessTextCommand_Img(section, data)ProcessTextCommand_NotFirst
Section titled “ProcessTextCommand_NotFirst”ProcessTextCommand_NotFirst(section, data)ProcessTextCommand_Object
Section titled “ProcessTextCommand_Object”ProcessTextCommand_Object(section, data)ProcessTextCommand_Once
Section titled “ProcessTextCommand_Once”ProcessTextCommand_Once(section, data)ProcessTextCommand_Page
Section titled “ProcessTextCommand_Page”ProcessTextCommand_Page(section, data)ProcessTextCommand_Popup
Section titled “ProcessTextCommand_Popup”ProcessTextCommand_Popup(section, data)ProcessTextCommand_Random
Section titled “ProcessTextCommand_Random”ProcessTextCommand_Random(section, data)ProcessTextCommand_RandomAlias
Section titled “ProcessTextCommand_RandomAlias”ProcessTextCommand_RandomAlias(section, data)ProcessTextCommand_Select
Section titled “ProcessTextCommand_Select”ProcessTextCommand_Select(section, data)ProcessTextSection
Section titled “ProcessTextSection”ProcessTextSection(text, data)RequestSave
Section titled “RequestSave”RequestSave()Deprecated.
ResetCommandBarFormat
Section titled “ResetCommandBarFormat”ResetCommandBarFormat()ResolveName
Section titled “ResolveName”ResolveName (variable, value, objtype)ResolveNameFromList
Section titled “ResolveNameFromList”ResolveNameFromList(variable, value, objtype, scope, secondaryscope)ResolveNameInternal
Section titled “ResolveNameInternal”ResolveNameInternal (variable, value, objtype)ResolveNameList
Section titled “ResolveNameList”ResolveNameList (value, objtype)ResolveNameListItem
Section titled “ResolveNameListItem”ResolveNameListItem (value)ResolveNameListItemFinished
Section titled “ResolveNameListItemFinished”ResolveNameListItemFinished(result)ResolveNextName
Section titled “ResolveNextName”ResolveNextName()ResolveNextNameListItem
Section titled “ResolveNextNameListItem”ResolveNextNameListItem()RunTurnScripts
Section titled “RunTurnScripts”RunTurnScripts()SecondaryScopeReachableForRoom
Section titled “SecondaryScopeReachableForRoom”SecondaryScopeReachableForRoom(room)SetLinkForegroundColour
Section titled “SetLinkForegroundColour”SetLinkForegroundColour(colour)ShowMenuResponse
Section titled “ShowMenuResponse”ShowMenuResponse(option)StartGame
Section titled “StartGame”StartGameDoes not return a value.
Quest Viva will look for a function called StartGame, and if one exists then it will be called when the game begins, except if the game is being loaded from a .quest-save file.
Core.aslx defines an implementation of a StartGame function. It does the following:
- updates status attributes
- if the game object has a “start” script attribute, runs that
- displays the initial room description
StartNewOutputSection
Section titled “StartNewOutputSection”StartNewOutputSection()StartTurnOutputSection
Section titled “StartTurnOutputSection”StartTurnOutputSection()TestDropGlobal
Section titled “TestDropGlobal”TestDropGlobal(object, prefix)TestExitGlobal
Section titled “TestExitGlobal”TestExitGlobal(exit)TestTakeGlobal
Section titled “TestTakeGlobal”TestTakeGlobal(object, prefix)TextFX_Typewriter_Internal
Section titled “TextFX_Typewriter_Internal”TextFX_Typewriter_Internal(text, speed, font, color, size)TextFX_Unscramble_Internal
Section titled “TextFX_Unscramble_Internal”TextFX_Unscramble_Internal(text, speed, reveal, font, color, size)TryOpenClose
Section titled “TryOpenClose”TryOpenClose (boolean open, object)Does not return a value.
Tsplit
Section titled “Tsplit”Tsplit(splittext)UnescapeQuotes
Section titled “UnescapeQuotes”UnescapeQuotes(s)UnresolvedCommand
Section titled “UnresolvedCommand”UnresolvedCommand(objectname, varname)UpdateObjectLinks
Section titled “UpdateObjectLinks”UpdateObjectLinks()UpdateTranscriptString
Section titled “UpdateTranscriptString”UpdateTranscriptString(data)