1
0
KF2-BuildTools/README.md

124 lines
5.0 KiB
Markdown
Raw Permalink Normal View History

# KF2-BuildTools
[![version](https://img.shields.io/github/v/tag/genzmey/KF2-BuildTools)](https://github.com/GenZmeY/KF2-BuildTools/tags)
2023-05-10 00:02:50 +00:00
[![shellcheck](https://github.com/GenZmeY/KF2-BuildTools/actions/workflows/shellcheck.yml/badge.svg)](https://github.com/GenZmeY/KF2-BuildTools/actions/workflows/shellcheck.yml)
[![MegaLinter](https://github.com/GenZmeY/KF2-BuildTools/actions/workflows/mega-linter.yml/badge.svg?branch=master)](https://github.com/GenZmeY/KF2-BuildTools/actions/workflows/mega-linter.yml)
[![docs-autoupdate](https://github.com/GenZmeY/KF2-BuildTools/actions/workflows/docs-autoupdate.yml/badge.svg)](https://github.com/GenZmeY/KF2-BuildTools/actions/workflows/docs-autoupdate.yml)
[![license](https://img.shields.io/github/license/GenZmeY/KF2-Server-Extension)](LICENSE)
## Features
- Build, brew, test and upload to Steam Workshop;
- No need to edit KFEditor.ini at all;
- Sources can be stored in any path;
- Easily switch between different projects.
## Requirements
2022-09-02 09:30:53 +00:00
- [Killing Floor 2](https://store.steampowered.com/app/232090/Killing_Floor_2/);
- Killing Floor 2 - SDK;
- [git-bash](https://git-scm.com/download/win).
## Add to your project
2022-03-03 18:21:03 +00:00
Make sure that the location of folders and files in your project as follows (Correct it if it's not):
2022-02-20 19:59:39 +00:00
`/<PackageName>/Classes/*.uc`
2022-03-03 17:31:13 +00:00
**There are two ways to add KF2-BuildTools to your project:**
### 1. As [git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules)
Open git-bash and go to your project: `cd <your_project_path>`
2022-02-20 19:59:39 +00:00
Add submodule: `git submodule add https://github.com/GenZmeY/KF2-BuildTools tools`
2023-05-10 03:12:32 +00:00
**updating build tools (manual)**
2022-02-20 19:59:39 +00:00
Get updates: `pushd tools && git pull && popd`
Commit the changes: `git add tools && git commit -m 'update tools'`
2023-05-10 03:12:32 +00:00
## Updating build tools
Since version 1.9.0 build script can update itself:
`./tools/builder --update`
*if you have an older version you need to update once manually to start using this feature*
### 2. As standalone script
Just create a `tools` folder and put [builder](builder) there.
Now you can use the script in the same way as in the first case, but you will have to update it yourself.
## Usage
2022-02-20 19:59:39 +00:00
Available commands can be found here: [USAGE.md](USAGE.md)
2022-02-20 19:59:39 +00:00
If you have a simple mutator or game mode, then the usage is also simple: just use [the commands](USAGE.md) to compile, test and upload to the steam workshop.
2022-03-03 17:31:13 +00:00
![demo](example.gif)
### The result can be found here
2022-03-03 17:31:13 +00:00
**Compiled packages:**
`C:\Users\<username>\Documents\My Games\KillingFloor2\KFGame\Unpublished\`
2022-03-03 17:31:13 +00:00
**Brewed packages:**
`C:\Users\<username>\Documents\My Games\KillingFloor2\KFGame\Published\`
2022-03-03 17:31:13 +00:00
**Uploaded packages:**
your steam workshop 🙃
## Usage (Advanced)
If your project contains several mutators, *.upk files, external dependencies, or you want to customize the whole process in more details, then this section is for you.
### Setup
2022-03-03 17:31:13 +00:00
When you run compilation for the first time or do `./tools/builder --init` `builder.cfg` appears in your project folder.
Edit it to set build/test/upload options. The config contains the necessary comments inside.
2022-09-02 08:51:25 +00:00
Edit the files in the `PublicationContent` folder - they are responsible for the description in the Steam Workshop.
2022-03-03 17:31:13 +00:00
### Project filesystem
2022-03-03 17:31:13 +00:00
If you have *.upk or localization files, they must be in a specific location.
Change the filesystem of the project to such a form that everything works correctly:
```text
2022-03-03 17:31:13 +00:00
/SomePackageName1
*.upk
/Classes
*.uc
*.upkg
/SomePackageName2
*.upk
/Classes
*.uc
*.upkg
2022-09-01 17:40:14 +00:00
/PublicationContent
preview.png
description.txt
tags.txt
title.txt
/Localization
/INT
*.int
2022-03-03 17:31:13 +00:00
/Config
*.ini
2022-09-01 17:40:14 +00:00
/BrewedPC
*.*
2022-03-03 17:31:13 +00:00
/tools
builder
builder.cfg
```
2022-09-02 08:51:25 +00:00
**Note:** Use the `BrewedPC` folder for additional content such as sound files for your weapons or other stuff. This will be copied to the final BrewedPC before being uploaded to the workshop.
By the way, this allows you to use a script to upload maps (although this was not its original purpose). Just put the map(s) in `BrewedPC` (don't forget to edit the `PublicationContent`) and run `./tools/builder -u`.
### Examples (Projects that use KF2-BuildTools)
2022-09-02 08:51:25 +00:00
**Simplest case (one mutator):**
- [AdminAutoLogin](https://github.com/GenZmeY/KF2-AdminAutoLogin)
- [StartWave](https://github.com/GenZmeY/KF2-StartWave)
- [TAWOD](https://github.com/GenZmeY/KF2-TAWOD)
- [ZedSpawner](https://github.com/GenZmeY/KF2-ZedSpawner)
**Mutator + Localization:**
- [ControlledVoteCollector](https://github.com/GenZmeY/KF2-ControlledVoteCollector)
- [CustomTraderInventory](https://github.com/GenZmeY/KF2-CustomTraderInventory)
- [YetAnotherScoreboard](https://github.com/GenZmeY/KF2-YetAnotherScoreboard)
**Two mutators are compiled, there are upk and localization:**
- [ServerExt](https://github.com/GenZmeY/KF2-Server-Extension)
**Three mutators are compiled (one of them is a dependency),**
**two mutators are uploaded to the steam workshop:**
- [UnofficialMod](https://github.com/GenZmeY/UnofficialMod)
## License
2023-05-10 00:54:00 +00:00
[![license](https://www.gnu.org/graphics/gplv3-with-text-136x68.png)](LICENSE)