Skip to content

Bornescript language reference

Bornescript is the scripting language of the Borne Engine. It reads scripts written for older GS2 servers and keeps their behavior, with the documented differences, and it adds a few extensions. This reference is for people who write scripts: weapons, NPCs, classes, and level code.

You can try most of the examples in the playground on the documentation site without a server.

  1. Source files: the .bsc extension, and the server and client halves.
  2. Lexical structure: comments, names, keywords, numbers, strings, and operators.
  3. Values and conversions: kinds of value, number and string conversion, and lists in strings.
  4. Variables and scopes: prefixes, name lookup, dynamic names, and player.
  5. Operators: precedence, arithmetic, comparison, truthiness, and in.
  6. Functions: declaring, calling, visibility, and anonymous functions.
  7. Statements: control flow, switch, enum, const, with, and try.
  8. Reuse: classes, join, and import.
  9. Arrays: literals, indexing, and copy rules.
  10. Errors: compile errors, run-time errors, and limits.
  11. Coroutines and timers: sleep, waitfor, async, timers, and scheduled events.
  12. Objects, flags, and events: kinds of script object, flags, and the events the engine raises.
  13. Compatibility quirks: the quirks that stay, and the compiler modes.
  14. Differences from legacy GS2
  15. Warnings and errors: every code, with the fix.
  16. Type annotations
  17. Authoring conventions

Also: the open questions that are provisional, and the API reference.

  • Extension means the engine adds it on purpose. Older scripts do not use it.
  • Provisional means the engine had to choose and the older behavior is not confirmed. The page names the open question, for example OQ-LANG-3, and the open questions page lists what the engine does until it is settled. Do not depend on a provisional behavior without a test of your own.
  • Examples marked with // expect: lines are run by the project’s tests, so they print what the page says.

Engine version 0.1.0. Built 2026-11-18.