`loadfile` in Lua
A loadfile
implementation for SRB2.
Lua scripters:
-
loadfile
exists now, and it's basicallydofile
, but instead of calling the file immediately, the file is returned as a function for you to do stuff with, like sending it arguments and doingsetfenv
shenanigans.
C people:
-
LUA_DoLump
replaces the oldLUA_LoadLump
;LUA_LoadLump
doesloadfile
stuff now. -
LUA_DoLump
(and by extensiondofile
) is now implemented internally as the equivalent ofloadfile("filename.lua")()
Here's a cool PK3 that self-tests itself. It will check for basically every case I've thought of so far.
loadfile.pk3
Edited by Golden