📦Package Creation
A guide to creating your own package on gpm.
For the most part, gpm packages do not differ from classic lua addons, main difference is the way they are run and the execution environment, which allows more efficient development of addons, libraries and frameworks.
Make your first package
Creating folder for your package
First what we need to do is create our addon folder in garrysmod/addons
like garrysmod/addons/my-first-package/
where my-first-package is our package name.
As we plan to create a package on lua we will need the following folders and full path with them will look like this: garrysmod/addons/my-first-package/lua/packages/
Single-file package ( Simple package )
This is a package that is simply an executable file that runs everywhere identically and automatically, such packages have no version and no parameters, they obey the default configuration.
If we want to create single-file package, we need to .
Multi-file package ( Classic package )
This package can have a full-fledged, almost unlimited complex multi-file structure, the complexity of which depends directly on its developer, such a package must have a package.lua
file to ignore default configuration.
If we want to create a package, we need to create and in this folder create a file with package configuration.
package.lua
package.lua
Example of most package file variables
Tricks
Configuration file can run any scripts and operations to get more information about the package, it has access to all glua global variables.
It is not necessary to declare parameters for a package file as in the example, you can just return a table or create a Package table.
Package file is case insensitive, so we can format it as we like.
Last updated