> For the complete documentation index, see [llms.txt](https://guthen.gitbook.io/guthscp/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guthen.gitbook.io/guthscp/developpers/api.md).

# API

### Why can't I find all the documentation in this wiki?

Most of the documentation of functions in `guthscpbase` are only present in the source code for two reasons:

1. As there is no documentation generator for the *code documentation convention* I use, it is less work to only maintain one side.
2. It allows you *─ as a (probably) future module developper,* to fully understand the limitations and usage of the code behind these functions since you can directly read the source code at the same time that reading its documentation.

*TLDR: usual developper laziness*

Despite these reasons, I will try to write documentation in this wiki for important classes and systems as well as for tutorials. Unfortunately, this take time so if you find yourself having questions that this wiki can't answer, I encourage you to read the code or to contact me via a [Github issue](https://github.com/Guthen/guthscpbase/issues) or [Discord](https://discord.com/invite/3dx8EGbwvK).

### Source Code

Here you can find a short summary of each file purpose:

* [`autorun/`](https://github.com/Guthen/guthscpbase/tree/master/lua/autorun)
  * [`guthscp_main.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/autorun/guthscp_main.lua): addon's loader, contain functions for console logging & requiring folder and files
* [`entities/guthscp_base/`](https://github.com/Guthen/guthscpbase/tree/master/lua/entities/guthscp_base)
  * [`cl_init.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/entities/guthscp_base/cl_init.lua): client-side part of the base entity, contain the dynamic hand symbol's code
  * [`init.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/entities/guthscp_base/init.lua): server-side part of the base entity
  * [`shared.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/entities/guthscp_base/shared.lua): usual shared entity file
* [`guthscp/`](https://github.com/Guthen/guthscpbase/tree/master/lua/guthscp)
  * [`keter/`](https://github.com/Guthen/guthscpbase/tree/master/lua/guthscp/keter)
    * [`config/`](https://github.com/Guthen/guthscpbase/tree/master/lua/guthscp/keter/config)
      * [`cl_init.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/guthscp/keter/config/cl_init.lua): client-side part of the configuration system, mostly vgui related code
      * [`helpers.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/guthscp/keter/config/helpers.lua): configuration helpers functions to create custom elements
      * [`shared.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/guthscp/keter/config/shared.lua): shared part of the configuration system
      * [`sv_init.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/guthscp/keter/config/sv_init.lua): server-side part of the configuration system
    * [`core/`](https://github.com/Guthen/guthscpbase/tree/master/lua/guthscp/keter/core)
      * [`client/`](https://github.com/Guthen/guthscpbase/tree/master/lua/guthscp/keter/core/client)
        * [`cl_sound_channel.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/guthscp/keter/core/client/cl_sound_channel.lua): client-side part of the custom sound system
        * [`cl_spawnmenu.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/guthscp/keter/core/client/cl_spawnmenu.lua): custom spawnmenu
      * [`server/`](https://github.com/Guthen/guthscpbase/tree/master/lua/guthscp/keter/core/server)
        * [`sv_player_speed.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/guthscp/keter/core/server/sv_player_speed.lua): custom player speed modifiers system
        * [`sv_sound_channel.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/guthscp/keter/core/server/sv_sound_channel.lua): server-side part of the custom sound system
      * [`shared/`](https://github.com/Guthen/guthscpbase/tree/master/lua/guthscp/keter/core/shared)
        * [`filters/`](https://github.com/Guthen/guthscpbase/tree/master/lua/guthscp/keter/core/shared/filters)
          * [`filter.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/guthscp/keter/core/shared/filters/filter.lua): base class to filter list of entities with specific constraints
          * [`map_entities_filter.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/guthscp/keter/core/shared/filters/map_entities_filter.lua): subclass to filter list of map entities
          * [`players_filter.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/guthscp/keter/core/shared/filters/players_filter.lua): subclass to filter list of players, useful to manage a list of SCPs
        * [`data.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/guthscp/keter/core/shared/data.lua): utility functions for data files management
        * [`event_handler.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/guthscp/keter/core/shared/event_handler.lua): class to handle custom events listeners
        * [`npcs.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/guthscp/keter/core/shared/npcs.lua): managing a list of active NPCs
        * [`player_message.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/guthscp/keter/core/shared/player_message.lua): utility function to draw a message at the bottom of the screen of a player
        * [`sound.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/guthscp/keter/core/shared/sound.lua): function to play a client sound
        * [`team.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/guthscp/keter/core/shared/team.lua): utility functions for getting active SCPs players & managing the `TEAM_` names
        * [`world.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/guthscp/keter/core/shared/world.lua): utility functions for using 3D space
    * [`module/`](https://github.com/Guthen/guthscpbase/tree/master/lua/guthscp/keter/module)
      * [`loader.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/guthscp/keter/module/loader.lua): module loader system, handle everything
      * [`meta.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/guthscp/keter/module/meta.lua): define the `MODULE` class: its properties and its methods
    * [`helpers.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/guthscp/keter/helpers.lua): utility functions for semantic versioning
    * [`table.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/guthscp/keter/table.lua): utility functions for table manipulation
  * [`modules/base/`](https://github.com/Guthen/guthscpbase/tree/master/lua/guthscp/modules/base)
    * [`workarounds/`](https://github.com/Guthen/guthscpbase/tree/master/lua/guthscp/modules/base/workarounds)
      * [`cptbase_shouldcollide.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/guthscp/modules/base/workarounds/cptbase_shouldcollide.lua): workaround for fixing CPTBase's `ShouldCollide` hook conflict
      * [`playable_piano_playeruse.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/guthscp/modules/base/workarounds/playable_piano_playeruse.lua): workaround for fixing Playable Piano's `PlayerUse` conflict
    * [`main.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/guthscp/modules/base/main.lua): entry point of the `base` module, useful to get a real module example
    * [`sv_entity_breaking.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/guthscp/modules/base/sv_entity_breaking.lua): custom entity breaking system
    * [`unit_test.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/guthscp/modules/base/unit_test.lua): development unit testing file, actually used for `guthscp.helpers.compare_versions` & `guthscp.event_handler`
* [`vgui/`](https://github.com/Guthen/guthscpbase/tree/master/lua/vgui)
  * [`guthscp_label_icon.lua`](https://github.com/Guthen/guthscpbase/blob/master/lua/vgui/guthscp_label_icon.lua): clickable vgui containing a left-anchored icon and a label
