Skip to content

Commit 0b7fc61

Browse files
committed
feat: Add templategame example
1 parent 60e898a commit 0b7fc61

File tree

6 files changed

+237
-2
lines changed

6 files changed

+237
-2
lines changed

.github/workflows/release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ jobs:
5151
directory: ./${{ env.FGD_BUILD_DIR }}/p2ce/
5252
filename: 'fgd-p2ce.zip'
5353

54+
- name: Zip templategame FGD
55+
uses: thedoctor0/zip-release@master
56+
with:
57+
type: 'zip'
58+
directory: ./${{ env.FGD_BUILD_DIR }}/templategame/
59+
filename: 'fgd-templategame.zip'
60+
5461
- name: MD build
5562
run: .\build.bat md all
5663

@@ -67,6 +74,13 @@ jobs:
6774
type: 'zip'
6875
directory: ./${{ env.MD_BUILD_DIR }}/p2ce/
6976
filename: 'md-p2ce.zip'
77+
78+
- name: Zip templategame MD
79+
uses: thedoctor0/zip-release@master
80+
with:
81+
type: 'zip'
82+
directory: ./${{ env.MD_BUILD_DIR }}/templategame/
83+
filename: 'md-templategame.zip'
7084

7185
- name: Artifact Upload
7286
uses: actions/upload-artifact@v3
@@ -75,8 +89,10 @@ jobs:
7589
path: |
7690
./${{ env.FGD_BUILD_DIR }}/momentum/fgd-momentum.zip
7791
./${{ env.FGD_BUILD_DIR }}/p2ce/fgd-p2ce.zip
92+
./${{ env.FGD_BUILD_DIR }}/templategame/fgd-templategame.zip
7893
./${{ env.MD_BUILD_DIR }}/momentum/md-momentum.zip
7994
./${{ env.MD_BUILD_DIR }}/p2ce/md-p2ce.zip
95+
./${{ env.MD_BUILD_DIR }}/templategame/md-templategame.zip
8096
if-no-files-found: error
8197

8298
- name: Get previous tag
@@ -99,8 +115,10 @@ jobs:
99115
files: |
100116
${{ env.FGD_BUILD_DIR }}/momentum/fgd-momentum.zip
101117
${{ env.FGD_BUILD_DIR }}/p2ce/fgd-p2ce.zip
118+
${{ env.FGD_BUILD_DIR }}/templategame/fgd-templategame.zip
102119
${{ env.MD_BUILD_DIR }}/momentum/md-momentum.zip
103120
${{ env.MD_BUILD_DIR }}/p2ce/md-p2ce.zip
121+
${{ env.MD_BUILD_DIR }}/templategame/md-templategame.zip
104122
fail_on_unmatched_files: true
105123

106124
- name: Create Manual Release
@@ -111,6 +129,8 @@ jobs:
111129
files: |
112130
${{ env.FGD_BUILD_DIR }}/momentum/fgd-momentum.zip
113131
${{ env.FGD_BUILD_DIR }}/p2ce/fgd-p2ce.zip
132+
${{ env.FGD_BUILD_DIR }}/templategame/fgd-templategame.zip
114133
${{ env.MD_BUILD_DIR }}/momentum/md-momentum.zip
115134
${{ env.MD_BUILD_DIR }}/p2ce/md-p2ce.zip
135+
${{ env.MD_BUILD_DIR }}/templategame/md-templategame.zip
116136
fail_on_unmatched_files: true

build.bat

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@echo off
22
SETLOCAL enabledelayedexpansion
33

4-
SET games=momentum p2ce
4+
SET games=momentum p2ce templategame
55
SET modes=fgd md
66

