⚉ How do I create a new achievement?
Answer:
Ensure you follow these steps properly if you are creating a new achievement. Failure to do things properly will mean that your achievement won't load.
- Within your server, navigate to the achievements folder:
xtask/lua/achievements/*
- Enter/create a new folder based on the category you want the achievement to fall under
ensure the new folder name does not contain spaces or special characters.
- Create a new file which will store the code for your achievement
ensure the new file name does not contain spaces or special characters, and that the file ends in .lua
- Open the newly created file in a text editor such as Visual Studio Code, Atom, Notepad++, etc.
- Begin writing your new achievement. You will need to provide the proper values for your achievement, which can be copied from an existing achievement. If you need a more detailed description of what each value does; you can open the provided template file which is located in
xtask/lua/achievements/@template.lua
- Save the achievement file once you have finished writing the code.
- Restart your server, and wait for it to finish. You may then connect to your server with gmod, and activate the achievement ui by pressing the toggle key ( F7 by default ).
- If you are able to locate your achievement within the overall list; it has been properly loaded. You can start testing to ensure it works properly.