system_snapshot(3)

πŸ“¦
version 0.7.1 Β· 2 versions
, in nixos 26.05

πŸ’… 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 ✨

  1. 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 the system_load call 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