BSL:BFW Scripting Language

From OniGalore
(Redirected from BSL:Tutorial)
Jump to navigation Jump to search

BungieFrameWork Scripting Language (simply called BSL) is what Oni's level scripts are written in. Being a game scripting language, BSL is far more limited in scope and usage than a full programming language, as it was designed only to move events forward in the game, not to build complete programs. Specifically, BSL scripts are responsible for managing the player's objectives, directing AIs, creating environmental effects and choreographing cutscenes.

Physically speaking, they are the .bsl files inside the Oni/GameDataFolder/IGMD/ folder. Stored in plain-text format, scripts can be edited with any word-processing program, such as the built-in Notepad (Windows) or TextEdit (Mac); the only requirement is that you must use the suffix ".bsl" for scripts instead of ".txt" (in Windows, you may have to turn on the displaying of file extensions to see the suffix).

Getting started

  • You may wish to first read either the Introduction or the Manual page under § Knowledge base. The Introduction is a quick reference, whereas the Manual includes an introductory lesson on programming concepts. It also documents known bugs in BSL and fixes/workarounds when available.
  • For hands-on tutorials in writing BSL, see § Tutorials.
  • To learn BSL by example, you can read the .bsl files in the IGMD folder or look at some of the mods linked from § Script mods and draw connections between the scripting commands and the resulting events in the game.

Script mods

Script mods are great examples of what can be achieved simply by editing text files. They replace or add to Oni's .bsl files to spice up the gameplay and provide a more exciting experience to those who have finished the game. However, they can only change the way that game data is used; adding new characters or changing the layout of a level, for instance, would require editing the actual game data. When new levels are created, these naturally require new scripts to be written from scratch to work with the assets and drive events in them.

One ambitious example of a script mod is Oni Team Arena. Based on the desire for a multiplayer mode in Oni and inspired by Unreal Tournament, OTA creates a single-player "multiplayer experience" by adding bots and a scoring system. Other script mods range from free-for-all arenas to objective-based missions and enhancements of the original levels.

Script mods packaged for use with the Anniversary Edition are listed here, and totally new levels with their own BSL files can be found here (these mods are meant to be installed through the AE Installer). Older scripts, which need to be placed manually in IGMD, can be found here and here.

Tutorials

Playing with the developer console
The fastest way to start learning BSL is to load the first level and open the dev console.
New logic from scratch
Create completely new level logic from scratch.
Commented level script from Ch. 4 Airport (unfinished)
A commentary explaining how an existing level's logic is scripted.

Knowledge base

Introduction A quick language reference, ideal for those with programming experience.
Manual The complete language reference on BSL, with more explanations for newbies and details for power users.
Functions & Variables All of the engine's built-in functions and variables.
Defunct commands Apparently-obsolete commands.
Characters, Consoles & Doors In-game IDs for each level of the game, useful when writing new scripts for those levels.
IGMD/ The directory structure of the game scripts.
IGMD/global/ A global scripting folder which can be used for patching.
Snippets Useful snippets of code.