Skip to content

Internal Core.aslx functions

Most games shouldn’t need to call these directly.

_DoRemove(object)
_DoWear(object)
_GetList(char, slot)
_GetOuterForGarment(char, garment)
_GetSlotArmour(char, slot)
_GetWornClothingLocation()
_SetGarmentAlias(object)
_SetMultistate(object)
_SetVerbList(garment, list, s)
_SetVerbsForGarment(garment)
AddExternalStylesheet(stylesheet)
AddStatusAttributesForElement (status, element, statusAttributes)
AddToResolvedNames(var, result)
BlockingMessage(blocked, prefix)
CheckLimits(object, prefix)
ClearMenu()
ClearPageDialogueState()
CloseObject (object)
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(name, value, obj, fullmatches, partialmatches)
ContainsAccessible (object parent, object child, boolean reachable)

Returns a boolean.

ContainsReachable (object parent, object child)

Returns a boolean.

ContainsVisible (object parent, object child)

Returns a boolean.

CreateGiveMenuList(object)
CreateUseMenuList(object)
DisableMenu()
DisableMenuOutputSection(section)
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(object, text, property, defaultscript, defaulttemplate)
DoDrop(object, ismultiple)
DoTake(object, ismultiple)
EndOutputSection(name)
EscapeQuotes(s)
FormatStatusAttribute(attr, value, format)
GenerateMenuChoices(dictionary, objects)
GetCommandBarFormat()
GetCoordinateOwner(playerobject)
GetCurrentLinkTextFormat()
GetCurrentTextFormat(colour)
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(object)
GetKeywordsMatchStrength(keywords, input)
GetLinkTextColour()
GetPlacesObjectsList()

Required by Quest Viva so it can display the “Places and Objects” list. Returns ScopeVisibleNotHeldNotScenery with the player object excluded.

GetScope(variable, value, objtype)
GetScoping(scopestring, variable)
GetTaggedName (object, string type, stringlist verbs)

Returns a string.

This function was removed in Quest 5.4

GetUniqueElementName (string element name)

hard-coded

Returns a string containing the specified name - if necessary with a number added to ensure it is an unused element name.

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 (room, playerobject)
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 (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 (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 (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 (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(room)
Grid_DrawRoom (room, redraw, playerobject)
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 (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 (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(playerobject, room, coordinate)
Grid_GetPlayerCoordinateDictionary(playerobject)
Grid_GetPlayerCoordinatesForRoom(playerobject, room)
Grid_GetRoomBooleanForPlayer(playerobject, room, attribute)
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
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(playerobject, room, coordinate, value)
Grid_SetRoomBooleanForPlayer(playerobject, room, coordinate, value)
Grid_SetScale(scale)
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 (command)

Parses the specified command.

HandleGiveTo(object1, object2)
HandleMenuTextResponse(input)
HandleMultiVerb(object, property, object2, default)
HandleNextCommandQueueItem()
HandlePageTextResponse(input)
HandleSingleCommand(command)
HandleSingleCommandPattern(command, thiscommand, varlist)
HandleUseOn(object1, object2)
HideOutputSection(name)
HidePreviousTurnOutput()

Hides the output that was shown for the previous turn, leaving only the current turn’s text visible in the transcript.

InitConjugation()
InitInterface

Does 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(oldPOV, newPOV)
InitStatusAttributes()
InitVerbsList
IsGameRunning ()

hard-coded

Returns a boolean indicating whether the game is currently running (i.e. false when the game has finished).

JS_GridSquareClick(parameterstring)
JSSafe(s)
ListObjectContents(object)

Lists the contents of the specified object, only if isopen and listchildren are set.

MapPOVCoordinate(sourcedata, targetdata, name, offset)
MapPOVCoordinates(source, target)
MergePOVCoordinates()
ObjectForTextProcessor(objectname)
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 (oldRoom)

Does not return a value.

OpenObject(object)
P(s)
ParamsForTextProcessor()
Populate (string regex, string input)

There is also an optional cache ID parameter:

Populate (string regex, string input, string cache ID)

hard-coded

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, data)
ProcessTextCommand_Colour(section, data)
ProcessTextCommand_Command(section, data)
ProcessTextCommand_Counter(section, data)
ProcessTextCommand_Either(section, data)
ProcessTextCommand_Eval(section, data)
ProcessTextCommand_Exit(section, data)
ProcessTextCommand_Format(section, data)
ProcessTextCommand_GetNextLinkId()
ProcessTextCommand_Here(section, data)
ProcessTextCommand_If(section, data)
ProcessTextCommand_Img(section, data)
ProcessTextCommand_NotFirst(section, data)
ProcessTextCommand_Object(section, data)
ProcessTextCommand_Once(section, data)
ProcessTextCommand_Page(section, data)
ProcessTextCommand_Popup(section, data)
ProcessTextCommand_Random(section, data)
ProcessTextCommand_RandomAlias(section, data)
ProcessTextCommand_Select(section, data)
ProcessTextSection(text, data)
RequestSave()

Deprecated.

ResetCommandBarFormat()
ResolveName (variable, value, objtype)
ResolveNameFromList(variable, value, objtype, scope, secondaryscope)
ResolveNameInternal (variable, value, objtype)
ResolveNameList (value, objtype)
ResolveNameListItem (value)
ResolveNameListItemFinished(result)
ResolveNextName()
ResolveNextNameListItem()
RunTurnScripts()
SecondaryScopeReachableForRoom(room)
SetLinkForegroundColour(colour)
ShowMenuResponse(option)
StartGame

Does 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()
StartTurnOutputSection()
TestDropGlobal(object, prefix)
TestExitGlobal(exit)
TestTakeGlobal(object, prefix)
TextFX_Typewriter_Internal(text, speed, font, color, size)
TextFX_Unscramble_Internal(text, speed, reveal, font, color, size)
TryOpenClose (boolean open, object)

Does not return a value.

Tsplit(splittext)
UnescapeQuotes(s)
UnresolvedCommand(objectname, varname)
UpdateObjectLinks()
UpdateTranscriptString(data)