Controls

Controls post thumbnail image

OpenBOR’s native control scheme is designed to be intuitive as possible and conform to established standards for side scrolling action games. Through various native options and scripting techniques (see below), creators can map these controls to perform any desired action. You can even rename or remove commands entirely to create a unique control scheme specific to your game. In turn, players may map available commands to desired keys or buttons via Control Options in the main menu. Default commands and actions are as follows:

Default

The following is a is list of OpenBOR’s default key mappings.

Left

  • Move player left on screen.
  • Cycle to previous column or option on current row in menus.
  • Cycle to previous character during player select.

Right

  • Move player right on screen.
  • Cycle to next column or option on current row in menus.
  • Cycle to next character during player select.

Up

  • Moves player up on screen (along Z axis) in pseudo 3D stages.
  • Cycle upward through rows in menus.
  • Cycle to previous color palette during player select.

Down

  • Moves player down on screen (along Z axis) in pseudo 3D stages.
  • Crouch/Duck in 2D stages.
  • Cycle downward through rows in menus.
  • Cycle to next color palette during player select.

Special

  • Player Special.
  • Blocking if enabled (see ajspecial below).

Attack 1

Attack 2

Unused.

Attack 3

Unused.

Attack 4

Unused.

Start

  • Begin or continue a game.
  • Join multiplayer game in progress (if not an active player).
  • Pause/resume game in progress (if an active player).

Screenshot

  • Send a screen capture to Screenshots folder.
  • Access main menu during game pause.

In addition, there is a universal Escape key:

  • Cycle to previous page in menu.
  • Exit player select and return to main menu.
  • Shut down engine when not in game or in a menu.
  • Resume a paused game.

Renaming Keys

You can rename keys by adding a file to the data folder named menu.txt. Use the following commands in the menu.txt file to customize or remove keys.

  • renamekey {target command} {new name}
  • disablekey {target command}

Accepted keys for rename or removal:

  • moveup
  • movedown
  • moveright
  • moveleft
  • attack
  • attack2
  • attack3
  • attack4
  • jump
  • special
  • start
  • screenshot

In this example, menu.txt renames Special to Defend and Attack 2 to Magic, while removing unused commands Attack 3 and Attack 4. This presents the player with a more polished set of controls that match actual in game functionality.

renamekey	attack	Attack
renamekey	attack2 Magic
renamekey	special	Defend

disablekey	attack3
disablekey	attack4

Note renaming commands only affects the labels that a player sees. Internal constants and command sequence inputs (see below) are unchanged.

Alternate Command Functions

You can add to or change the existing functionality of commands entirely. Common examples include adding additional attacks mapped to the normally unused Attack 2+ commands, remapping the player special, or special move sequences.

Command

com <sequence> <freespecial#>

Enables mapping single button or command sequences to trigger a desired Freespecial animation. Place com into a model’s text header. You may add multiple commands and cancels, up to the limit defined by the global Maximum Freespecials setting.

Sequence is the input or sequence of inputs to trigger the command. You may use up to twelve inputs in one sequence from the following list:

  • f – Left/right (same direction character is facing).
  • b – Left/Right (opposite direction character is facing).
  • u – Up.
  • d – Down.
  • a – Attack 1.
  • a2 – Attack 2.
  • a3 – Attack 3.
  • a4 – Attack 4.
  • j – Jump.
  • s – Special.
  • + – Simultaneous input (ex. a + s means press Attack and Special together).
  • -> – Delimiter. Optional, and does not count as one of the twelve inputs.

Freespecial# is the animation that plays in response to the command, assuming other conditions are met (i.e. having enough energy if the animation has an energy cost). In game leeway for command sequences is 0.5 seconds allowed between each input.

Example Sequences

  • com a + a2 freespecial2 – Pres Attack and Special together to activate Freespecial 1 animation.
  • com u + f -> a freespecial3 – Diagonally up and forward, then press Attack to activate Freespecial 3 animation.
  • com f -> d -> b -> u -> f -> s freespecial5 – 360′ rotate from forward to forward, then press Special to activate Freespecial 5.

Tips:

