Source files
A Bornescript file has the extension .bsc. The same compiler also reads script text that is stored inside levels, animations, and imported weapon, class, and NPC files. Files saved by the RC tool are UTF-8, and the compiler reads them as plain bytes.
Both \n and \r\n line endings work. A lone \r counts as white space.
Server half and client half
Section titled “Server half and client half”One file can hold the code of two programs. The first line that is exactly //#CLIENTSIDE splits the file. The marker must be in capitals and have no spaces around it; //#clientside or an indented marker is an ordinary comment (OQ-LANG-2):
- Everything before it is the server half. It runs on the server and never leaves it.
- Everything after it is the client half. It is sent to the players that need it.
// Weapon: the server decides, the client shows.function onActionServerSide(cmd) { if (cmd == "ping") { triggerclient("gui", this.name, "pong"); }}
//#CLIENTSIDEfunction onActionClientSide(cmd) { if (cmd == "pong") { player.chat = "pong"; }}Things to know about the split:
- The marker is matched without regard to case, and white space around it is ignored.
- Only the first marker counts. A later
//#CLIENTSIDEline is an ordinary comment, and the compiler warns about it (W-DUPLICATE-CLIENTSIDE). - A line
//#SERVERSIDEis an ordinary comment. It does nothing. - The two halves are separate programs. Both may declare a function with the same name, and they do not see each other’s functions or variables.
- Line numbers in error messages always count from the top of the whole file.
- A file with no marker is entirely server code.
Keep the rules of the game in the server half. The client half is for pictures, windows, sound, and input. See authoring conventions.
Where a script runs
Section titled “Where a script runs”A compiled half is attached to a script object: an NPC, a weapon, a database NPC, or a class. A class adds its code to the object that joins it. See reuse.
Compiler options
Section titled “Compiler options”Options are set for one script with a first-line comment, or for the whole server in the Server Options. They change warnings, never what a correct program does. See compatibility quirks.
Engine version 0.1.0. Built 2026-11-18.