Please see this gmod wiki page on file structure first.
File Structure Overview
If this looks imposing, don’t worry. You probably don’t need to deal with most of these. Skip to the next section maybe.
materials/,models/,particles/,sound/, `resource/lua/acf/ballistics/- Ballistics helper functionscombat/- Many restrictions and checks that are automatically enforced by the addoncompatibility/- Backwards compatibility codecontraption/- Code related to tracking information of contraptionscore/classes/- Class constructorslaser/- Laser computer codenetworking/- Networking and modelling librariesoverlay/- Overlay libraryutilities/- Various helper functions
damage/- Damage related helper functions and objectsentities/- Class instantiationshooks/- ??? :Pmenu/items_cl/- Contains many of the sub menus accessible from the main menu, e.g. for certain entities like crew.operations/- Helper functions for the main menu and copy tool.
missiles/- Various helper functions for missilesmobility/objects_sv/link.lua- Link objects used in gearboxespersisted_vars/vars_cl.lua- Client side ACF settings that persist across sessionsscanner/scanner_sh.lua- ACF scanner code
acf_devtools/- Compatibility support for dev tools extensionsautorun/,includes/- Loads the entire addon. You probably don’t need to touch this.cfw/extensions/- Code related to tracking information of contraptionseffects/- Definitions each lua effectentities/- Main entity logicponder/- Ponder tutorialsstarfall/- Starfall library supporttests/- Definitions for GLuaTestsvgui/acf_panel.lua- Defines different ACF panel typesweapons/- Definitions for tools. Combat weapons found in another repository.
Use cases
Class system
- The class constructors (how to create a type of class) are located in
lua/acf/core/classes/*/registration.lua - The class instances (examples of a type of class) are defined in
lua/acf/entities
Creating a menu
- Create a new menu in
lua/acf/menu/items_cl, similar to the other example menus there.- The various types of ACF panels you can call are located in
lua/vgui/acf_panel.lua.
- The various types of ACF panels you can call are located in
ACF Constants and Settings
- Constants and settings are defined in
lua/acf/core/globalslua.
Chip libraries
- Expresion2 functions located in
lua/entities/gmod_wire_expression2/ - Starfall functions located in
lua/starfall/libs_sh/acffunctions.lua
Tools
- Tools are defined in
lua/weapons.