system_snapshot(3)
π system_snapshot(3) β Arcan Lua API, bestie edition π
okay so this is a page from the Arcan Lua API manual, and it's about system_snapshot β literally the "save my whole vibe so I can debug it later" function. no cap. πΈ
β¨ NAME β¨
system_snapshot β makes a debugging snapshot, or opens up live access so you can attach a debugger ππ
β¨ SYNOPSIS β¨
nil
system_snapshot( string:outres )
system_snapshot( string:outres, bool:debug=false )
three ways to call it, and the first one is just nil?? iconic behaviour tbh π
β¨ DESCRIPTION β¨
so basically, this function creates a snapshot of the lua scenegraph and stores it as a lua script over in the APPLTEMP namespace, filed under outres π«Ά
but β and this is the plot twist β if debug is set, the engine does NOT write a snapshot. instead it pauses and waits for a debugger to attach to outres π like it's literally holding the door open for your debugger. main character energy fr fr.
β¨ NOTES β¨
- the format it uses is the exact same format used for crash reports and for serialization in monitoring mode π so like, the vibes are consistent across the whole engine.
β¨ EXAMPLE β¨
function system_snapshot0()
a = fill_surface(32, 32, 255, 255, 0);
move_image(a, 100, 100);
zap_resource("testdump.lua");
system_snapshot("testdump.lua");
tbl = system_load("testdump.lua")();
end
look at her go π she fills a surface, moves the image, zap-resources the old testdump.lua out of existence, snapshots into testdump.lua, then loads it right back and calls it. chef's kiss. ate and left no crumbs π
β¨
π¦ quick reminder bestie:zap_resource("testdump.lua")comes before the snapshot, and thesystem_loadcall has that()on the end β that's what actually calls the loaded chunk. keep it exactly like that, don't get cute with it π
and that's the page!! π this was the system manual, October 2026 edition, system_snapshot(3) β go forth and snapshot your scenegraph, you absolute legend πβπ
π¦ where this page comes from
- nixos 26.05: arcan 0.7.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms