Mod Structure
Explaining how to create and run a custom mod
Summary
This page will tell you how the CET mod folder structure works. To download a ready-to-go example project, check the wiki's github repo.
Setting up the folder
Create a new folder in the <
>/mods/
folder to get started, e.g. my_mod
(snake case recommended)
Setting up init.lua
file
init.lua
fileCET will be looking for an init.lua
file inside your mod folder. This is the entry point of your mod, and gets executed when the game is launched.
Firing up the code
The init.lua
file is the only file that gets automatically loaded, thus should contain all your initialization code.
Start by printing simple info into the CET Console using the print() function. Then register a listener on the onInit event, and print something else.
Launch the game, and open the CET Console. You should see your printed text.
Creating mods
To now actually create a complex mod, you'll want to interact with the game's system, modify and create instances of game classes and modify the game's code. For that, head to the Scripting API section
Additionally read up on the CET Functions, for information on how to create custom keybinds, Observer and Override game functions, spawn objects and more
Last updated