Skip to content

Commit a13d129

Browse files
committed
Version 2.4.0
2 parents 72770ef + f5727d1 commit a13d129

164 files changed

Lines changed: 5739 additions & 843 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: FGD Build and Folder Copy
2+
on:
3+
push:
4+
branches: [ master, dev ]
5+
pull_request:
6+
branches: [ master, dev ]
7+
jobs:
8+
build-windows:
9+
runs-on: windows-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
- name: Setup Python
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: '3.9'
17+
- name: Install srctools
18+
run: .\install_srctools.bat
19+
- name: FGD build and folder copy
20+
run: .\build.bat all
21+
- name: Artifact upload
22+
uses: actions/upload-artifact@v2
23+
with:
24+
name: build_${{ runner.os }}-${{ github.sha }}
25+
path: ./build/*.fgd
26+
if-no-files-found: error
27+
build-linux:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v2
32+
- name: Setup Python
33+
uses: actions/setup-python@v2
34+
with:
35+
python-version: '3.9'
36+
- name: Install srctools
37+
run: bash ./install_srctools.sh
38+
- name: FGD build and folder copy
39+
run: bash ./build.sh all
40+
- name: Artifact upload
41+
uses: actions/upload-artifact@v2
42+
with:
43+
name: build_${{ runner.os }}-${{ github.sha }}
44+
path: ./build/*.fgd
45+
if-no-files-found: error

README.md

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,6 @@
77

88
<hr>
99

10-
[releases]: https://github.com/TeamSpen210/HammerAddons/releases
11-
[installationwiki]: https://github.com/TeamSpen210/HammerAddons/wiki/Installation
12-
[unifiedfgd]: https://github.com/TeamSpen210/HammerAddons/wiki/Unified-FGD
13-
[skotty]: http://forums.thinking.withportals.com/downloads.php?view=detail&df_id=507
14-
[tf2]: http://forums.tf2maps.net/showthread.php?t=4674
15-
[ts2do]: http://halflife2.filefront.com/file/HalfLife_2_Upgraded_Base_FGDs;48139
16-
[zps]: http://www.necrotalesgames.com/tools/index.php
17-
18-
1910
## Features
2011

2112
* Auto-packing - Automatically packs non-stock game files into the bsp. Filtered based on search paths in the included custom gameinfo and FGD database. Assets can also be packed manually with `comp_pack` entities.
@@ -29,26 +20,28 @@
2920
* In addition to the normal `Entity Scripts` section, a new `Init Code` field can be used to write code that's packed and added to those scripts. Useful for setting configuration options etc. Backticks can be used here too.
3021
* New `comp_` entities. These are mainly intended for use in instances, allowing modifying entities outside of the instance to conform or doing normally impossible things like positioning things in the void:
3122

32-
| Entity | Description |
33-
|------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
34-
| `comp_choreo_sceneset` | Chains a set of choreographed scenes together. |
35-
| `comp_entity_finder` | Finds the closest entity of a given type, then applies various transformations. Outputs from this entity will be moved to the found entity. Further keyvalues can be set manually with SmartEdit off. |
36-
| `comp_entity_mover` | Shift an entity by a given amount. This is useful to place entities into the void, for example. |
37-
| `comp_kv_setter` | Sets a keyvalue on an entity to a new value. This is useful to compute spawnflags, or to adjust keyvalues when the target entity's options can't be set to a fixup variable. |
38-
| `comp_numeric_transtition` | When triggered, animates a keyvalue/input over time with various options. |
39-
| `comp_pack` | Explicitly identify resources to pack into the map. If more are needed, add additional keyvalues with SmartEdit off. |
40-
| `comp_pack_rename` | Pack a file into the BSP, under a different name than it starts with. |
41-
| `comp_pack_replace_soundscript` | Replace a soundscript with a different one. |
42-
| `comp_precache_model` | Force a specific model to load, for runtime switching. Duplicates will be removed. |
43-
| `comp_precache_sound` | Force a specific sound to load, for runtime switching. Duplicates will be removed. More keyvalues can be added. |
44-
| `comp_prop_cable`/`comp_prop_rope` | Generates cables using a static prop. |
45-
| `comp_propcombine_set` | Specifies a group of props that will be combined together. |
46-
| `comp_relay` | Simplified version of `logic_relay` which is able to be optimised away by the compiler. The various inputs and outputs are useful for bundling commands together, or using more appopriate verbs. Inputs only work if given directly from entities (or via instance redirection), not in-game or dynamically. All inputs/outputs may pass through any parameter, if no override is specified. |
47-
| `comp_scriptvar_setter` | Assigns data or a group of data to a variable in an entity's VScript scope on spawn. To set an array, provide an index in the variable name in the form 'varname[4]'. All the comp_scriptvars pointing to that variable will be collected into a single array literal, with holes filled by *null*. If the brackets are empty, these values will fill those holes and then append to the end in an arbitrary order. |
48-
| `comp_vactube_end` | Marks the end point of a vactube. Objects reaching here will be cleaned up. |
49-
| `comp_vactube_juntion` | Marks a junction in a vactube, where they're forced to change direction. Scanner models near straight nodes will be detected automatically. |
50-
| `comp_vactube_object` | Registers objects that can appear in the tubing. |
51-
| `comp_vactube_start` | Marks the start point of a vactube. This is where they spawn. |
23+
| Entity | Description |
24+
|----------------------------------------------------|-------------|
25+
| `comp_choreo_sceneset` | Chains a set of choreographed scenes together. |
26+
| `comp_entity_finder` | Finds the closest entity of a given type, then applies various transformations. Outputs from this entity will be moved to the found entity. Further keyvalues can be set manually with SmartEdit off. |
27+
| `comp_entity_mover` | Shift an entity by a given amount. This is useful to place entities into the void, for example. |
28+
| `comp_kv_setter` | Sets a keyvalue on an entity to a new value. This is useful to compute spawnflags, or to adjust keyvalues when the target entity's options can't be set to a fixup variable. |
29+
| `comp_numeric_transtition` | When triggered, animates a keyvalue/input over time with various options. |
30+
| `comp_pack` | Explicitly identify resources to pack into the map. If more are needed, add additional keyvalues with SmartEdit off. |
31+
| `comp_pack_rename` | Pack a file into the BSP, under a different name than it starts with. |
32+
| `comp_pack_replace_soundscript` | Replace a soundscript with a different one. |
33+
| `comp_precache_model` | Force a specific model to load, for runtime switching. Duplicates will be removed. |
34+
| `comp_precache_sound` | Force a specific sound to load, for runtime switching. Duplicates will be removed. More keyvalues can be added. |
35+
| `comp_prop_cable`/`comp_prop_rope` | Generates 3D cables using a static prop. |
36+
| `comp_prop_cable_dynamic`/`comp_prop_rope_dynamic` | Modifies the above to generate a dynamic prop, instead. |
37+
| `comp_propcombine_set`/`comp_propcombine_volume` | Specifies a group of props that will be combined together, so they more efficiently render. |
38+
| `comp_relay` | Simplified version of `logic_relay` which is able to be optimised away by the compiler. The various inputs and outputs are useful for bundling commands together, or using more appopriate verbs. Inputs only work if given directly from entities (or via instance redirection), not in-game or dynamically. All inputs/outputs may pass through any parameter, if no override is specified. |
39+
| `comp_scriptvar_setter` | Assigns data or a group of data to a variable in an entity's VScript scope on spawn. To set an array, provide an index in the variable name in the form `varname[4]`. All the comp_scriptvars pointing to that variable will be collected into a single array literal, with holes filled by *null*. If the brackets are empty, these values will fill those holes and then append to the end in an arbitrary order. |
40+
| `comp_vactube_end` | Marks the end point of a vactube. Objects reaching here will be cleaned up. |
41+
| `comp_vactube_junction` | Marks a junction in a vactube, where they're forced to change direction. Scanner models near straight nodes will be detected automatically. |
42+
| `comp_vactube_spline` | Generates a dynamic vactube model following a set of points. |
43+
| `comp_vactube_object` | Registers objects that can appear in the tubing. |
44+
| `comp_vactube_start` | Marks the start point of a vactube. This is where they spawn. |
5245

5346

5447
## Installation
@@ -65,3 +58,11 @@
6558
* [The TF2 Ultimate Mapping Resource Pack][tf2]
6659
* [ZPS: Supplemental Hammer Icons][zps]
6760
* [ts2do's HL FGDs][ts2do]
61+
62+
[releases]: https://github.com/TeamSpen210/HammerAddons/releases
63+
[installationwiki]: https://github.com/TeamSpen210/HammerAddons/wiki/Installation
64+
[unifiedfgd]: https://github.com/TeamSpen210/HammerAddons/wiki/Unified-FGD
65+
[skotty]: http://forums.thinking.withportals.com/downloads.php?view=detail&df_id=507
66+
[tf2]: http://forums.tf2maps.net/showthread.php?t=4674
67+
[ts2do]: http://halflife2.filefront.com/file/HalfLife_2_Upgraded_Base_FGDs;48139
68+
[zps]: http://www.necrotalesgames.com/tools/index.php

build.bat

Lines changed: 50 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,50 @@
1-
robocopy hammer build/hammer /S /PURGE
2-
robocopy instances build/instances /XF *.vmx /S /PURGE
3-
robocopy transforms build/postcompiler/transforms /PURGE
4-
python unify_fgd.py exp p2 srctools -o "build/portal2.fgd"
5-
python unify_fgd.py exp p1 srctools -o "build/portal.fgd"
6-
python unify_fgd.py exp hl2 srctools -o "build/hl2.fgd"
7-
python unify_fgd.py exp ep1 ep2 srctools -o "build/episodic.fgd"
8-
python unify_fgd.py exp gmod srctools -o "build/gmod.fgd"
9-
python unify_fgd.py exp csgo srctools -o "build/csgo.fgd"
10-
python unify_fgd.py exp tf2 srctools -o "build/tf2.fgd"
11-
python unify_fgd.py exp asw srctools -o "build/asw.fgd"
12-
python unify_fgd.py exp l4d srctools -o "build/l4d.fgd"
13-
python unify_fgd.py exp l4d2 srctools -o "build/left4dead2.fgd"
14-
python unify_fgd.py exp infra srctools -o "build/infra.fgd"
15-
python unify_fgd.py exp mesa srctools -o "build/blackmesa.fgd"
1+
@echo off
2+
setlocal EnableDelayedExpansion
3+
4+
SET games=p2 p1 hl2 ep1 ep2 gmod csgo tf2 asw l4d l4d2 infra mesa
5+
6+
:: If set, override the FGD filename generated.
7+
SET filename.p2=portal2
8+
SET filename.p1=portal
9+
SET filename.ep1=episodic
10+
SET filename.tf2=tf
11+
SET filename.l4d=left4dead
12+
SET filename.l4d2=left4dead2
13+
SET filename.mesa=blackmesa
14+
SET game=%1
15+
16+
:: Make sure game isn't empty
17+
:while
18+
IF [%game%]==[] (echo Games: %games% & echo Enter game to build. Use ALL to build every game. & SET /P game= & GOTO :while)
19+
20+
IF /I %game%==ALL (
21+
CALL :copy_hammer_files
22+
(FOR %%i in (%games%) do (
23+
CALL :build_game %%i
24+
))
25+
EXIT
26+
) ELSE (
27+
(FOR %%i in (%games%) do (
28+
IF /I %game%==%%i (
29+
CALL :copy_hammer_files
30+
CALL :build_game %game%
31+
EXIT
32+
)
33+
))
34+
echo Unknown game. Exitting. & EXIT /B 1
35+
)
36+
37+
:build_game
38+
SET tag=%1
39+
IF DEFINED filename.%tag% (SET fname=!filename.%tag%!) ELSE (SET fname=%tag%)
40+
echo Building FGD for %1 as "%fname%.fgd"...
41+
py unify_fgd.py exp "%tag%" srctools -o "build/%fname%.fgd"
42+
IF %ERRORLEVEL% NEQ 0 (echo Building FGD for %tag% has failed. Exitting. & EXIT)
43+
EXIT /B
44+
45+
:copy_hammer_files
46+
echo Copying Hammer files...
47+
IF %ERRORLEVEL% LSS 8 robocopy hammer build/hammer /S /PURGE
48+
IF %ERRORLEVEL% LSS 8 robocopy instances build/instances /XF *.vmx /S /PURGE
49+
IF %ERRORLEVEL% LSS 8 EXIT /B 0
50+
echo Failed copying Hammer files. Exitting. & EXIT

build.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/sh
2+
games="p2 p1 hl2 ep1 ep2 gmod csgo tf2 asw l4d l4d2 infra mesa"
3+
game=$1
4+
if [ $# -eq 0 ]; then
5+
echo Games: "${games[*]}" & echo Enter game to build. Use ALL to build every game. & read -p "" game
6+
fi
7+
8+
copy_hammer_files() {
9+
echo "Copying Hammer files..."
10+
mkdir -p build/postcompiler &&
11+
cp -rf hammer build/hammer &&
12+
cp -rf instances build/instances &&
13+
cp -rf transforms build/postcompiler/transforms &&
14+
find ./build/instances -iname "*.vmx" -delete # Yes, I know that we could use rsync with a ton of options to do this instead of using cp and then deleting unwanted files. This is FAR nicer imo.
15+
16+
if [ $? -ne 0 ]; then
17+
echo "Failed copying Hammer files. Exitting." & exit 1
18+
fi
19+
return 0
20+
}
21+
22+
build_game() {
23+
echo "Building FGD for $1..."
24+
python3 unify_fgd.py exp $1 srctools -o "build/$1.fgd"
25+
26+
if [ $? -ne 0 ]; then
27+
echo "Building FGD for $1 has failed. Exitting." & exit 1
28+
fi
29+
return 0
30+
}
31+
32+
if [ "${game^^}" = "ALL" ]; then
33+
copy_hammer_files
34+
for i in $games
35+
do
36+
build_game $i
37+
done
38+
else
39+
for i in $games
40+
do
41+
if [ "$i" = "$game" ]; then
42+
copy_hammer_files
43+
build_game $game
44+
exit
45+
fi
46+
echo "Unknown game. Exitting." & exit 1
47+
done
48+
fi

fgd/base_entity.fgd

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99

1010
targetname(target_source) : "Name"
1111
hammerid(integer) : "Hammer ID"
12-
target(target_destination) : "Target"
12+
// Defined here, but don't include - it's treated as
13+
// many different types.
14+
// target(target_destination) : "Target"
1315
spawnflags(flags) = []
1416

1517

0 commit comments

Comments
 (0)