Status

From AGI Wiki
Revision as of 18:48, 23 April 2019 by Andrew Korson (talk | contribs) (Created page with "The '''status''' command displays the inventory screen. == Syntax == status(); == Remarks == The inventory screen is a text mode screen that lists all inventory item...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

The status command displays the inventory screen.

Syntax

status();

Remarks

The inventory screen is a text mode screen that lists all inventory items that are currently in the player's inventory (meaning they have a room number value of 255). The items are displayed in two columns, with the left column left-justified and the right column right-justified. The screen includes header text "You are carrying:" centered on the top line. If there are no items in the player's inventory, "Nothing" is displayed, centered just below the header. The colors for the inventory screen are always black text on a white background; the set.text.attribute command does not affect the inventory screen.

There are two modes for the inventory screen, depending on the value of reserved flag f13 (inventory selection enabled). If f13 (inventory selection enabled) is reset to FALSE, AGI halts the game while the inventory screen is displayed, until the player presses any key. The game then returns to the graphics screen and resumes.

If f13 (inventory selection enabled) is set to TRUE, the inventory screen enables the player to select an item. The player can use the cursor keys to highlight an item. Pressing ENTER chooses the item, while pressing ESC cancels the selection. AGI then returns to the graphics screen and resumes.

Reserved variable v25 (selected inventory item) is set to selected item's index from the OBJECT file. If ESC was pressed, v25 is set to 255. If there is nothing to select, v25 is set to 0. Note that if v25 is set to the index number of any item in the player's inventory prior to calling status, that item will be selected by default when the inventory screen is displayed.

Possible Errors

Do not use the status command when the text screen is active. Because of the way AGI handles color settings, the status command will clear the screen to black (not white) and doesn't display the header, but the items still show as black text on white background. After the status screen is dismissed, AGI will also go back to the the graphics screen even if called from the text screen.

Example

Code:
reset(inv_select_enabled);
status();  [ just  displays inventory; no selection possible
...
set(inv_select_enabled);  [ enable selection
selectedItem = 0;         [ make sure nothing is pre-selected
status();
if(selectedItem !=0 && selectedItem != 255)
  { [ if something was selected
  v90 = selectedItem;
  v90 += 200; [ item views are offset by 200
  show.obj.v(v90);
  }

Technical Information

Required Interpreter Version: Available in all AGI versions.
Byte-Code Value: 124 (0x7C hex)

See Also

Inventory Item Commands