77
SET "build_dir=build"
@@ -94,6 +94,11 @@ IF /I %game%==ALL (
9494
CALL :build_game_fgd momentum
9595
EXIT /B
9696

97+
:build_fgd_templategame
98+
CALL :copy_hammer_files templategame
99+
CALL :build_game_fgd templategame
100+
EXIT /B
101+
97102
:build_game_fgd
98103
echo Building FGD for %1...
99104
mkdir "%build_dir%/%1"

build.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
modes="fgd md"
4-
games="momentum p2ce"
4+
games="momentum p2ce templategame"
55

66
build_dir="build"
77
build_md_dir="build_md"
@@ -55,6 +55,11 @@ build_fgd_momentum() {
5555
build_game_fgd momentum
5656
}
5757

58+
build_fgd_templategame() {
59+
copy_hammer_files templategame
60+
build_game_fgd templategame
61+
}
62+
5863
build_game_markdown() {
5964
echo "Generating markdown from FGD for $1..."
6065
mkdir -p "$build_md_dir/$1"
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
"Command Sequences"
2+
{
3+
"Fast"
4+
{
5+
"1"
6+
{
7+
"enabled" "1"
8+
"special_cmd" "none"
9+
"run" "$bsp_exe"
10+
"params" "-game $gamedir $path\\$file"
11+
"ensure_check" "0"
12+
"ensure_fn" ""
13+
"use_process_wnd" "1"
14+
"no_wait" "0"
15+
}
16+
"2"
17+
{
18+
"enabled" "1"
19+
"special_cmd" "none"
20+
"run" "$vis_exe"
21+
"params" "-fast -game $gamedir $path\\$file"
22+
"ensure_check" "0"
23+
"ensure_fn" ""
24+
"use_process_wnd" "1"
25+
"no_wait" "0"
26+
}
27+
"3"
28+
{
29+
"enabled" "1"
30+
"special_cmd" "none"
31+
"run" "$light_exe"
32+
"params" "-fast -StaticPropLighting -StaticPropPolys -game $gamedir $path\\$file"
33+
"ensure_check" "0"
34+
"ensure_fn" ""
35+
"use_process_wnd" "1"
36+
"no_wait" "0"
37+
}
38+
"4"
39+
{
40+
"enabled" "1"
41+
"special_cmd" "copy_file"
42+
"run" ""
43+
"params" "$path\\$file.bsp $bspdir\\$file.bsp"
44+
"ensure_check" "0"
45+
"ensure_fn" ""
46+
"use_process_wnd" "1"
47+
"no_wait" "0"
48+
}
49+
"5"
50+
{
51+
"enabled" "1"
52+
"special_cmd" "none"
53+
"run" "$game_exe"
54+
"params" "-dev -console -allowdebug -hijack -game $gamedir +map $file"
55+
"ensure_check" "0"
56+
"ensure_fn" ""
57+
"use_process_wnd" "1"
58+
"no_wait" "1" // All game_exe things apparently have no wait, but it isn't used so whatever
59+
}
60+
}
61+
"Full Compile"
62+
{
63+
"1"
64+
{
65+
"enabled" "1"
66+
"special_cmd" "none"
67+
"run" "$bsp_exe"
68+
"params" "-game $gamedir $path\\$file"
69+
"ensure_check" "0"
70+
"ensure_fn" ""
71+
"use_process_wnd" "1"
72+
"no_wait" "0"
73+
}
74+
"2"
75+
{
76+
"enabled" "1"
77+
"special_cmd" "none"
78+
"run" "$vis_exe"
79+
"params" "-game $gamedir $path\\$file"
80+
"ensure_check" "0"
81+
"ensure_fn" ""
82+
"use_process_wnd" "1"
83+
"no_wait" "0"
84+
}
85+
"3"
86+
{
87+
"enabled" "1"
88+
"special_cmd" "none"
89+
"run" "$light_exe"
90+
"params" "-StaticPropLighting -StaticPropPolys -game $gamedir $path\\$file"
91+
"ensure_check" "0"
92+
"ensure_fn" ""
93+
"use_process_wnd" "1"
94+
"no_wait" "0"
95+
}
96+
"4"
97+
{
98+
"enabled" "1"
99+
"special_cmd" "copy_file"
100+
"run" ""
101+
"params" "$path\\$file.bsp $bspdir\\$file.bsp"
102+
"ensure_check" "0"
103+
"ensure_fn" ""
104+
"use_process_wnd" "1"
105+
"no_wait" "0"
106+
}
107+
"5"
108+
{
109+
"enabled" "0"
110+
"special_cmd" "none"
111+
"run" "$game_exe"
112+
"params" "-dev -console -allowdebug -hijack -game $gamedir +map $file"
113+
"ensure_check" "0"
114+
"ensure_fn" ""
115+
"use_process_wnd" "1"
116+
"no_wait" "1" // All game_exe things apparently have no wait, but it isn't used so whatever
117+
}
118+
}
119+
"AO Full Compile"
120+
{
121+
"1"
122+
{
123+
"enabled" "1"
124+
"special_cmd" "none"
125+
"run" "$bsp_exe"
126+
"params" "-game $gamedir $path\\$file"
127+
"ensure_check" "0"
128+
"ensure_fn" ""
129+
"use_process_wnd" "1"
130+
"no_wait" "0"
131+
}
132+
"2"
133+
{
134+
"enabled" "1"
135+
"special_cmd" "none"
136+
"run" "$vis_exe"
137+
"params" "-game $gamedir $path\\$file"
138+
"ensure_check" "0"
139+
"ensure_fn" ""
140+
"use_process_wnd" "1"
141+
"no_wait" "0"
142+
}
143+
"3"
144+
{
145+
"enabled" "1"
146+
"special_cmd" "none"
147+
"run" "$light_exe"
148+
"params" "-StaticPropLighting -StaticPropPolys -game $gamedir $path\\$file"
149+
"ensure_check" "0"
150+
"ensure_fn" ""
151+
"use_process_wnd" "1"
152+
"no_wait" "0"
153+
}
154+
"4"
155+
{
156+
"enabled" "1"
157+
"special_cmd" "copy_file"
158+
"run" ""
159+
"params" "$path\\$file.bsp $bspdir\\$file.bsp"
160+
"ensure_check" "0"
161+
"ensure_fn" ""
162+
"use_process_wnd" "1"
163+
"no_wait" "0"
164+
}
165+
"5"
166+
{
167+
"enabled" "0"
168+
"special_cmd" "none"
169+
"run" "$game_exe"
170+
"params" "-dev -console -allowdebug -hijack -game $gamedir +map $file"
171+
"ensure_check" "0"
172+
"ensure_fn" ""
173+
"use_process_wnd" "1"
174+
"no_wait" "1" // All game_exe things apparently have no wait, but it isn't used so whatever
175+
}
176+
}
177+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
"Games"
2+
{
3+
"Template Game"
4+
{
5+
// NOTE: All of these paths are in relation to where hammer.exe is!!!
6+
"GameDir" "..\..\templategame"
7+
"Hammer"
8+
{
9+
"GameData0" "..\..\templategame\templategame.fgd"
10+
"DefaultTextureScale" "0.250000"
11+
"DefaultLightmapScale" "16"
12+
"GameExe" "chaos.exe"
13+
"DefaultSolidEntity" "func_detail"
14+
"DefaultPointEntity" "info_player_start"
15+
"BSP" "vbsp.exe"
16+
"Vis" "vvis.exe"
17+
"Light" "vrad.exe"
18+
"PostCompiler" ""
19+
"GameExeDir" ""
20+
"MapDir" "..\..\sdk_content\maps"
21+
"BSPDir" "..\..\templategame\maps"
22+
"CordonTexture" "tools/toolsskybox"
23+
"MaterialExcludeCount" "0"
24+
}
25+
}
26+
}

unify_fgd.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
GAMES = [
3737
('P2CE', 'Portal 2: Community Edition'),
3838
('MOMENTUM', 'Momentum Mod'),
39+
('TEMPLATEGAME', 'Template Game'),
3940
] # type: List[Tuple[str, str]]
4041

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

5456
ALL_FEATURES = {

0 commit comments

Comments
 (0)