Upset Baby Games

Upset Baby Games

Navigation

ubg_terminal_define_hint

Syntax:

ubg_terminal_define_hint(hints);
Argument name Type Description
hints array[string] array of hints including command name

Returns: (bool)

Description:

Defines an optional hint to be displayed when the user is typing. These hints are detached from the actual commands but can allow some guidance for the user.

Hints should be an array of strings where the first value is the command name and the following values are hints for each argument. Each defined argument can optionally take a flag that specifies its data type. Again, this will not change the datatype passed into your function but it will help with selecting the correct hint to display.

A flag should be encased in square brackets [] at the beginning of the argument. Each argument can also contain a space-separated list of entries to help define multiple options for a given argument.

The available flags are:

  • [string] suggests the user's input to match the argument name itself
  • [real] suggests the user's input to be a number (example acceptable numbers are 1, 1.1, 1.f, -1)
  • [instance] suggests the user's input to match an existing instance name or ID
  • [object] suggests the user's input to match an existing object name
  • [localvar] suggests the usuer's input to match a local variable from the last [instance] or [object] flag (does not include built-in variables)
  • [localvar_builtin] same as [localvar] but only displays the built-in variables
  • [localvar_all] same as [localvar] but contains both built-in and non-built-in variables
  • [globalvar] suggests the user's input to match a custom global variable
  • [room] suggests the user's input to match an existing room name
  • [sprite] suggests the user's input to match an existing sprite name
  • [audio] suggests the user's input to match an existing sound file name
  • [path] suggests the user's input to match an existing path name
  • [font] suggests the user's input to match an existing font name
  • [script] suggests the user's input to match an existing script name

If no flag is specified then it will accept anything and everything as a valid argument.

An example definition may look something like this:

ubg_terminal_define_hint(["game", "[string] restart end"]);

This would provide the hints "restart" and "end" for the command "game".