Special variables

From AGI Wiki

Jump to: navigation, search

Some variables have special meaning to the interpreter:

Var Name in defines.txt Name in VB Syntax1 Description
v0 room_no CurrentRoom Number of the current room
v1 prev_room_no Previousroom Number of the previous room
v2 ego_edge_code EgoEdgeCode 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 Score Current score
v4 object_touching_edge ObjectTouchingEdge Number of an object other than ego that is touching the edge
v5 object_edge_code ObjectEdgeCode See ego_edge_code
v6 ego_dir EgoDirection Direction of ego's motion (see Moving objects for a list of directions)
v7 max_score MaxScore Maximum score
v8 free_memory FreeMemory The number of 256-byte lots of free memory available for resources
v9 unknown_word_no UnknownWordNum 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 CycleDelay Delay between interpreter cycles, in 1/20 second increments.
v11 clock_seconds ClockSeconds Number of seconds on the interpreter's clock (the clock is reset when the game starts)
v12 clock_minutes ClockMinutes Number of minutes on the interpreter's clock
v13 clock_hours ClockHours Number of hours on the interpreter's clock
v14 clock_days ClockDays Number of days on the interpreter's clock
v15 joystick_sensitivity JoystickSensitivity Sensitivity of the joystick
v16 ego_view_no EgoViewNum Number of the view assigned to ego
v17 error_code ErrorCode What type of error has occurred
v18 error_information ErrorInfo Extra information about the error
v19 key_pressed KeyPressed The ASCII code of the key that has just been pressed, if any
v20 computer_type ComputerType Type of computer (0 = PC)
v21 window_close_time MsgWindowCloseTime 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 SoundChannels Number of sound channels (PC = 1, Tandy = 3)
v23 sound_volume SoundVolume Volume of the sound (0 = loudest, 15 = quietest)
v24 (not defined) MaxInputLength Specifies the maximum number of characters that the player may enter on the input line. Defaults to 41.
v25 selected_inventory_item SelectedItem 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 MonitorType Video mode:
  • 0 = CGA (black-cyan-magenta-white CGA palette)2
  • 1 = RGB (blue-yellow-red--green CGA palette)
  • 2 = Hercules
  • 3 = EGA
  • 4 = MCGA

1 The VB Syntax is supported by WinAGI but not by AGI Studio

2 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

Personal tools