Skip to content

Draft: Allow Lua scripts to arbitrarily read a lump.

Golden requested to merge Golden/SRB2:io_openlump into next

Adds a new io function: io.openlump(string filename, string mode): open a lump for reading.

  • Throws an error if the Lua script is not within a PK3 or WAD.
  • Helpful for default configs in PK3s and WADs where the scripter doesn't want to include one directly in the Lua scripts themselves.

NOTE: To accomplish this, internally the lump's data is copied over to a temporary file, which is then given to Lua. This implementation detail can be replaced with a better method down the line without effecting the perceived behavior to Lua scripters.

Despite this being a small change, I don't expect this will make it to 2.2.9 release; it'd be preferable if merging this were delayed to when SRB2 becomes more stable.

In the mean time, curious scripters can checkout and compile the branch themselves.

Edited by LJ Sonic

Merge request reports

Loading