BSL:BFW Scripting Language: Difference between revisions

From OniGalore
Jump to navigation Jump to search
(linking to Introduction and Manual)
m (changed windows suggested edit program from wordpad to notepad, the later doesn't include any formatting data so should be preferable to edit plain text data)
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
'''[[Modding_Oni#Introduction_to_the_Oni_engine|BFW]] Scripting Language''' (simply called '''BSL''') is what Oni scripts are written in. Being a scripting language, it is far more limited in scope and usage than a "real" programming language, as it was designed only to move events forward in the game, not to build programs. More specifically, BSL scripts are responsible for managing the player's objectives, directing AIs, creating environmental effects, and driving cutscenes.
'''[[Modding_Oni#Introduction_to_the_Oni_engine|BFW]] Scripting Language''' (simply called '''BSL''') is what Oni scripts are written in. Being a scripting language, it is far more limited in scope and usage than a "real" programming language, as it was designed only to move events forward in the game, not to build programs. More specifically, BSL scripts are responsible for managing the player's objectives, directing AIs, creating environmental effects, and driving cutscenes.


Physically speaking, they are the .bsl files inside the [[IGMD|Oni/GameDataFolder/IGMD/]] folder. Being in plain-text, scripts can be edited with any word-processing program, such as the built-in WordPad (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).
Physically speaking, they are the .bsl files inside the [[IGMD|Oni/GameDataFolder/IGMD/]] folder. Being in plain-text, 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).
__NOTOC__
__NOTOC__
==Getting started==
==Getting started==
Line 11: Line 11:
Scripted 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 [[OBD|game data]]. When new levels are created for Oni, these naturally require new scripts to be written from scratch to take advantage of the new game assets.
Scripted 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 [[OBD|game data]]. When new levels are created for Oni, these naturally require new scripts to be written from scratch to take advantage of the new game assets.


One ambitious example of a scripted mod is [[AE:OTA|Oni Team Arena]]. Based on the desire for a [[multiplayer]] mode in Oni, and inspired by Unreal Tournament, OTA augments Oni's hand-to-hand combat and gunplay with a scoring system much like Unreal Tournament's Deathmatch mode. Other scripted mods range from free-for-all arenas to objective-based missions and enhancements of the original levels. Scripted mods can be found [http://mods.oni2.net/mods/Script here], [http://your-mom.oni2.net/Downloads.htm here] and [http://script10000.oni2.net/scripts.html here]. New levels, with their own BSL files, can be found [http://mods.oni2.net/mods/New%20Level here] (mod packages found on the Mod Depot are meant to be installed through the [[AE]]).
One ambitious example of a scripted mod is [[AE:OTA|Oni Team Arena]]. Based on the desire for a [[multiplayer]] mode in Oni, and inspired by Unreal Tournament, OTA augments Oni's hand-to-hand combat and gunplay with a scoring system much like Unreal Tournament's Deathmatch mode. Other scripted mods range from free-for-all arenas to objective-based missions and enhancements of the original levels. Scripted mods can be found [http://mods.oni2.net/mods/Script here], [http://your-mom.oni2.net/Downloads.htm here] and [[User:Script_10k#Minor_Scripts|here]]. New levels, with their own BSL files, can be found [http://mods.oni2.net/mods/New%20Level here] (mod packages found on the Mod Depot are meant to be installed through the [[AE]]).


==Tutorials==
==Tutorials==
Line 29: Line 29:
*[[BSL:Introduction|Introduction]] (a quick reference, ideal for those with programming experience)
*[[BSL:Introduction|Introduction]] (a quick reference, ideal for those with programming experience)
*[[BSL:Manual|Manual]] (the complete reference on BSL, with more details and explanations for newbies)
*[[BSL:Manual|Manual]] (the complete reference on BSL, with more details and explanations for newbies)
*[[:Category:Scripting tasks|Scripting commands grouped by subject]]
*[[:Category:Scripting tasks|Scripting commands grouped by subject]] (work in progress)
*[[BSL:Reference|List of all scripting commands]]
*[[BSL:List|List of all scripting commands]] (work in progress)
*[[IGMD|File documentation for game scripts]]
*[[IGMD|File documentation for game scripts]]
*[[BSL:Snippets|Useful snippets of BSL]]
*[[BSL:Snippets|Useful snippets of BSL]]


[[Category:BSL docs]]
[[Category:BSL docs]]

Revision as of 14:52, 27 February 2017

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

Physically speaking, they are the .bsl files inside the Oni/GameDataFolder/IGMD/ folder. Being in plain-text, 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 database" below.
  • To learn BSL by example, you can read the .bsl files in Oni's IGMD folder or look at the "Scripted mods" section below, and draw connections between the scripting commands and the resulting events in the game.
  • For a primer in writing BSL, see the "Tutorials" section below.

Scripted mods

Scripted 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 for Oni, these naturally require new scripts to be written from scratch to take advantage of the new game assets.

One ambitious example of a scripted mod is Oni Team Arena. Based on the desire for a multiplayer mode in Oni, and inspired by Unreal Tournament, OTA augments Oni's hand-to-hand combat and gunplay with a scoring system much like Unreal Tournament's Deathmatch mode. Other scripted mods range from free-for-all arenas to objective-based missions and enhancements of the original levels. Scripted mods can be found here, here and here. New levels, with their own BSL files, can be found here (mod packages found on the Mod Depot are meant to be installed through the AE).

Tutorials

Playing with the developer console
The fastest way to start learning BSL is to just load the first level and open the dev console.
Original logic modification
There are lots of cool things to do by merely looking at the original scripts and changing a few parameters.
Patching
Want to script a "patch" that's effective in every level?
New logic from scratch
Create completely new level logic from scratch.

Knowledge database