diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..5ace460 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e2c44d6 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,90 @@ +name: CI + +on: [push, pull_request, workflow_dispatch] + +jobs: + build: + name: "Build" + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-24.04] + include: + - os: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - name: Build sourcemod plugin + uses: maxime1907/action-sourceknight@v1 + with: + cmd: build + + - name: Create package + run: | + mkdir -p /tmp/package + cp -R .sourceknight/package/* /tmp/package + cp -R materials /tmp/package/common/ + cp -R models /tmp/package/common/ + + - name: Upload build archive for test runners + uses: actions/upload-artifact@v4 + with: + name: ${{ runner.os }} + path: /tmp/package + + tag: + name: Tag + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' + + - uses: dev-drprasad/delete-tag-and-release@v1.1 + if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' + with: + delete_release: true + tag_name: latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - uses: rickstaa/action-create-tag@v1 + if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' + with: + tag: "latest" + github_token: ${{ secrets.GITHUB_TOKEN }} + + release: + name: Release + if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' + needs: [build, tag] + runs-on: ubuntu-latest + steps: + - name: Download artifacts + uses: actions/download-artifact@v4 + + - name: Versioning + run: | + version="latest" + if [[ "${{ github.ref_type }}" == 'tag' ]]; then + version=`echo $GITHUB_REF | sed "s/refs\/tags\///"`; + fi + echo "RELEASE_VERSION=$version" >> $GITHUB_ENV + + - name: Package + run: | + ls -Rall + if [ -d "./Linux/" ]; then + cd ./Linux/ + tar -czf ../${{ github.event.repository.name }}-${{ env.RELEASE_VERSION }}.tar.gz -T <(\ls -1) + cd - + fi + + - name: Release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: '*.tar.gz' + tag: ${{ env.RELEASE_VERSION }} + file_glob: true + overwrite: true \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2a04272 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +build/ +release/ + +.DS_Store +.vscode + +*.smx +plugins/ +.sourceknight +.venv \ No newline at end of file diff --git a/README.md b/README.md index 3890473..15c9723 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,46 @@ # sm-plugins-FixMapFiles -Download fixed files for multiple maps + +A SourceMod plugin that automatically downloads and applies fixed files for specific maps in Counter-Strike: Source. + +## Description + +This plugin automatically applies necessary file fixes for specific maps when they are loaded. It handles two main types of fixes: + +1. Paranoid Rezurrection specific fixes +2. Gargantua model fixes (applies to multiple maps) + +## Supported Maps + +### Maps with Paranoid + Gargantua Fixes +- `ze_paranoid_rezurrection_v11_9` + +### Maps with Gargantua Fixes Only +- `ze_avalanche_reboot_beta7` +- `ze_l0v0l_v1_4` +- `ze_mountain_escape_v5_zy` +- `ze_Pidaras_v1_4fix3` +- `ze_sandstorm_css_v1_5x3` +- `ze_tyranny_v5fix` + +## Features + +### Paranoid Rezurrection Fixes +- Adds fixed BSOD (Blue Screen of Death) textures +- Fixes metal vent decals +- Adds all items mode textures + +### Gargantua Model Fixes +- Applies fixed Gargantua model files +- Includes all necessary model files and textures +- Fixes model compatibility issues + +## Installation + +1. Place the compiled plugin in your server's `addons/sourcemod/plugins` directory +2. Ensure all required files are present in your server's `cstrike/*` directory +3. The plugin will automatically apply fixes when supported maps are loaded + +## Requirements + +- SourceMod 1.10 or higher +- Counter-Strike: Source diff --git a/addons/sourcemod/scripting/FixMapsFiles.sp b/addons/sourcemod/scripting/FixMapsFiles.sp new file mode 100644 index 0000000..28b8e09 --- /dev/null +++ b/addons/sourcemod/scripting/FixMapsFiles.sp @@ -0,0 +1,64 @@ +#pragma semicolon 1 +#pragma newdecls required + +#include +#include + +public Plugin myinfo = +{ + name = "Maps files fixer", + author = ".Rushaway", + description = "Downloads fixed files for multiples map", + version = "1.0.0", + url = "" +}; + +public void OnMapStart() +{ + char sCurrentMap[256]; + GetCurrentMap(sCurrentMap, sizeof(sCurrentMap)); + if (strcmp(sCurrentMap, "ze_paranoid_rezurrection_v11_9", false) == 0) + { + ApplyParanoidFix(); + ApplyGargantuaFix(); + } + else if (strcmp(sCurrentMap, "ze_avalanche_reboot_beta7", false) == 0 || strcmp(sCurrentMap, "ze_l0v0l_v1_4", false) == 0 || + strcmp(sCurrentMap, "ze_mountain_escape_v5_zy", false) == 0 || strcmp(sCurrentMap, "ze_Pidaras_v1_4fix3", false) == 0 || + strcmp(sCurrentMap, "ze_sandstorm_css_v1_5x3", false) == 0 || strcmp(sCurrentMap, "ze_tyranny_v5fix", false) == 0) + { + ApplyGargantuaFix(); + } +} + +stock void ApplyParanoidFix() +{ + AddFileToDownloadsTable("materials/rafuron/paranoid/new_bsod.vmt"); + AddFileToDownloadsTable("materials/rafuron/paranoid/new_bsod.vtf"); + + AddFileToDownloadsTable("materials/rafuron/paranoid/new_bsod2.vmt"); + AddFileToDownloadsTable("materials/rafuron/paranoid/new_bsod2.vtf"); + + AddFileToDownloadsTable("materials/models/lotr/singularity/decalmetalvent004a.vmt"); + + AddFileToDownloadsTable("materials/berke1/zombieescape1/paranoidrezurrection1/allitemsmode1.vmt"); + AddFileToDownloadsTable("materials/berke1/zombieescape1/paranoidrezurrection1/allitemsmode1.vtf"); +} + +// See: https://github.com/Moltard/CSS-ZE-Configs/commit/28793dbfa52fbdcdddf4af3f5d6bdc13c0439ace +stock void ApplyGargantuaFix() +{ + PrecacheModel("models/garg_fix_2025.mdl"); + + AddFileToDownloadsTable("materials/models/garg_fix_2025/garg_body.vmt"); + AddFileToDownloadsTable("materials/models/garg_fix_2025/garg_body.vtf"); + AddFileToDownloadsTable("materials/models/garg_fix_2025/garg_body_normal.vtf"); + AddFileToDownloadsTable("materials/models/garg_fix_2025/garg_eye_Chrome.vmt"); + AddFileToDownloadsTable("materials/models/garg_fix_2025/garg_eye_Chrome.vtf"); + + AddFileToDownloadsTable("models/garg_fix_2025.dx80.vtx"); + AddFileToDownloadsTable("models/garg_fix_2025.dx90.vtx"); + AddFileToDownloadsTable("models/garg_fix_2025.mdl"); + AddFileToDownloadsTable("models/garg_fix_2025.phy"); + AddFileToDownloadsTable("models/garg_fix_2025.sw.vtx"); + AddFileToDownloadsTable("models/garg_fix_2025.vvd"); +} \ No newline at end of file diff --git a/materials/berke1/zombieescape1/paranoidrezurrection1/allitemsmode1.vmt b/materials/berke1/zombieescape1/paranoidrezurrection1/allitemsmode1.vmt new file mode 100644 index 0000000..35ceeeb --- /dev/null +++ b/materials/berke1/zombieescape1/paranoidrezurrection1/allitemsmode1.vmt @@ -0,0 +1,4 @@ +UnlitGeneric +{ + $basetexture "berke1/zombieescape1/paranoidrezurrection1/allitemsmode1" +} \ No newline at end of file diff --git a/materials/berke1/zombieescape1/paranoidrezurrection1/allitemsmode1.vtf b/materials/berke1/zombieescape1/paranoidrezurrection1/allitemsmode1.vtf new file mode 100644 index 0000000..851c828 Binary files /dev/null and b/materials/berke1/zombieescape1/paranoidrezurrection1/allitemsmode1.vtf differ diff --git a/materials/models/garg_fix_2025/garg_body.vmt b/materials/models/garg_fix_2025/garg_body.vmt new file mode 100644 index 0000000..f391909 --- /dev/null +++ b/materials/models/garg_fix_2025/garg_body.vmt @@ -0,0 +1,24 @@ +"VertexLitGeneric" +{ + "$baseTexture" "models/garg_fix_2025/garg_body" + "$bumpmap" "models/garg_fix_2025/garg_body_normal" +// "$detail" "detail/detail_noise1" + "$detailscale" 2.5 + "$surfaceprop" "alienflesh" + "$model" 1 + +// "$evnmapcontrast" "0.5" + "$envmap" "env_cubemap" + "$envmapcontrast" 1 + "$envmapsaturation" 1 +// "$envmaptint" "[.56 .67 .75]" + "$normalmapalphaenvmapmask" "1" + + "VertexLitGeneric_DX9_hdr" + { + // put HDR override stuff here + "$envmaptint" "[ .39 .39 .62]" + } + + +} diff --git a/materials/models/garg_fix_2025/garg_body.vtf b/materials/models/garg_fix_2025/garg_body.vtf new file mode 100644 index 0000000..0147413 Binary files /dev/null and b/materials/models/garg_fix_2025/garg_body.vtf differ diff --git a/materials/models/garg_fix_2025/garg_body_normal.vtf b/materials/models/garg_fix_2025/garg_body_normal.vtf new file mode 100644 index 0000000..81f3a34 Binary files /dev/null and b/materials/models/garg_fix_2025/garg_body_normal.vtf differ diff --git a/materials/models/garg_fix_2025/garg_eye_Chrome.vmt b/materials/models/garg_fix_2025/garg_eye_Chrome.vmt new file mode 100644 index 0000000..b40bf18 --- /dev/null +++ b/materials/models/garg_fix_2025/garg_eye_Chrome.vmt @@ -0,0 +1,19 @@ +"VertexLitGeneric" +{ + + "$envmap" "models/garg_fix_2025/garg_eye_Chrome" + + "$envmapsphere" "1" + + "$envmapmode" "1" + + "$multipass" "1" + + "$envmapsaturation" "0" + + "$envmapcontrast" 1.1 + + "$surfaceprop" "alienflesh" + + "$model" 1 +} diff --git a/materials/models/garg_fix_2025/garg_eye_Chrome.vtf b/materials/models/garg_fix_2025/garg_eye_Chrome.vtf new file mode 100644 index 0000000..70a4179 Binary files /dev/null and b/materials/models/garg_fix_2025/garg_eye_Chrome.vtf differ diff --git a/materials/models/lotr/singularity/decalmetalvent004a.vmt b/materials/models/lotr/singularity/decalmetalvent004a.vmt new file mode 100644 index 0000000..ef93f7b --- /dev/null +++ b/materials/models/lotr/singularity/decalmetalvent004a.vmt @@ -0,0 +1,5 @@ +"VertexLitGeneric" +{ + "$basetexture" "Decals/decalmetalvent004a" + "$selfillumtexture" "decals/decalmetalventmask004a" +} diff --git a/materials/rafuron/paranoid/new_bsod.vmt b/materials/rafuron/paranoid/new_bsod.vmt new file mode 100644 index 0000000..4bcb7fb --- /dev/null +++ b/materials/rafuron/paranoid/new_bsod.vmt @@ -0,0 +1,6 @@ +"UnlitGeneric" +{ + "$model" 1 + "$basetexture" "Rafuron/Paranoid/new_bsod" + "$scale" "[1 1]" +} \ No newline at end of file diff --git a/materials/rafuron/paranoid/new_bsod.vtf b/materials/rafuron/paranoid/new_bsod.vtf new file mode 100644 index 0000000..5e284ca Binary files /dev/null and b/materials/rafuron/paranoid/new_bsod.vtf differ diff --git a/materials/rafuron/paranoid/new_bsod2.vmt b/materials/rafuron/paranoid/new_bsod2.vmt new file mode 100644 index 0000000..f77b20c --- /dev/null +++ b/materials/rafuron/paranoid/new_bsod2.vmt @@ -0,0 +1,6 @@ +"UnlitGeneric" +{ + "$model" 1 + "$basetexture" "Rafuron/Paranoid/new_bsod2" + "$scale" "[1 1]" +} \ No newline at end of file diff --git a/materials/rafuron/paranoid/new_bsod2.vtf b/materials/rafuron/paranoid/new_bsod2.vtf new file mode 100644 index 0000000..ab52b73 Binary files /dev/null and b/materials/rafuron/paranoid/new_bsod2.vtf differ diff --git a/models/garg_fix_2025.dx80.vtx b/models/garg_fix_2025.dx80.vtx new file mode 100644 index 0000000..5c4073e Binary files /dev/null and b/models/garg_fix_2025.dx80.vtx differ diff --git a/models/garg_fix_2025.dx90.vtx b/models/garg_fix_2025.dx90.vtx new file mode 100644 index 0000000..2ff294c Binary files /dev/null and b/models/garg_fix_2025.dx90.vtx differ diff --git a/models/garg_fix_2025.mdl b/models/garg_fix_2025.mdl new file mode 100644 index 0000000..e073a71 Binary files /dev/null and b/models/garg_fix_2025.mdl differ diff --git a/models/garg_fix_2025.phy b/models/garg_fix_2025.phy new file mode 100644 index 0000000..7726443 Binary files /dev/null and b/models/garg_fix_2025.phy differ diff --git a/models/garg_fix_2025.sw.vtx b/models/garg_fix_2025.sw.vtx new file mode 100644 index 0000000..fc4d5b1 Binary files /dev/null and b/models/garg_fix_2025.sw.vtx differ diff --git a/models/garg_fix_2025.vvd b/models/garg_fix_2025.vvd new file mode 100644 index 0000000..d894db4 Binary files /dev/null and b/models/garg_fix_2025.vvd differ diff --git a/sourceknight.yaml b/sourceknight.yaml new file mode 100644 index 0000000..d272212 --- /dev/null +++ b/sourceknight.yaml @@ -0,0 +1,16 @@ +project: + sourceknight: 0.2 + name: FixMapsFiles + dependencies: + - name: sourcemod + type: tar + version: 1.11.0-git6934 + location: https://sm.alliedmods.net/smdrop/1.11/sourcemod-1.11.0-git6934-linux.tar.gz + unpack: + - source: /addons + dest: /addons + + root: / + output: /addons/sourcemod/plugins + targets: + - FixMapsFiles