Skip to content

Creating a Command with BlamScript#

Notice

This page represents an incredibly early implementation of Blamite's version of BlamScript. Most of the content here is inaccurate, out of date, and fits into the category of being more of an abstract concept rather than a proper implementation. This page should not be used as a guide and remains for archival purposes only.

What is BlamScript?#

BlamScript is the primary scripting language used by the Halo games, as well as the Blamite Engine. BlamScript can be used in numerous ways, from campaign missions to commands, to all kinds of crazy stuff. This page focuses on creating a command with HSC.

Improvements from CSC#

CommandScript (CSC) Was used in the process of implementing basic HSC support. It was used only for testing and should not be used beyond such purposes. It is entirely unsupported and isn't at all flexible.

Creating a Command#

Like with CSC, all command scripts should be placed within ./dev_data/scripts/. The engine scans for .hsc files separately from .csc files, and all scripts in this folder are treated as commands. Level-specific scripts should be placed in the appropriate folder, such as ./dev_data/levels/multi/forge_halo/

Setting up your HSC File#

We will be using the following sample script to output some text and take a screenshot.

; globals
(global string command_name "hsc_screenshot")
(global string command_desc "Saves a screenshot")

(script static command_action
    (echo "Saving screenshot...")
    (save_screenshot)
    (echo "p>:pink Screenshot saved")
)
If you are familiar with CSC, you will notice some key changes right off the bat. The name and description are now identified as global string. You will also notice that the action, instead of being simply console output, is now a static script titled command_action. This is the entry point for any command script. As a result of being a proper script, we can now support an unlimited number of actions per-script.

Actions#

Below is a list of supported actions for HSC commands.

Action Name Arguments Description
echo string This is used to show a message in the console. Supports color prefix codes. For more information, see here
print string Used to print a string.
save_screenshot N/A Saves a screenshot to the default screenshot path.

FAQ#

Q: Can I keep using CommandScript?
A: I can't imagine why you'd want to, but you are free to do so. CSC functionality will continue to exist in all future engine builds.

Q: Why are there so few actions in BlamScript?
A: Blamite's implementation of BlamScript is still in a very early stage. Stability, extensibility, and flexibility are all things that will continue to improve as Blamite matures. If you wish to make BlamScript better, we encourage you to improve it and commit to the repository!