System variables are global variables within the engine that OpenBOR relies upon to conduct its various operations. OpenBOR script allows access to several of these through the openborvariant()
and setopenborvariant()
functions.
Use Cases
Get a system value. Most system variables are integers. See the list of available variants for exceptions.
mixed x = openborvariant(<string identifier>);
Modify a system value. Some OpenBOR variants are read only. See the list of available variants for details.
mixed x = <value>;
setopenborvariant(<string identifier>, x);
- Unless otherwise noted, any list of items in OpenBOR is 0 indexed. That means the first item is 0, the next is 1, and so on.
- Unless otherwise noted, all binary flags are 0 = False, 1 = True.
List
Name | Type | Read Only | Description |
---|---|---|---|
background | Pointer | Current background screen. By creating a new screen and accessing its pointer, you can replace the current background in real time. | |
blockade | Float | Scroll position mark where the player can no longer move. | |
branchname | String | X | When a branch item is activated, this will indicate name of the level. Not recommended for most cases – use current_branch instead. |
cheats | Integer | X | Indicates if cheats have been enabled from the OpenBOR menu. |
count_enemies | Integer | X | Current number of enemy type entities in play. |
count_entities | Integer | X | Current number of entities in play. |
count_npcs | Integer | X | Current number of NPC type entities in play. |
count_players | Integer | X | Current number of player type entities in play. |
current_branch | String | X | Name of the current level branch. |
current_level | Integer | X | Level index of the current set. |
current_palette | Integer | X | Index of the current global palette in use. See level palettes for details on this feature. |
current_scene | String | X | File name of current scene. |
current_set | Integer | X | Index of the current set. |
current_stage | Integer | X | Current stage within a level. |
effectvol | Integer | X | Current menu setting for sound effect volume. |
elapsed_time | Integer | Global chronograph OpenBOR uses to track timing for virtually every engine operation. Note that is it not a perfect representation of real world time. Rather, the timer is a counter incremented on each engine update (~200 per second depending on hardware and conditions). Also note the timer is reset by certain events, such as a new level starting. | |
ent_max | Integer | X | Maximum number of entities allowed in play. |
fps | Integer | X | Current engine update rate. Under optimal conditions, OpenBOR runs at 200FPS. ~60FPS is required for smooth game play. |
freeram | Integer | X | Available memory. As a 32bit application OpenBOR can “see” ~2GB of RAM according to the limits of your hardware and operating system. |
front_panel_z | Integer | X | Default position of front panel layer. Internally, it is a calculated offset from player_max_z . |
game_paused | 0 = Unpaused1 = Paused. | ||
game_speed | |||
game_time | |||
gfx_x_offset | |||
gfx_y_offset | |||
gfx_y_offset_adj | |||
global_config | Pointer | X | Pointer to the global configuration structure. See Global Config below. |
hresolution | Horizontal screen size. | ||
hole_z | Integer | X | Base layer position of Hole graphic. Internally, it is a calculated offset from player_min_z . |
hud_common_load | Pointer | X | Pointer to Dial properties for loading HUD. |
hud_common_main | Pointer | X | Pointer to Dial properties for default HUD. |
hud_common_mp | Pointer | X | Pointer to Dial properties for HUD mp display. |
hud_common_opponent | Pointer | X | Pointer to Dial properties for HUD opponent display. |
hud_z | Integer | X | Base layer position of the heads up display (player/enemy life, score, etc.) . Internally, it is a calculated offset from player_max_z . |
in_cheat_options | Legacy. Use screen_status instead. | ||
in_control_options | Legacy. Use screen_status instead. | ||
in_enginecreditsscreen | Legacy. Use screen_status instead. | ||
in_gameoverscreen | Legacy. Use screen_status instead. | ||
in_halloffamescreen | Legacy. Use screen_status instead. | ||
in_level | |||
in_load_game | Legacy. Use screen_status instead. | ||
in_menuscreen | Legacy. Use screen_status instead. | ||
in_new_game | Legacy. Use screen_status instead. | ||
in_options | Legacy. Use screen_status instead. | ||
in_selectscreen | Legacy. Use screen_status instead. | ||
in_showcomplete | Legacy. Use screen_status instead. | ||
in_sound_options | Legacy. Use screen_status instead. | ||
in_start_game | Legacy. Use screen_status instead. | ||
in_system_options | Legacy. Use screen_status instead. | ||
in_titlescreen | Legacy. Use screen_status instead. | ||
in_video_options | Legacy. Use screen_status instead. | ||
lasthita | Legacy. See lasthity . | ||
lasthitc | Last hit confirm. Set true when engine detects a collision, then checked immediately before the hit reaction logic. You can set this to false during a doattack script to cancel a hit as if it never happened. | ||
lasthitt | Elapsed time when last hit occurred. | ||
lasthitx | X position (horizontal intersection between attack and body box) of last hit. | ||
lasthity | Y position (vertical intersection between attack and body box) of last hit. | ||
lasthitz | Z position (lateral intersection between attack and body box) of last hit. | ||
levelheight | |||
levelpos | |||
levelwidth | |||
lightx | |||
lightz | |||
max_wall_height | Integer | Highest wall entity may spawn on top of. Default = 1000. | |
maxanimations | Integer | X | |
maxattacktypes | Integer | X | |
maxentityvars | Integer | X | |
maxglobalvars | Integer | X | |
maxindexedvars | Integer | X | |
maxplayers | Integer | X | |
maxscriptvars | Integer | X | |
maxsoundchannels | Integer | X | |
mirror_z | Integer | X | Base layer position of mirror effect panel. Internally, it is a calculated offset from player_min_z . |
models_cached | Integer | X | |
models_loaded | Integer | X | |
musicvol | Integer | ||
neon_panel_z | Integer | X | Base layer position of neon effect panel. Internally, it is a calculated offset from player_min_z . |
nofadeout | |||
nogameover | |||
nohof | |||
nojoin | |||
nopause | |||
nosave | |||
noscreenshot | |||
noshowcomplete | |||
numbasemaps | |||
numholes | |||
numlayers | |||
numpalettes | |||
numwalls | |||
pakname | |||
panel_z | Integer | X | Base layer position of main panel. Internally, it is a calculated offset from player_min_z . |
pause | Integer | See game_paused . | |
pixelformat | |||
player | |||
player_max_z | Integer | Highest allowed point on Z Axis game field for active entities. | |
player_min_z | Integer | Lowest allowed point on Z Axis game field for active entities. | |
player1 | |||
player2 | |||
player3 | |||
player4 | |||
porting | |||
sample_play_id | |||
screen_status | Integer | Current screen type. Bitwise with following constants. Note that some flags are not updated until reset at title screen: * openborconstant("IN_SCREEN_BUTTON_CONFIG_MENU") – In player button configuration menu. * openborconstant("IN_SCREEN_CONTROL_OPTIONS_MENU") – In player control options.* openborconstant("IN_SCREEN_ENGINE_CREDIT") – Showing engine credits.* openborconstant("IN_SCREEN_GAME_OVER") – In game over screen.* openborconstant("IN_SCREEN_GAME_START_MENU") – In any game start menu.* openborconstant("IN_SCREEN_HALL_OF_FAME") – In Hall of Fame (high score listing).* openborconstant("IN_SCREEN_LOAD_GAME_MENU") – In load game menu.* openborconstant("IN_SCREEN_MENU") – In any menu.* openborconstant("IN_SCREEN_NEW_GAME_MENU") – In new game menu.* openborconstant("IN_SCREEN_OPTIONS_MENU") – Not in player screen.* openborconstant("IN_SCREEN_SELECT") – In select player screen.* openborconstant("IN_SCREEN_SHOW_COMPLETE") – In stage complete screen..* openborconstant("IN_SCREEN_SOUND_OPTIONS_MENU") – In sound settings menu.* openborconstant("IN_SCREEN_SYSTEM_OPTIONS_MENU") – In any options menu.* openborconstant("IN_SCREEN_TITLE") – Title screen.* openborconstant("IN_SCREEN_VIDEO_OPTIONS_MENU") – Setting video options. | |
scrollmaxx | |||
scrollmaxz | |||
scrollminx | |||
scrollminz | |||
self | |||
sets_count | Integer | X | Current number of level sets (practice, easy, hard, etc.) loaded. |
shadow_z | Integer | X | Base layer position of shadow graphic. Internally, it is a calculated offset from player_min_z . |
shadowalpha | |||
shadowcolor | |||
shadowopacity | |||
skiptoset | |||
slowmotion | |||
slowmotion_duration | |||
smartbomber | |||
soundvol | |||
textbox | |||
ticks | |||
totalram | |||
usedram | |||
viewporth | |||
viewportw | |||
viewportx | |||
viewporty | |||
vresolution | Integer | Vertical screen size. | |
vscreen | |||
waiting | |||
xpos | Integer | Current horizontal scroll position in a level. | |
ypos | Current vertical scroll position in a level. | ||
Name | Type | Read Only | Description |
Global Config
Global config is an ongoing effort to consolidate some of the unwieldy number of global system variables into a more manageable structure. Global config properties are accessible with the get_global_config_property()
and set_global_config_property()
functions. You will first need to acquire the global config pointer using openborvariant("global_config")
.
Name | Type | Description |
---|---|---|
openborconstant("GLOBAL_CONFIG_PROPERTY_AJSPECIAL") | Integer | Button map for activating a player’s breakout special or smartbomb. See ajspecial. |
openborconstant("GLOBAL_CONFIG_PROPERTY_BLOCK_RATIO") | Integer | Models.txt blockratio. |
openborconstant("GLOBAL_CONFIG_PROPERTY_BLOCK_TYPE") | Integer | Models.txt mpblock. |
openborconstant("GLOBAL_CONFIG_PROPERTY_CHEATS") | Integer | Cheat menu and active cheat setup. See Cheats. |
openborconstant("GLOBAL_CONFIG_PROPERTY_FLASH") | Integer | Pointer to the global set of flash properties. See Hit Effects. |
openborconstant("GLOBAL_CONFIG_PROPERTY_SHOW_GO") | Integer | When 1, the go arrow is currently displayed. |
Name | Type | Description |