Skip to content
Damon V. Caskey edited this page May 4, 2017 · 10 revisions

Levels - In progress

Script

Level properties are open to script. OpenBOR loads one level at a time, and purges the level when completed. This is done as a memory saving measure, and means that a given level's properties are only available while that level is active.

Get a level property.

mixed value = get_level_property(void level_handle, int property);
  • level_handle is a pointer to the target level. This is for future compatibility. For now, always pass NULL() to target the current level.
  • property accepts a LEVEL_PROP_... integer constant. See below for the list of available properties.

Modify a level property.

set_level_property(void level_handle, int property, mixed value);
  • value is the new value for target property.

Property List

LEVEL_PROP_AUTO_SCROLL_DIRECTION

Controls the direction level scrolls if auto scrolling is active.

  • SCROLL_RIGHT
  • SCROLL_DOWN
  • SCROLL_LEFT
  • SCROLL_UP
  • SCROLL_BACK
  • SCROLL_BOTH
  • SCROLL_RIGHTLEFT
  • SCROLL_LEFTRIGHT
  • SCROLL_INWARD
  • SCROLL_OUTWARD
  • SCROLL_OUTIN
  • SCROLL_INOUT
  • SCROLL_UPWARD
  • SCROLL_DOWNWARD

LEVEL_PROP_AUTO_SCROLL_X

Floating decimal. Controls auto scrolling speed along X axis.

LEVEL_PROP_AUTO_SCROLL_Y

Floating decimal. Controls auto scrolling speed along Y axis.

LEVEL_PROP_BASEMAP_COLLECTION

Level's collection of basemaps.

LEVEL_PROP_BASEMAP_COUNT

Number of basemaps in the level.

LEVEL_PROP_BOSS_COUNT

Number of entities marked as a boss.

LEVEL_PROP_BOSS_MUSIC_NAME

Filename of music track that will play when a boss is spawned into level.

LEVEL_PROP_BOSS_MUSIC_OFFSET

Boss music offset point. See music.

LEVEL_PROP_BOSS_SLOW

Toggles slow motion effect when a boss is defeated.

  • BOSS_SLOW_OFF
  • BOSS_SLOW_ON

LEVEL_PROP_CAMERA_OFFSET_X

Offset for the player's viewpoint along X axis.

LEVEL_PROP_CAMERA_OFFSET_Y

Offset for the player's viewpoint along Y axis.

LEVEL_PROP_COMPLETE_FORCE

When this flag is active, the level will end on next engine update.

Clone this wiki locally