67 lines
3.5 KiB
Markdown
Raw Permalink Normal View History

2024-07-06 22:15:30 +01:00
# Welcome to the SPT Modding Project
2022-05-25 21:24:29 +01:00
2024-07-06 22:18:12 +01:00
This project is designed to streamline the initial setup process for building and creating mods in the SPT environment. Follow this guide to set up your environment efficiently.
2022-05-25 21:24:29 +01:00
## **Table of Contents**
- [NodeJS Setup](#nodejs-setup)
- [IDE Setup](#ide-setup)
- [Workspace Configuration](#workspace-configuration)
- [Environment Setup](#environment-setup)
- [Essential Concepts](#essential-concepts)
- [Coding Guidelines](#coding-guidelines)
- [Distribution Guidelines](#distribution-guidelines)
2022-05-25 21:24:29 +01:00
## **NodeJS Setup**
2022-05-25 21:24:29 +01:00
Before you begin, ensure to install NodeJS version `v20.11.1`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/).
2022-05-25 21:24:29 +01:00
After installation, it's advised to reboot your system.
2022-05-25 21:24:29 +01:00
## **IDE Setup**
2022-05-25 21:24:29 +01:00
For this project, you can work with either [VSCodium](https://vscodium.com/) or [VSCode](https://code.visualstudio.com/). However, we strongly recommend using VSCode, as all development and testing have been carried out using this IDE, ensuring a smoother experience and compatibility with the project setups. Either way, we have a prepared a workspace file to assist you in setting up your environment.
2022-05-25 21:24:29 +01:00
## **Workspace Configuration**
2022-05-25 21:24:29 +01:00
With NodeJS and your chosen IDE ready, initiate the `mod.code-workspace` file using your IDE:
2022-05-25 21:24:29 +01:00
> File -> Open Workspace from File...
2022-05-25 21:24:29 +01:00
Upon project loading, consider installing recommended plugins like the ESLint plugin.
2022-05-25 21:24:29 +01:00
## **Environment Setup**
2022-05-25 21:24:29 +01:00
An automated task is available to configure your environment for Typescript utilization:
2022-05-25 21:24:29 +01:00
> Terminal -> Run Task... -> Show All Tasks... -> npm: install
2022-05-25 21:24:29 +01:00
Note: Preserve the `node_modules` folder as it contains necessary dependencies for Typescript and other functionalities.
2022-05-25 21:24:29 +01:00
## **Essential Concepts**
2022-05-25 21:24:29 +01:00
2024-07-06 22:18:12 +01:00
Prioritize understanding Dependency Injection and Inversion of Control, the architectural principles SPT adopts. Comprehensive guidelines will be available on the hub upon release.
2022-05-25 21:24:29 +01:00
Some resources to get you started:
- [A quick intro to Dependency Injection](https://www.freecodecamp.org/news/a-quick-intro-to-dependency-injection-what-it-is-and-when-to-use-it-7578c84fa88f/)
- [Understanding Inversion of Control (IoC) Principle](https://medium.com/@amitkma/understanding-inversion-of-control-ioc-principle-163b1dc97454)
2022-05-25 21:24:29 +01:00
## **Coding Guidelines**
2022-05-25 21:24:29 +01:00
2024-07-06 22:15:30 +01:00
Focus your mod development around the `mod.ts` file. In the `package.json` file, only alter these properties: `"name"`, `"version"`, `"sptVersion"`, `"loadBefore"`, `"loadAfter"`, `"incompatibilities"`, `"isBundleMod"`, `"author"`, and `"license"`.
2022-05-25 21:24:29 +01:00
New to Typescript? Find comprehensive documentation on the [official website](https://www.typescriptlang.org/docs/).
2022-05-25 21:24:29 +01:00
## **Distribution Guidelines**
2022-05-25 21:24:29 +01:00
2024-07-06 22:18:12 +01:00
Automated tasks are set up to bundle all necessary files for your mod to function in SPT:
2022-05-25 21:24:29 +01:00
> Terminal -> Run Task... -> Show All Tasks... -> npm: build
2022-05-25 21:24:29 +01:00
The ZIP output, located in the `dist` directory, contains all required files. Ensure all files are included and modify the `.buildignore` file as needed. This ZIP file is your uploadable asset for the hub.
2022-05-25 21:24:29 +01:00
## **Conclusion**
2022-05-25 21:24:29 +01:00
2024-07-06 22:18:12 +01:00
With this setup, you're ready to begin modding with SPT. If you run into any trouble be sure to check out the [modding documentation on the hub](https://hub.sp-tarkov.com/doc/lexicon/66-modding/). If you really get stuck feel free to join us in the [#mods-development](https://discord.com/channels/875684761291599922/875803116409323562) official Discord channel.
2022-05-25 21:24:29 +01:00
Build something awesome!