Special Variables

From AGI Wiki
Jump to: navigation, search

Some variables have special meaning to the interpreter:

Var

Name in defines.txt

Description
v0 room_no

Number of the current room

v1 prev_room_no Number of the previous room
v2 ego_edge_code

Which edge of the screen ego is touching

  • 0 = not touching edge
  • 1 = horizon
  • 2 = right edge
  • 3 = bottom edge
  • 4 = left edge
v3 score Current score
v4 object_touching_edge

Number of an object other than ego that is touching the edge

v5 object_edge_code See ego_edge_code
v6 ego_dir

Direction of ego's motion (see Moving objects for a list of directions)

v7 max_score Maximum score
v8 free_memory The number of 256-byte lots of free memory available for resources
v9 unknown_word_no If the player has entered an unknown word, this is set to the number of that word (i.e., 2 if it's the second word entered). Otherwise, this is 0.
v10 cycle_delay Delay between interpreter cycles, in 1/20 second increments.
v11 clock_seconds Number of seconds on the interpreter's clock (the clock is reset when the game starts)
v12 clock_minutes Number of minutes on the interpreter's clock
v13 clock_hours Number of hours on the interpreter's clock
v14 clock_days Number of days on the interpreter's clock
v15 joystick_sensitivity Sensitivity of the joystick
v16 ego_view_no Number of the view assigned to ego
v17 error_code What type of error has occurred
v18 error_information Extra information about the error
v19 key_pressed The ASCII code of the key that has just been pressed, if any
v20 computer_type Type of computer (0 = PC)
v21 window_close_time Number of half-seconds to wait before closing a window (if 0, the window remains on screen until the user presses a key)
v22 sound_type Number of sound channels (PC = 1, Tandy = 3)
v23 sound_volume Volume of the sound (0 = loudest, 15 = quietest)
v24 (not defined) Specifies the maximum number of characters that the player may enter on the input line. Defaults to 41.
v25 selected_inventory_item If the player has selected an inventory item from the inventory screen, this is set to the number of that item (or 255 if ESC was pressed)
v26 video_mode

Video mode:

  • 0 = CGA (black-cyan-magenta-white CGA palette)(see note)
  • 1 = RGB (blue-yellow-red--green CGA palette)
  • 2 = Hercules
  • 3 = EGA
  • 4 = MCGA

Note: In real CGA with composite monitor, the game displays 160x200 with 16 color but the texts are weird. It's more like playing an AGI game on apple2. On CGA with color monitor, the game displays black and white. On EGA and more recent graphic card, CGA displays black-cyan-magenta-white CGA palette.

See also

Sources

Data types