Skip to content

Simple and Advanced Addons

offyerrocker edited this page Nov 18, 2020 · 3 revisions

Simple Addons require no code knowledge and contain no code- only the assets in the correct file format, with the folder structure organized correctly. If created and installed correctly, ACH will handle all code related to loading assets and generating localization/menu data.

Simple Addons for Hitmarkers and Textures are essentially in the same format. They are individual or groups of textures that can be used as hitmarkers or crosshairs, but cannot contain custom animation functions, cannot be resized (except by editing the image file itself), and are otherwise very limited in their ability, but are very easy to create and install.

Advanced Addons are added via code; some knowledge of code may be required, depending on the complexity of your intended addon. The code itself is contained within a single addon.lua file inside your Addon Parent Folder. This lua file does not need a mod.txt or a main.xml file to be read; instead, ACH will scan each addon folder for this lua file and execute it. Compilation/syntax errors will cause the addon to be skipped and not loaded, and the error message/reason will be printed to the BLT log.

If for some reason you wish to load your addons from outside of ACH's addon folder system, you can create your addon as a normal sBLT or BeardLib Lua mod, with the following structure: (recommended to hook to lib/managers/menumanager)

Hooks:Add("ACH_LoadAllAddons",WRITE_A_UNIQUE_HOOK_ID_HERE,function()
	Hooks:Call("ACH_LoadAddon_Crosshair",WRITE_ADDON_ID_HERE,WRITE_ADDON_DATA_TABLE_HERE)
end)

However, there are very few cases where one would need to create an entirely separate BLT/BeardLib mod to handle adding an addon to ACH. I strongly advise you to use the existing addon folder system if possible.

Because Advanced Addons are designed for users who want more control in their addons' features, their folder structure is not as important.

Currently, Advanced Hitsound Addons have no significant benefit over Simple Hitsound Addons.

The following example addon packs provide useful templates and comments for creating their respective addon types:

Crosshair Pack Addon: https://modworkshop.net/mod/29819

Hitsound Pack Addon: https://modworkshop.net/mod/29820

Hitmarker Pack Addon: https://modworkshop.net/mod/29821

Clone this wiki locally