OpenBOR Wiki Script Input Update

Input Update

Input update is a global script that runs immediately after inputs are updated (or played pack from a recording) but before OpenBOR begins processing the command actions. Although similar to key scripts, there are a few important differences.

  • Key scripts run after OpenBOR has processed command input (movement and special attacks). Input update runs before.
  • Key scripts only run for active players and when commands can be processed.
  • Input scripts run at all times on every update cycle and for all possible players, active or not.

In practical terms, key scripts are more efficient and better suited for setting up entity actions. Input scripts are advantageous for modifying the inputs themselves or capturing key strokes outside of gameplay. An example might be reversing the player’s directional controls, or canceling certain actions when in menus.

Use

Add a script file named inputall.c to the data/scripts folder. The following local variables are available:

  • player: Current player index the script is acting on.

Related Post