Documentation
¶
Overview ¶
Command modlock-entitygen generates the typed entity classes and console of the TypeScript, Go and Luau mod libraries from a game dump, the directory modlock-host --dump writes. Each output flag names a library's source directory:
modlock-entitygen -dump data/dump -ts js/src -go mod -luau luau/modlock
Every server class that derives from CEntityInstance becomes a class with an accessor per field the host can read: scalars, vectors, angles, entity handles and strings. Each field but a string can also be written. An accessor finds its field by name, so a game update that moves a field needs no new build of a mod; one that renames or drops a field needs regenerated classes.
Each class also has a method per input it accepts that takes one value of a type FireInput sends, or none, and each designer name has a constructor over CreateEntity whose options type its spawn key values.
Each console variable of a scalar or string type has a typed setter, and each console command a runner, both over ServerCommand.
The output depends only on the dump, so regenerating after a game update changes only what the update changed.