Bipsi Game Maker Scripting Guide
Bipsi Game Maker Scripting Guide
scripting guide
2021/12/18
intro_
bipsi is a tool for making small lo-fi
games to play in the browser
javascript
let destination = FIELD(EVENT, "exit",
"location");
if (destination) {
MOVE(AVATAR, destination);
}
custom scripts_
you can augment an event's touch behavior
by giving it a field called "after" or
"before" with type "javascript"
javascript
await SAY("you will become a mouse!");
SET_GRAPHIC(AVATAR, FIELD(EVENT,
"mouse-tile"));
javascript
SAY("you are now a mouse!");
SET_GRAPHIC(AVATAR, FIELD(EVENT,
"mouse-tile"));
event fields_
the purpose of event fields is to provide
a somewhat convenient way to input
constant values for using in event
scripts
code
const title = FIELD(AVATAR, "title");
code
const dialogues = FIELDS(EVENT, "say");
code
SAY_FIELD("example");
SAY_
the simplest thing in bipsi scripting is
to queue dialogue:
code
SAY("hello there :)");
code
let dialogue = FIELD(EVENT, "example");
SAY(dialogue);
code
SAY_FIELD("example");
WALK_
the WALK function lets you move events
step by step with a series of directions
code
await WALK(AVATAR, ">>.>>");
code
await WALK(EVENT, "^^>>vv<<");
example: fetch quest_
this npc desires collectibles scattered
across the world and will thanks you for
getting them
javascript
await DO_STANDARD();
let prev = GET("apples", 0);
SET("apples", prev + 1);
javascript
let count = GET("apples", 0);
if (count > 3) {
SAY_FIELD("thank-you");
} else {
SAY_FIELD("desire-apples");
}
example: locked door_
this door blocks your path--unless you
have unlocked it
javascript
await DO_STANDARD();
SET("door-1-unlocked", true);
javascript
await DO_STANDARD();
if (GET("door-1-unlocked")) {
REMOVE(EVENT);
}
example: status report_
imagine we've been using other events to
track some stat values called "HP" and
"MP" for the player
field
say / dialogue / "YOU HAVE [[HP]]/5
HP AND [[MP]]/5 MP"
example: exodus_
guests leaving at the end of the party?
walls tumbling after an earthquake?
something happens that removes several
events from the game
field
leaves / tag
javascript
await DO_STANDARD();
let leavers = FIND_EVENTS("leaves");
leavers.forEach((leaver) => {
REMOVE(leaver);
});
example: cutscene_
a scene where you enter a tavern
unannounced. the owner is surprised to
hear you enter and walks over to greet
you, then walks you over to where they
were
javascript
let owner = FIND_EVENT("tavern-owner");
await SAY_FIELD("surprised");
await WALK(owner, "<<<..vv");
await SAY_FIELD("greet-player");
WALK(owner, "^^>>>");
await WALK(AVATAR, "^^^>>");
example: menu room_
a room you can enter from multiple places
but leaving takes you back to where you
came from:
javascript
SET("return", LOCATION_OF(AVATAR));
MOVE(AVATAR, FIELD(EVENT, "exit"));
javascript
MOVE(AVATAR, GET("return"));
example: music_
this is the standard script used to play
music when a "music" field is present
javascript
let music = FIELD_OR_LIBRARY("music");
if (music) {
PLAY_MUSIC(music);
} else if (IS_TAGGED(EVENT,
"stop-music")) {
STOP_MUSIC();
}
values_
PLAYBACK - the playback object, the
engine running the bipsi game
javascript
let dialogue = SAMPLE("1", "cycle",
["hello", "heya", "hi"]);
await SAY(dialogue);
custom functions_
you can add custom functions to use in
all touch scripts by adding a new
property to SCRIPTING_FUNCTIONS
javascript
SCRIPTING_FUNCTIONS.test = function
(name) {
this.PLAYBACK.say("hello " + name);
}
plugin scripts_
plugins are an experimental feature that
give more powerful control over bipsi by
running custom code before the bipsi game
has even begun loading
https://github.com/seleb/bipsi-hacks
https://github.com/Ragzouken/bipsi/blob/m
ain/src/scripts/plugins/html-dialogue.js
notes_
_________________________________________
_________________________________________
_________________________________________
_________________________________________
_________________________________________
_________________________________________
_________________________________________
_________________________________________
_________________________________________
_________________________________________
_________________________________________
_________________________________________
_________________________________________
_________________________________________
_________________________________________
_________________________________________
_________________________________________
_________________________________________
_________________________________________
_________________________________________
_________________________________________
_________________________________________
about_
bipsi is a web tool for making simple
browser games in the bitsy style
kool.tools/bipsi
kool.tools