Skip to content
/ luavmt Public

Lua valve key value structure standalone parser for Garry's mod

License

Notifications You must be signed in to change notification settings

xUnkNx/luavmt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

luavmt

Lua Valve key value structure standalone parser for Garry's mod

Parser is based on info provided at https://developer.valvesoftware.com/wiki/Category:List_of_Shader_Parameters WARNING! Garry's mod already contains special function util.KeyValuesToTable, but its not always parse everything (also doesn't return 0-level keys which in VMT is shadernames). IMaterial:GetKeyValues returns only correct textures that support game engine. This can be used to parse valve key value structure.

Valve Key Value Structure (EBNF) as i understand (that used to VMT and etc.):

COMMENTLINES = "/*", ? any character - "*/" ?, "*/" ; (* WARNING! Its not supported by VMT, but models/headcrab_classic/headcrabsheet.vmt contains this. *)
COMMENTLINE = "//", ? any character - "\n" ? , "\n" ; (* Not used in terminal symbols below, because it can be anywhere. *)
VMT = QUOTEDKEY | KEY , QUOTEDVALUE | VALUE ;

QUOTEDKEY = '"' , KEY , '"' ;
KEY = NUMBER | STRING ;
QUOTEDVALUE = '"' , VALUE , '"' ;
VALUE = STRING | NUMBER | TABLE | VECTOR ;

TABLE = "{" , KEY , VALUE , "}" , { TABLE } ;
VECTOR = "[" , NUMBER , [ NUMBER ] , [ NUMBER ], "]" ; (* why models/props_combine/combine_tower01b.vmt closes [ with } ??? *)
STRING = { SPECIAL | CHAR | NUMBER } ;
NUMBER = [ "-" ] , [ DIGIT , { DIGIT } ] , [ "." , DIGIT , { DIGIT } ] ;

DIGIT = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ;
CHAR = ? Any character based on file system, language and etc. - SPECIAL ? ;
SPECIAL = "?" | "<" | "$" | "_" | "\" | "/" ;

About

Lua valve key value structure standalone parser for Garry's mod

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages