Skip to content

Commit

Permalink
feat: Add templategame example
Browse files Browse the repository at this point in the history
  • Loading branch information
ozxybox committed Nov 13, 2024
1 parent 952e12b commit cd4c4e0
Show file tree
Hide file tree
Showing 6 changed files with 237 additions and 2 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ jobs:
directory: ./${{ env.FGD_BUILD_DIR }}/p2ce/
filename: 'fgd-p2ce.zip'

- name: Zip templategame FGD
uses: thedoctor0/zip-release@master
with:
type: 'zip'
directory: ./${{ env.FGD_BUILD_DIR }}/templategame/
filename: 'fgd-templategame.zip'

- name: MD build
run: .\build.bat md all

Expand All @@ -67,6 +74,13 @@ jobs:
type: 'zip'
directory: ./${{ env.MD_BUILD_DIR }}/p2ce/
filename: 'md-p2ce.zip'

- name: Zip templategame MD
uses: thedoctor0/zip-release@master
with:
type: 'zip'
directory: ./${{ env.MD_BUILD_DIR }}/templategame/
filename: 'md-templategame.zip'

- name: Artifact Upload
uses: actions/upload-artifact@v3
Expand All @@ -75,8 +89,10 @@ jobs:
path: |
./${{ env.FGD_BUILD_DIR }}/momentum/fgd-momentum.zip
./${{ env.FGD_BUILD_DIR }}/p2ce/fgd-p2ce.zip
./${{ env.FGD_BUILD_DIR }}/templategame/fgd-templategame.zip
./${{ env.MD_BUILD_DIR }}/momentum/md-momentum.zip
./${{ env.MD_BUILD_DIR }}/p2ce/md-p2ce.zip
./${{ env.MD_BUILD_DIR }}/templategame/md-templategame.zip
if-no-files-found: error

- name: Get previous tag
Expand All @@ -99,8 +115,10 @@ jobs:
files: |
${{ env.FGD_BUILD_DIR }}/momentum/fgd-momentum.zip
${{ env.FGD_BUILD_DIR }}/p2ce/fgd-p2ce.zip
${{ env.FGD_BUILD_DIR }}/templategame/fgd-templategame.zip
${{ env.MD_BUILD_DIR }}/momentum/md-momentum.zip
${{ env.MD_BUILD_DIR }}/p2ce/md-p2ce.zip
${{ env.MD_BUILD_DIR }}/templategame/md-templategame.zip
fail_on_unmatched_files: true

- name: Create Manual Release
Expand All @@ -111,6 +129,8 @@ jobs:
files: |
${{ env.FGD_BUILD_DIR }}/momentum/fgd-momentum.zip
${{ env.FGD_BUILD_DIR }}/p2ce/fgd-p2ce.zip
${{ env.FGD_BUILD_DIR }}/templategame/fgd-templategame.zip
${{ env.MD_BUILD_DIR }}/momentum/md-momentum.zip
${{ env.MD_BUILD_DIR }}/p2ce/md-p2ce.zip
${{ env.MD_BUILD_DIR }}/templategame/md-templategame.zip
fail_on_unmatched_files: true
7 changes: 6 additions & 1 deletion build.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@echo off
SETLOCAL enabledelayedexpansion

SET games=momentum p2ce
SET games=momentum p2ce templategame
SET modes=fgd md

SET "build_dir=build"
Expand Down Expand Up @@ -94,6 +94,11 @@ IF /I %game%==ALL (
CALL :build_game_fgd momentum
EXIT /B

:build_fgd_templategame
CALL :copy_hammer_files templategame
CALL :build_game_fgd templategame
EXIT /B

:build_game_fgd
echo Building FGD for %1...
mkdir "%build_dir%/%1"
Expand Down
7 changes: 6 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

modes="fgd md"
games="momentum p2ce"
games="momentum p2ce templategame"

build_dir="build"
build_md_dir="build_md"
Expand Down Expand Up @@ -55,6 +55,11 @@ build_fgd_momentum() {
build_game_fgd momentum
}

build_fgd_templategame() {
copy_hammer_files templategame
build_game_fgd templategame
}

build_game_markdown() {
echo "Generating markdown from FGD for $1..."
mkdir -p "$build_md_dir/$1"
Expand Down
177 changes: 177 additions & 0 deletions hammer/cfg_templategame/CmdSeqDefault.wc
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
"Command Sequences"
{
"Fast"
{
"1"
{
"enabled" "1"
"special_cmd" "none"
"run" "$bsp_exe"
"params" "-game $gamedir $path\\$file"
"ensure_check" "0"
"ensure_fn" ""
"use_process_wnd" "1"
"no_wait" "0"
}
"2"
{
"enabled" "1"
"special_cmd" "none"
"run" "$vis_exe"
"params" "-fast -game $gamedir $path\\$file"
"ensure_check" "0"
"ensure_fn" ""
"use_process_wnd" "1"
"no_wait" "0"
}
"3"
{
"enabled" "1"
"special_cmd" "none"
"run" "$light_exe"
"params" "-fast -StaticPropLighting -StaticPropPolys -game $gamedir $path\\$file"
"ensure_check" "0"
"ensure_fn" ""
"use_process_wnd" "1"
"no_wait" "0"
}
"4"
{
"enabled" "1"
"special_cmd" "copy_file"
"run" ""
"params" "$path\\$file.bsp $bspdir\\$file.bsp"
"ensure_check" "0"
"ensure_fn" ""
"use_process_wnd" "1"
"no_wait" "0"
}
"5"
{
"enabled" "1"
"special_cmd" "none"
"run" "$game_exe"
"params" "-dev -console -allowdebug -hijack -game $gamedir +map $file"
"ensure_check" "0"
"ensure_fn" ""
"use_process_wnd" "1"
"no_wait" "1" // All game_exe things apparently have no wait, but it isn't used so whatever
}
}
"Full Compile"
{
"1"
{
"enabled" "1"
"special_cmd" "none"
"run" "$bsp_exe"
"params" "-game $gamedir $path\\$file"
"ensure_check" "0"
"ensure_fn" ""
"use_process_wnd" "1"
"no_wait" "0"
}
"2"
{
"enabled" "1"
"special_cmd" "none"
"run" "$vis_exe"
"params" "-game $gamedir $path\\$file"
"ensure_check" "0"
"ensure_fn" ""
"use_process_wnd" "1"
"no_wait" "0"
}
"3"
{
"enabled" "1"
"special_cmd" "none"
"run" "$light_exe"
"params" "-StaticPropLighting -StaticPropPolys -game $gamedir $path\\$file"
"ensure_check" "0"
"ensure_fn" ""
"use_process_wnd" "1"
"no_wait" "0"
}
"4"
{
"enabled" "1"
"special_cmd" "copy_file"
"run" ""
"params" "$path\\$file.bsp $bspdir\\$file.bsp"
"ensure_check" "0"
"ensure_fn" ""
"use_process_wnd" "1"
"no_wait" "0"
}
"5"
{
"enabled" "0"
"special_cmd" "none"
"run" "$game_exe"
"params" "-dev -console -allowdebug -hijack -game $gamedir +map $file"
"ensure_check" "0"
"ensure_fn" ""
"use_process_wnd" "1"
"no_wait" "1" // All game_exe things apparently have no wait, but it isn't used so whatever
}
}
"AO Full Compile"
{
"1"
{
"enabled" "1"
"special_cmd" "none"
"run" "$bsp_exe"
"params" "-game $gamedir $path\\$file"
"ensure_check" "0"
"ensure_fn" ""
"use_process_wnd" "1"
"no_wait" "0"
}
"2"
{
"enabled" "1"
"special_cmd" "none"
"run" "$vis_exe"
"params" "-game $gamedir $path\\$file"
"ensure_check" "0"
"ensure_fn" ""
"use_process_wnd" "1"
"no_wait" "0"
}
"3"
{
"enabled" "1"
"special_cmd" "none"
"run" "$light_exe"
"params" "-StaticPropLighting -StaticPropPolys -game $gamedir $path\\$file"
"ensure_check" "0"
"ensure_fn" ""
"use_process_wnd" "1"
"no_wait" "0"
}
"4"
{
"enabled" "1"
"special_cmd" "copy_file"
"run" ""
"params" "$path\\$file.bsp $bspdir\\$file.bsp"
"ensure_check" "0"
"ensure_fn" ""
"use_process_wnd" "1"
"no_wait" "0"
}
"5"
{
"enabled" "0"
"special_cmd" "none"
"run" "$game_exe"
"params" "-dev -console -allowdebug -hijack -game $gamedir +map $file"
"ensure_check" "0"
"ensure_fn" ""
"use_process_wnd" "1"
"no_wait" "1" // All game_exe things apparently have no wait, but it isn't used so whatever
}
}
}
26 changes: 26 additions & 0 deletions hammer/cfg_templategame/GameConfig_default.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"Games"
{
"Template Game"
{
// NOTE: All of these paths are in relation to where hammer.exe is!!!
"GameDir" "..\..\templategame"
"Hammer"
{
"GameData0" "..\..\templategame\templategame.fgd"
"DefaultTextureScale" "0.250000"
"DefaultLightmapScale" "16"
"GameExe" "chaos.exe"
"DefaultSolidEntity" "func_detail"
"DefaultPointEntity" "info_player_start"
"BSP" "vbsp.exe"
"Vis" "vvis.exe"
"Light" "vrad.exe"
"PostCompiler" ""
"GameExeDir" ""
"MapDir" "..\..\sdk_content\maps"
"BSPDir" "..\..\templategame\maps"
"CordonTexture" "tools/toolsskybox"
"MaterialExcludeCount" "0"
}
}
}
2 changes: 2 additions & 0 deletions unify_fgd.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
GAMES = [
('P2CE', 'Portal 2: Community Edition'),
('MOMENTUM', 'Momentum Mod'),
('TEMPLATEGAME', 'Template Game'),
] # type: List[Tuple[str, str]]

GAME_ORDER = [game for game, desc in GAMES]
Expand All @@ -49,6 +50,7 @@
'P2CE': {'HL2_ENTITIES', 'USE_VEHICLES', 'USE_PORTALS', 'USE_PAUSE', 'USE_NAV_MESH', 'USE_AI', 'USE_NEXTBOT', 'USE_SAVE_RESTORE',
'USE_SLOWTIME', 'INST_IO', 'VSCRIPT', 'PROPCOMBINE', 'USE_TEAM', 'USE_MULTIPLAYER'},
'MOMENTUM': {'USE_PORTALS', 'INST_IO', 'PROPCOMBINE'},
'TEMPLATEGAME': {'USE_PAUSE', 'USE_NAV_MESH', 'USE_AI', 'USE_NEXTBOT', 'USE_SAVE_RESTORE', 'INST_IO', 'VSCRIPT', 'PROPCOMBINE', 'USE_TEAM', 'USE_MULTIPLAYER'},
}

ALL_FEATURES = {
Expand Down

0 comments on commit cd4c4e0

Please sign in to comment.