2022-05-25 08:50:15 +01:00
2022-05-25 09:08:10 +01:00
This project was created to automate most parts of building and setting up an environment.
2022-10-04 15:08:59 +01:00
## **NodeJS:**
2022-05-25 09:10:25 +01:00
2022-10-04 15:01:02 +01:00
The first step would be to install nodejs on your pc, the version you NEED is **16.17.1**
2022-05-25 09:10:25 +01:00
2022-05-25 08:50:15 +01:00
That version is the one that has been used to test the mod templates and build scripts.
2022-05-25 09:10:25 +01:00
2022-10-04 15:02:11 +01:00
It can be downloaded from here: https://nodejs.org/dist/v16.17.1/node-v16.17.1-x64.msi
2022-05-25 09:10:25 +01:00
2022-05-25 08:50:15 +01:00
A system reboot may be needed after install.
2022-05-25 09:10:25 +01:00
## **IDE:**
2022-08-23 21:56:08 +01:00
The second step is having an IDE ready. We've setup a VSCodium workspace file to help with this.
2022-05-25 09:10:25 +01:00
2023-07-29 13:54:41 +01:00
You CAN use Visual Studio Code if you so desire, just keep in mind that our devs tests on the mod files was done using VSCode.
2022-05-25 09:10:25 +01:00
2023-07-29 13:54:41 +01:00
You can get VSCode here: https://code.visualstudio.com/
2022-05-25 08:50:15 +01:00
2022-05-25 09:10:25 +01:00
## **Workspace:**
2023-07-29 13:54:41 +01:00
Once you have NodeJS and VSCode/VSCodium ready, open the mod.code-workspace file with VSCode (File->Open Workspace from File...).
2022-05-25 09:10:25 +01:00
2023-07-29 13:54:41 +01:00
Once the project loads you may be recommended to install the ESLint plugin. This is HIGHLY recommended.
2022-05-25 08:50:15 +01:00
2022-05-25 09:10:25 +01:00
## **Environment Setup:**
2022-05-25 08:50:15 +01:00
There is a task that will automatically setup your environment to use typescript.
2022-05-25 09:10:25 +01:00
2022-05-25 09:08:10 +01:00
To run it, you just need to go to:
> Terminal->Run Task...->Show All Tasks...->npm: install
2022-05-25 08:50:15 +01:00
After running this task, your environment will be ready to start coding.
2022-05-25 09:10:25 +01:00
2022-05-25 08:50:15 +01:00
DO NOT remove the node_modules folder, this is an auto generated directory that has the required dependencies to be able to use typescript and more.
2022-05-25 09:10:25 +01:00
## **IMPORTANT:**
2022-05-25 08:50:15 +01:00
Before starting to work on your mod, we suggest you read about Dependency Injection and Inversion of Control as this is the adopted architecture SPT-AKI has adopted.
2022-05-25 09:10:25 +01:00
2022-05-25 08:50:15 +01:00
It will be difficult to understand some of the problems you may be having if you dont understand the basics of it.
2022-05-25 09:10:25 +01:00
2022-05-25 08:50:15 +01:00
A guide explaining all the essentials will be available on the hub on release for you to read about.
2022-05-25 09:10:25 +01:00
## **Coding:**
2022-05-25 08:50:15 +01:00
All your work should be centered around the mod.ts file as an entry point.
2022-05-25 09:08:10 +01:00
You can ONLY change the following properties from the package.json file: `"name"` , `"version"` , `"license"` : `"MIT"` , `"author"` , `"akiVersion"` .
2022-05-25 09:10:25 +01:00
2022-05-25 09:08:10 +01:00
If you have never used typescript before, you can read about it here: https://www.typescriptlang.org/docs/
2022-05-25 08:50:15 +01:00
2022-05-25 09:10:25 +01:00
## **Distributing your mod:**
2022-05-25 08:50:15 +01:00
The project has been set up with an automatic task that will copy and zip ALL required files for your mod to work on SPT-AKI.
2022-05-25 09:08:10 +01:00
To run this task you just need to go to:
2022-05-25 08:50:15 +01:00
2022-05-25 09:08:10 +01:00
> Terminal->Run Task...->Show All Tasks...->npm: build:zip
2022-05-25 08:50:15 +01:00
2022-05-25 09:08:10 +01:00
The output will be a mod.zip file that will appear on the root of the project.
2022-05-25 09:10:25 +01:00
2022-05-25 09:08:10 +01:00
Always verify that all files were included into the zip file.