8. Import a cartridge, custom code and Lua
Import an existing cartridge
In Create (“My cartridges”), Import a cartridge accepts:
| File | What is recovered |
|---|---|
.gwz exported by Wherigo Creator | Elements and events: the file is analysed like one from another tool, and event code is converted back into actions. Since version 0.0.20 the .gwz no longer embeds the full model (Wherigo.com rejected it): keep the cartridge on the site to edit it. A scrambled or renamed .gwz re-imports poorly (its texts stay encrypted). |
.gwz from Urwigo, Earwigo, Groundspeak Builder… | Listing, media (images and sounds), zones (with their points), characters, items, commands, tasks, questions, timers and variables become editable. Urwigo’s encrypted texts are decoded and event code is converted into editor actions; anything without an equivalent stays as “Free Lua code”. |
plain .lua | Same, without media. |

Urwigo cartridges
In Urwigo, compile your project to .gwz (the file usually uploaded to Wherigo.com), then import it here, photos and sounds included.
On import, the site:
- decodes the texts encrypted by Urwigo: names, descriptions, messages, commands and variable values get their real text back;
- converts event code into editor actions: messages and dialogs (with image), show or hide, activate, task complete, move, change a variable, if…else, sound, timers, ask a question (with its answers), finish the cartridge;
- keeps as a Free Lua code block, in place, anything without an equivalent (choice between several buttons, hashed answers, calculations…), and removes Urwigo’s internal machinery as soon as no block uses it any more.

.urwigo) is not read yet: use the .gwz.For a cartridge encrypted by another tool, the ⌨️ Global Lua section flags encrypted texts; the 🔓 Decode texts button (“Full Lua” level) runs the cartridge’s own decoding function.

Custom code by level
None (Novice) · Guided code blocks (Explorer: ready-made blocks set up with a form) · Lua in actions (Adventurer) · Full Lua (Master, validated creators: plus Global Lua). Admins can adjust this per level. Imported code always stays usable and can be deleted.

Free Lua
Lua is the Wherigo cartridge language. The Free Lua code action lets you write code directly: random numbers, distances, reusable functions…
var_dice = math.random(1, 6)
Wherigo.MessageBox{Text = "You rolled " .. var_dice .. "!"}
- Each element shows its Lua name at the top right of its form: use that name in your code.
- In an action,
selfis the current element andinputthe answer to a question. - The Global Lua section holds code run at start.


Lua in the web player
The web player runs cartridge Lua with an embedded Lua engine and a simulated Wherigo library (messages and callbacks, questions, moving items, inventory, timers, distances, completion…). Errors are shown with their line number.


3.0 instead of 3), shows messages one after another, and the completion code is “WEBPLAYER”. Always field-test the compiled version.Check code compatibility
Wherigo players use Lua 5.1. Check & export compiles every code block (syntax errors with line numbers) and flags newer-Lua constructs (//, bitwise operators, goto, table.unpack…) and calls unavailable on players (io, os.execute, other modules, print).

Language of the imported cartridge
When importing, choose the cartridge's base language (the one its texts are written in). If automatic translation is set up and your level allows it, tick Translate automatically: your language is added to the cartridge and the editor opens translating every text, then saves. Then check the fields marked 🤖.
Readable names after import
Urwigo and scrambling tools do not store the real Lua names in the file: an imported cartridge arrives with names like _bN0L4 or _mSx. The Suggest readable names box (ticked by default) replaces them at import:
- elements take their displayed name, without accents, with a prefix:
zoneStart,objetMap,persoGuide,tacheFinal,minuteurGame,questionCode,imgLogo,sonVictory; - variables are named from how they are used: a zone flag, the word around them in a text (
score), the element they are copied into, a player or device test (tricheur), a counter, never read (inutilise1), otherwisenombre1,texte1,booleen1.
Renaming works by analysing the code (never a plain search and replace): names change in events, actions, Lua blocks and global Lua, but never inside a displayed text. Lua and Wherigo reserved words are never touched.
After import, a screen lists old name → proposed name → type → number of uses. Your browser then compiles the old and new code with Lua 5.1 and compares the bytecode instruction by instruction: “✔ Checked” means only the names changed. If anything differs, the original names are restored automatically.
Correct any names you dislike (checked as you type: no accents, no duplicates, no reserved words), then Save and open the editor. Keep everything as it was goes back to the original scrambled names. Later, the ✏️ button next to a Lua name in the editor renames an element or variable everywhere.