Debugging
Reloading
Section titled “Reloading”The game watches your pack folder. When you save a file, the mission reloads and the current section restarts.
To reload by hand:
/bf admin campaign reloadScript errors
Section titled “Script errors”A script error shows on screen with the file, the line and a traceback. An error on a section’s main thread stops the mission, so fix it and save to reload.
Jumping to a section
Section titled “Jumping to a section”/bf admin campaign sections/bf admin campaign jumpto <section>Seeing what’s happening
Section titled “Seeing what’s happening”/mission debug draws your triggers, markers, routes and actors in the world. It also shows a panel with the current section, running threads and what each one is waiting for, flags and recent events.
You can also place your own labelled shapes from a script with draw.
| Command | What it does |
|---|---|
/mission state |
Prints the same information as the panel, ready to copy |
/mission locate |
Copies a one-line summary of where the mission is |
/mission pos |
Copies your position, ready to paste into a script |
/mission region |
Copies the region you’ve selected with the wand |
/mission dump |
Writes the level table, objectives and live actors to the log and chat, for working out why a mission is stuck |
Common problems
Section titled “Common problems”| Problem | Likely cause |
|---|---|
mission.api(1) must be declared |
The call is missing from the top of mission.lua. |
mission.lua registered no sections |
No mission.section ran, often after a typo at the top level. |
A wait at the top level fails |
Waiting only works inside a section or a thread. |
| A thread is stopped for running too long | A loop has no wait in it. |
The /mission commands aren’t available |
The pack is a zip. Editing needs a folder. |
| Your campaign isn’t listed | The pack isn’t enabled in the resource pack screen. |
