Download Game! Currently 71 players and visitors. Last logged in:WhlxchGlauriCordobaDefault

Blitzer's Blog >> 72520

Back to blogs index
Posted: 16 Sep 2026 05:42 [ permalink ]
That output is absolutely perfect. The engine instantiated two completely
isolated memory footprints for CURSED_IDOL:9Z3C and CURSED_IDOL:YYIR.
(Side note: You might have noticed they spawned into start_game instead of
a1_room_cove. That is just a funny side effect of our @CLONE cheat code!
Because the cheat temporarily reset this.vm.pc = 0 to execute the opcode,
getCurrentEnvironment() saw you at the top of the file. In actual gameplay,
builder bots won't reset the PC, so items will drop exactly where they
should).
Now we need to build the Semantic Mask.
We will patch the REPL (Read-Eval-Print Loop) in runtime.js to completely hide
the :SALT from the player when printing output, and to automatically resolve
the salt when the player types a command.
The Semantic Mask Patch
Run this script to surgically update the LOOK, INVENTORY, and TAKE commands in
runtime.js:
cat << 'EOF' > patch_repl_mask.js
import fs from 'fs';

let code = fs.readFileSync('runtime.js', 'utf-8');

/ 1. Mask INVENTORY output
code = code.replace(
    /console\.log\(\`\
\[INVENTORY\]: \$\{inv\.length > 0 \? inv\.join\(', '\) : 'Empty'\}\`\);/,
    `console.log(\`\
[INVENTORY]: \${inv.length > 0 ? inv.map(i => i.split(':')[0]).join(', ') :
'Empty'}\`);`
);

/ 2. Mask LOOK output
code = code.replace(
    /let itemString = visibleItems\.length > 0 \? \`\
Visible items: \$\{visibleItems\.join\(', '\)\}\` : "";/,
    `let itemString = visibleItems.length > 0 ? \`\
Visible items: \${visibleItems.map(i => i.split(':')[0]).join(', ')}\` : "";`
);

/ 3. Upgrade TAKE/GET to resolve the composite ID dynamically
code = code.replace(
    /const itemIndex = envItems\.indexOf\(target\);\s*if \(itemIndex > -1\)
\{\s*\/\/ Move from room to inventory\s*envItems\.splice\(itemIndex, 1\);/,
    `const itemIndex = envItems.findIndex(i => i.split(':')[0] === target || i
=== target);
            if (itemIndex > -1) {
                const actualItemId = envItems[itemIndex]; // e.g.,
CURSED_IDOL:9Z3C
                // Move from room to inventory
                envItems.splice(itemIndex, 1);`
).replace(
    /if \(!inv\.includes\(target\)\) inv\.push\(target\);\s*this\.vm\.memory\['
INVENTORY'\] = inv;/,
    `if (!inv.includes(actualItemId)) inv.push(actualItemId);
                this.vm.memory['INVENTORY'] = inv;`
);

fs.writeFileSync('runtime.js', code);
console.log('[SYS] Semantic Mask applied! The REPL now seamlessly translates
composite IDs.');
EOF

node patch_repl_mask.js

Test the Mask
Once patched, restart your engine:
x-console world restart && x-console world follow

Use the cheat code again, and then interact naturally:
> @CLONE CURSED_IDOL
> @CLONE CURSED_IDOL
> look
> take cursed_idol
> i

You will see Visible items: CURSED_IDOL, CURSED_IDOL. When you type take
cursed_idol, the engine will silently find the first instance (e.g.,
CURSED_IDOL:9Z3C), remove it from the room array, and push that exact
composite string into your inventory array. The illusion is seamless!