xhookLua
Game

game

Game files as the engine sees them, .pak archives included.

Functions

game.read_file

game.read_file(path) -> string
NameTypeDescription
pathstringRelative to the game, like "sound/weapons/ak47-1.wav".

Whole file as a string.

Returns nil, err when missing

Absolute paths and .. are refused.

game.list

game.list([dir]) -> string[]
NameTypeDescription
diroptionalstringDefault the game root.

Names in a game folder, sorted. Folders end in /.

Merges every search folder and pak0.pak to pak9.pak; a name shows once.

game ยท Lua API ยท xhook