Bermuda △ Documentation
Main Display Variables, Labels, and Functions User Interface CustomizationMain Display
Text Display
"line",
Displays the line that you put in the quotes.
wrap, "first line", "second line",
Displays two lines at the same time. It's necessary because there's no text wrapping as of now. This command doesn't work in message format.
clear,
Clears the nvl page.
newtype, "adv",
Changes the game type to ADV format.
newtype, "nvl",
Changes the game type to NVL format.
newtype, "msg",
Changes the game type to message format.
Character Names
name, "name",
Changes the character name. Note that this doesn't actually display anyhting; the character name will be displayed with whatever lines come after that. Because of this, you'll have to change the name to "" if you want to display text without a name after that.
NVL mode and MSG mode don't support "_name" at the moment.
Image Display
bg, "background.jpg",
Shows background.jpg. Backgrounds will not be cleared along with other images.
show, "right", "image.png",
Shows image.png on the right.
show, "left", "image.png",
Shows image.png on the left.
show, "center", "image.png",
Shows image.png at the center.
show, "none",
Hides the images.
icon, "icon.png",
MSG mode only. The next line will be shown with icon.png. Icons do not count as normal images, so they won't be hidden with the show/none command.
Music Control
music, "music.mp3",
Plays music.mp3.
music, "none",
Pauses the music.
IMPORTANT: Because mp3 licensing fees apply to games, it is best to avoid using mp3 files if you are producing a game that will be online.
Other
end,
Ends the game.
Variables, Labels, and Functions
Variables
Use variables to keep track of in-game stats. Variables need to be set at the beginning of the game. You can set your variables' starting values either in the PREFERENCES section or beneath the line function bt_story() {.
var points = 0;
Creates a variable called points and sets it to 0.
Labels
Labels are different branches of the story - the different paths players can take depending on what choices they make. You can have as many labels as you'd like to, but you can't change the name of the starting label story. Labels have to go under the line function bt_story() {, in between the curly brackets.
labelname = ["This is a new label."]
Creates a new label called labelname.
Functions (Overview)
To set variables or jump to different labels, you can write a function in the script. Basically, anything that changes based on player input has to be written in a function. Functions look like this:
function() { some code here },
When you write a function, it doesn't matter how many spaces or line breaks there are in the function, as long as the code is written between the curly brackets. You can break up your functions however you'd like. However, it is necessary to put semicolons between each statement in your code, and you must put a comma after the function.
An example of setting a variable:
function() { points=2; },
Sets points to 2.
Dissolve - bt_dissolve();
function() { bt_dissolve(); },
Using this function will cause the whole screen to dissolve so all the changes will be faded in.
Menus - bt_menu(["choice",label]);
You can add choices by using the menu function.
function() { bt_menu(["Choice 1", label1name],["Choice 2", label2name],); },
Creates a menu. The first button has the text Choice 1 and when it's clicked, the story jumps to the label called label1name. Similarly, the second button Choice 2 leads to label2name.
Instead of putting a label name, you can put "". This means selecting that choice will just continue the normal script.
Jump - bt_jump(label);
If you want the story to jump to another label without using a menu, use the jump function.
function() { bt_jump(labelname); },
Jumps to the label labelname.
Insert - bt_insert("text");
The insert function adds lines to the script.
function() { bt_insert("_name", "Person","Hi"); },
While this might not seem very useful, it can be used to add dialogue based on variable values (see if/else/elseif). Also, if you want to display a variable's value, you have to use an insert function so the game will calculate the value only at the time the player reaches that point in the script.
function() { bt_insert("You have "+points+" points."); },
If/else/elseif
You can also use if/else/else if statements in your code.
function() {if (points>3) { bt_jump(labelname); },
Jumps to labelname if points is greater than 3.
function() {if (points>5) { bt_jump(labelname); }else if (points>3) { points=points+1; }else { bt_insert("You only have "+points+" points!"); }},
If the player has more than 5 points, the game will jump to labelname. If they don't have more than 5 points but have more than 3, this adds 1 to points. If they don't have more than 3 points, this will insert a line that says You only have (the amount of points) points!
User Interface Customization
Custom Positions
You can create custom positions in function initialize(). (Make sure these positions are created inside the curly brackets.) Then, you can use those position in your story.
name = new bt_posi(x,y,);
Creates a new position called name, which is x pixels away from the left and y pixels away from the top.
Important: When you use custom positions in your story, don't put quotation marks around the position name.
Example:
function initialize() {funposition = new bt_posi(50,80);}function bt_story() {"_show", funposition, "image.png","That showed image.png at funposition.","_end"}
UI Properties
You can change extra properties of the user interface by writing code in function initialize(). (Again, make sure the properties are inside the curly brackets.)
property = value;
Example:
function initialize() {bt_advbox.x = 100;bt_advtext.font = "Georgia";bt_advtext.size = "22px";}
Moves the ADV format text box to 100 pixels from the left side, and sets the ADV format font to be Georgia with a font size of 22 pixels.
You can also set the properties during the game by using a function.
List of UI Properties
bt_button_widthbt_button_heightbt_advbox.xbt_advbox.ybt_advbox.widthbt_advbox.heightbt_advbox.colorbt_advtext.fontbt_advtext.sizebt_advtext.xbt_advtext.ybt_advtext.colorbt_nvlbox.xbt_nvlbox.ybt_nvlbox.widthbt_nvlbox.heightbt_nvlbox.colorbt_nvltext.fontbt_nvltext.sizebt_nvltext.xbt_nvltext.ybt_nvltext.colorbt_speedfor dissolve effect
Back to topSpringroll Games 2017