feat: easier compilation
- no need to edit KFEditor.ini manually; - the original ModPackages are always kept.
This commit is contained in:
parent
5a8b04c913
commit
2e0b498982
12
README.md
12
README.md
@ -33,16 +33,12 @@ The full changelog is available on [steam workshop](https://steamcommunity.com/s
|
|||||||
|
|
||||||
# Build
|
# Build
|
||||||
1. Install [Killing Floor 2](https://store.steampowered.com/app/232090/Killing_Floor_2/), Killing Floor 2 - SDK and [git for windows](https://git-scm.com/download/win);
|
1. Install [Killing Floor 2](https://store.steampowered.com/app/232090/Killing_Floor_2/), Killing Floor 2 - SDK and [git for windows](https://git-scm.com/download/win);
|
||||||
2. Open the file `C:\Users\<USERNAME>\Documents\My Games\KillingFloor2\KFGame\Config\KFEditor.ini`
|
2. Open git-bash in the folder: `C:\Users\<USERNAME>\Documents\My Games\KillingFloor2\KFGame`
|
||||||
and add the following lines to the `[ModPackages]` section:
|
3. Clone this repository and go to the source folder:
|
||||||
> ModPackages=ServerExt
|
|
||||||
> ModPackages=ServerExtMut
|
|
||||||
3. Open git-bash in the folder: `C:\Users\<USERNAME>\Documents\My Games\KillingFloor2\KFGame`
|
|
||||||
4. Clone this repository and go to the source folder:
|
|
||||||
`git clone https://github.com/inklesspen1scripter/KF2-Server-Extension ./Src && cd ./Src`
|
`git clone https://github.com/inklesspen1scripter/KF2-Server-Extension ./Src && cd ./Src`
|
||||||
5. Run make.sh script:
|
4. Run make.sh script:
|
||||||
`./make.sh --compile`
|
`./make.sh --compile`
|
||||||
6. The compiled files will be here:
|
5. The compiled files will be here:
|
||||||
`C:\Users\<USERNAME>\Documents\My Games\KillingFloor2\KFGame\Unpublished\BrewedPC\Script\`
|
`C:\Users\<USERNAME>\Documents\My Games\KillingFloor2\KFGame\Unpublished\BrewedPC\Script\`
|
||||||
|
|
||||||
# Testing
|
# Testing
|
||||||
|
44
make.sh
44
make.sh
@ -39,8 +39,40 @@ function show_help ()
|
|||||||
echo " -h, --help"
|
echo " -h, --help"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_latest_multini ()
|
||||||
|
{
|
||||||
|
local ApiUrl="https://api.github.com/repos/GenZmeY/multini/releases/latest"
|
||||||
|
local LatestTag=$(curl --silent "$ApiUrl" | grep -Po '"tag_name": "\K.*?(?=")')
|
||||||
|
local DownloadUrl="https://github.com/GenZmeY/multini/releases/download/$LatestTag/multini-windows-amd64.exe"
|
||||||
|
|
||||||
|
mkdir -p "$ThirdPartyBin"
|
||||||
|
curl -LJs "$DownloadUrl" -o "$ThirdPartyBin/multini.exe"
|
||||||
|
}
|
||||||
|
|
||||||
|
function backup_kfeditorconf ()
|
||||||
|
{
|
||||||
|
cp "$KFEditorConf" "$KFEditorConfBackup"
|
||||||
|
}
|
||||||
|
|
||||||
|
function restore_kfeditorconf ()
|
||||||
|
{
|
||||||
|
mv -f "$KFEditorConfBackup" "$KFEditorConf"
|
||||||
|
}
|
||||||
|
|
||||||
|
function set_serverext_modpackages ()
|
||||||
|
{
|
||||||
|
multini --set "$KFEditorConf" 'ModPackages' 'ModPackages' 'ServerExt'
|
||||||
|
multini --add "$KFEditorConf" 'ModPackages' 'ModPackages' 'ServerExtMut'
|
||||||
|
}
|
||||||
|
|
||||||
function compile ()
|
function compile ()
|
||||||
{
|
{
|
||||||
|
if ! command -v multini &> /dev/null; then
|
||||||
|
get_latest_multini
|
||||||
|
fi
|
||||||
|
|
||||||
|
backup_kfeditorconf && set_serverext_modpackages
|
||||||
|
|
||||||
rm -rf "$MutUnpublish"
|
rm -rf "$MutUnpublish"
|
||||||
mkdir -p \
|
mkdir -p \
|
||||||
"$MutUnpublish" \
|
"$MutUnpublish" \
|
||||||
@ -61,6 +93,8 @@ function compile ()
|
|||||||
fi
|
fi
|
||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
|
|
||||||
|
restore_kfeditorconf
|
||||||
}
|
}
|
||||||
|
|
||||||
function brew ()
|
function brew ()
|
||||||
@ -137,8 +171,12 @@ KFGame="$KFBin/Win64/KFGame.exe"
|
|||||||
KFWorkshop="$KFBin/WorkshopUserTool.exe"
|
KFWorkshop="$KFBin/WorkshopUserTool.exe"
|
||||||
|
|
||||||
KFDoc="$DocumentsPath/My Games/KillingFloor2"
|
KFDoc="$DocumentsPath/My Games/KillingFloor2"
|
||||||
|
KFConfig="$KFDoc/KFGame/Config"
|
||||||
|
|
||||||
MutSource="$KFDoc/KFGame/src"
|
KFEditorConf="$KFConfig/KFEditor.ini"
|
||||||
|
KFEditorConfBackup="${KFEditorConf}.backup"
|
||||||
|
|
||||||
|
MutSource="$KFDoc/KFGame/Src"
|
||||||
MutPubContent="$MutSource/PublicationContent"
|
MutPubContent="$MutSource/PublicationContent"
|
||||||
MutUnpublish="$KFDoc/KFGame/Unpublished"
|
MutUnpublish="$KFDoc/KFGame/Unpublished"
|
||||||
MutPublish="$KFDoc/KFGame/Published"
|
MutPublish="$KFDoc/KFGame/Published"
|
||||||
@ -151,6 +189,10 @@ MutTestingIni="$MutSource/testing.ini"
|
|||||||
MutWsInfoName="wsinfo_serverext.txt"
|
MutWsInfoName="wsinfo_serverext.txt"
|
||||||
MutWsInfo="$KFDoc/$MutWsInfoName"
|
MutWsInfo="$KFDoc/$MutWsInfoName"
|
||||||
|
|
||||||
|
ThirdPartyBin="$MutSource/3rd-party-bin"
|
||||||
|
|
||||||
|
export PATH="$PATH:$ThirdPartyBin"
|
||||||
|
|
||||||
if [[ $# -eq 0 ]]; then show_help; exit 0; fi
|
if [[ $# -eq 0 ]]; then show_help; exit 0; fi
|
||||||
case $1 in
|
case $1 in
|
||||||
-h|--help ) show_help ; ;;
|
-h|--help ) show_help ; ;;
|
||||||
|
Loading…
Reference in New Issue
Block a user