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

float - Auto scrolling speed along X axis.

LEVEL_PROP_AUTO_SCROLL_Y

float - Auto scrolling speed along Y axis.

LEVEL_PROP_BASEMAP_COLLECTION

pointer - Level's collection of basemaps.

LEVEL_PROP_BASEMAP_COUNT

integer - Number of basemaps in the level.

LEVEL_PROP_BOSS_COUNT

integer - Number of entities marked as a boss.

LEVEL_PROP_BOSS_MUSIC_NAME

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

LEVEL_PROP_BOSS_MUSIC_OFFSET

integer - 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.

LEVEL_PROP_DAMAGE_FROM_ENEMY

Toggles player taking damage from enemy attacks. When on, attacks still hit but damage is reduced to 0.

  • DAMAGE_FROM_ENEMY_OFF
  • DAMAGE_FROM_ENEMY_ON

LEVEL_PROP_DAMAGE_FROM_PLAYER

Toggles player attacking other player. When on, player's attacks will pass through another player other.

  • DAMAGE_FROM_PLAYER_OFF
  • DAMAGE_FROM_PLAYER_ON

LEVEL_PROP_FACING

Toggles forcing the player to face a direction in the level.

  • FACING_ADJUST_NONE - No facing adjustment.
  • FACING_ADJUST_RIGHT
  • FACING_ADJUST_LEFT
  • FACING_ADJUST_LEVEL - Face according to level's scroll direction.

LEVEL_PROP_GRAVITY

float

Gravity rating for level.

Clone this wiki locally