Don’t let the name “freespecial” confuse you. Freesepcials are not inherently “special”. You can use them to create any sort of animation you like, from a simple punch or kick, evasive movement, taunt, or whatever else.

Overly exact commands in a side scrolling environment are not necessary and may make your game more spastic to control instead of more precise. For example, to create the classic Hadouken input you should use d -> f -> a rather than d -> d + f -> f -> a.

If two or more sequences overlap, the more complex input from the player “wins”. This is the same command scheme seen in most fighting games. Again using the Haouken example, you could create a command for the normal Hadouken d -> f -> a, and another for Shinku Hadouken as d -> f -> d -> f -> a. OpenBOR will recognize if a player uses the Shinku Hadouken input even though the last portion of it is identical to the Hadouken input.

Cancel

cancel {start frame} {end frame} {hits} {sequence} {freespecial#}

Cancel is similar to Command, in that it maps command sequences to activate a Freespeical. However, cancels are unique to a single animation and can interrupt the animation on a successful input. This allows “canceling” from one animation to another for customized chains and combos.

Place cancels into the animation header of any Jump, Attack, Freespecial, or Follow animation. You may add as many cancels as you like to an animation to give it multiple cancel options. The animation you cancel into may of course have its own cancels to create an entire series of combo branch points.

Start frame and end frame are the first and last frames in the animation the cancel is usable. Remember frames are 0 indexed.

Hits is the required number of combo hits (if any) before the cancel is usable.

Cancel is otherwise identical to Command and follows the same rules (input sequence, energy cost, etc.).

Maximum Freespecials

maxfreespecials <int>

#default
maxfreespecials 8

Number of allocated special commands (Command and Cancel) per model (not freespecial# animations). If the total number of Cancels and Commands for a given model exceeds the number allotted, you will likely get a nonsensical error or crash.

Tip: Don’t allocate some silly number like 100 when you only need a few more command slots. This wastes memory. Figure out what you actually need and allocate accordingly.

Attack and Jump Special

ajspecial {flags}

#default
ajspecial special

Controls mapping of the native breakaway special attack and enables blocking for players. Accepts one of the following:

  • special (default) – Special attack mapped to Special key.
  • double – Special attacks mapped to Attack + Jump. Blocking enabled (if entity has a Block animation) and mapped to Special key.
  • attack2 – Special attack mapped to Attack 2 key.
  • attack3 – Special attack mapped to Attack 3 key.
  • attack4 – Special attack mapped to Attack 4 key.

Ajspecial is exposed to script as a global_config property. Use the following constants:

  • openborconstant("AJSPECIAL_KEY_SPECIAL")
  • openborconstant("AJSPECIAL_KEY_DOUBLE")
  • openborconstant("AJSPECIAL_KEY_ATTACK2")
  • openborconstant("AJSPECIAL_KEY_ATTACK3")
  • openborconstant("AJSPECIAL_KEY_ATTACK4")
void config = openborvariant("global_config");

int value = get_global_config(config, "ajspecial");

value = openborconstant("AJSPECIAL_KEY_ATTACK3");
set_global_config(config, "ajspecial", value);

Legacy

Prior to OpenBOR 4.0, ajspecial accepted only the following:

  • 0 (default) – Special attack mapped to Special key.
  • 1 – Special attacks mapped to Attack + Jump. Blocking enabled (if entity has a Block animation) and mapped to Special key.

Key Events

When native options aren’t enough, OpenBOR provides several layers of key events. These allow you to capture an incoming key or command, and insert your own scripts to perform any action you can imagine.

Key Status

OpenBOR maintains three key status values for each player. Each value is an integer you can apply bitwise logic to obtain an individual on/off flag for each key.

  • Hold – An engine update begins. If a ey is on, the key is held.
  • Press – Player presses a key

  1. InputAll – Runs on initial player input before before any engine key handling or key scripts take place. Use this event if you want to change the command input itself. Examples include reversing player controls or creating shortcut keys for muti-button presses.
  2. Level keyscript#
  3. Entity keyscript
  4. Global key#.c
  5. Global keyall.c
  6. Default key action.

Additional documentation in progress.

1 thought on “Controls”

Comments are closed.

Related Post