Skip to content

Options object

Juhana Leinonen edited this page Apr 26, 2022 · 3 revisions

The options object sets the interpreter's settings, mainly related to how game files are loaded. It's stored in a global variable called hugojs_options.

The options must be declared before the ui.js file is loaded. The interpreter's index.html file contains the options object at the end of the file.

Individual options can also be set by passing them as GET parameters in the URL, e.g. example.com/index.html?story=mygame.hex&windowing=false. Options set in the URL override options set in the object. This feature can be disabled with lock_options and lock_story options in the options object.

option default description
allow_upload true If true, the player is prompted to upload their own .hex file to play if one isn't specified anywhere else.
autosave true If false, the autosave feature will be disabled. Any existing autosave file won't be deleted and will load again if the game is later started with the option set to true.
exit_url false The URL to where the browser is redirected when the game ends. If false, there is no redirection. Note that the value is set to "../" (parent directory) in the options object in the interpreter's default index.html file.
lock_options false If true, these options can't be overridden by supplying them in the URL, apart from story (see the lock_story option).
lock_story false If true, the story file can't be supplied in the URL.
proxy_url "https://proxy.iplayif.com/proxy/?url=%s" The URL to the [CORS proxy](CORS proxy) that allows loading game files from other domains, which can't usually be done directly because of browser security restrictions. %s will be replaced by the game file's URL.
story "" URL to the story file. If left empty, the story file must be supplied in the URL.
use_proxy "auto" Either "auto", "always" or "never". Determines when to use the CORS proxy. The "auto" setting uses the proxy only when the game file is on another domain.
windowing true If false, the interpreter will disable all windows except the main window. In practice this means that the status line won't be shown. Useful if the status line is buggy but the game is otherwise playable.
Clone this wiki locally