General functions
CurrentDateUTC
Section titled “CurrentDateUTC”CurrentDateUTC()Returns the int value of the current Unix epoch time in UTC.
Information on the Unix timestamp can be found at Wikipedia
DbgLog
Section titled “DbgLog”DbgLog (string text)If the debugging attribute on game is true, writes text to the browser’s JavaScript/developer console via Log, prefixed with “DEBUGGING: “. Does nothing otherwise. See also DbgMsg.
DbgMsg
Section titled “DbgMsg”DbgMsg (string text)If the debugging attribute on game is true, prints text to the player as a styled paragraph, prefixed with “DEBUGGING: “. Does nothing otherwise. Unlike DbgLog, the output is visible to the player, not just in the developer console - useful for debug output you want to see in-game while testing.
DisableHtmlLog
Section titled “DisableHtmlLog”DisableHtmlLog ()Sets the nohtmllog attribute on game to true. This is checked by other parts of Core.aslx (e.g. transcript handling) to decide whether to write to the game’s own HTML activity log.
DisableTranscript
Section titled “DisableTranscript”DisableTranscript ()Turns off transcript recording. See also EnableTranscript and KillTranscript.
EnableTranscript
Section titled “EnableTranscript”EnableTranscript ()Turns on transcript recording (a saveable log of the game’s text output), unless the player has opted out via the notranscript attribute on game - in which case it calls KillTranscript instead. Normally called via InitiateTranscript rather than directly. See also DisableTranscript.
Eval (string expression, dictionary parameters)or
Eval (string expression)Returns the result of the specified expression.
The parameters dictionary can be used to add variables into the eval context. The parameters will be usable by the evaluated expression.
Example:
params = NewDictionary()dictionary add(params, "x", 50)dictionary add(params, "y", 100)msg(Eval ("x + y", params))This will result in “150” being printed.
GetFileData
Section titled “GetFileData”GetFileData (string file name)Loads the specified file and returns a string containing its contents.
GetFileURL
Section titled “GetFileURL”GetFileURL(string filename)Returns a string containing the full path to the specified file. The file must exist in the same directory as the game. This can be used to access a game’s resources such as sounds and pictures, and pass their URLs to the player UI.
InitiateTranscript
Section titled “InitiateTranscript”InitiateTranscript (string filename)Starts a transcript recording under the given filename (used as the suggested name when the player saves it), printing a confirmation message and then calling EnableTranscript. Pass an empty string to use the game’s own name as the filename.
KillTranscript
Section titled “KillTranscript”KillTranscript ()Permanently disables transcript recording for the rest of the session by setting the notranscript attribute on game, then calls DisableTranscript. Unlike DisableTranscript, this cannot be undone by calling EnableTranscript again.
Log (string text)Writes the string text to the browser’s JavaScript/developer console. This is intended for debugging during game development, not as a player-facing feature.
RunDelegateFunction
Section titled “RunDelegateFunction”RunDelegateFunction (object, string attribute name, any type parameters ...)Return type is specified by the delegate definition.
Runs the specified delegate function on an object.
See Using delegates