Skip to content

SCUMM 8 API: Variables

Paul Nicholas edited this page Aug 7, 2018 · 3 revisions

General Properties

The following properties are global to the whole game engine.

  • room_curr

    • Gets or sets the current room being displayed.
  • selected_actor

    • Gets or sets the default Actor and also the one that the player can control.
  • selected_sentence

    • Gets the sentence that the player selected, follows showing a list of dialog options. Dialog sentences have the following properties:
      • num
        • The index number of the selected sentence
  • enable_diag_squeeze

    • Gets or sets whether to allow Actor path-finding to squeeze through a diagonal gap of 1 block (default = false)

User Interface (UI) Variables

The following properties relate to the game engine UI.

  • ui_cursorspr

    • Sets the sprite number to use for the player's cursor (e.g. cross-hair).
  • ui_cursor_cols

    • Sets a list of colours to animate the cursor with, to help identify it against different backdrops.
    • For example:
ui_cursor_cols = {7,12,13,13,12,7}
  • ui_uparrowspr / ui_dnarrowspr

    • Sets the sprite numbers to use for the inventory UP and DOWN buttons.
  • verb_default_inventory_index

    • Sets the index number of the verb to use when clicking items in inventory (e.g. look-at)
    • For example:
verb_default_inventory_index = 5

An example of setting all these UI properties at game start-up is:

function reset_ui()
 verb_maincol = 12  -- main color (lt blue)
 verb_hovcol = 7    -- hover color (white)
 verb_shadcol = 1   -- shadow (dk blue)
 verb_defcol = 10   -- default action (yellow)
 ui_cursorspr = 96  -- default cursor sprite
 ui_uparrowspr = 80 -- default up arrow sprite
 ui_dnarrowspr = 112-- default up arrow sprite
 -- default cols to use when animating cursor
 ui_cursor_cols = {7,12,13,13,12,7}
end

-- perform initial ui setup
reset_ui()

Useful "Internal" Properties

The following properties are for internal use, but can be useful to know.

  • cam_x

    • Gets current X-position of the camera/viewport's left-edge. This can be helpful if, for example, you want to move or trigger something, in relation to the camera position.
  • stage_top

    • Gets the Y-position of the top of the game's stage/viewport (default = 16). This can be helpful if, for example, you are using some custom draw routines, as all other game-drawn objects will be working relative to this Y-position.

Debugging Variables

The following properties can be useful for debugging purposes.

  • show_debuginfo
    • If set to true, will display debugging & performance information, such as the mouse cursor position (relative to room coordinates) and current CPU/Memory usage.