Welcome to brocatelVM’s documentation!¶
What is it?¶
Brocatel VM is a Lua library that runs the story Lua files generated by the Brocatel compiler.
Usage¶
An example¶
local brocatel = require("brocatel")
local content = io.open("file_compiled_by_brocatel.lua", "r"):read("*a")
local vm = brocatel.load_vm(content)
local option = nil
while true do
local line = vm:next(option)
if line == nil then
break
elseif line.text then
print(line.text)
elseif line.select then
option = get_user_input(line.select)
end
end