Skip to content

Commit

Permalink
Version 2.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
TeamSpen210 committed Aug 6, 2021
2 parents 72770ef + f5727d1 commit a13d129
Show file tree
Hide file tree
Showing 164 changed files with 5,739 additions and 843 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: FGD Build and Folder Copy
on:
push:
branches: [ master, dev ]
pull_request:
branches: [ master, dev ]
jobs:
build-windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install srctools
run: .\install_srctools.bat
- name: FGD build and folder copy
run: .\build.bat all
- name: Artifact upload
uses: actions/upload-artifact@v2
with:
name: build_${{ runner.os }}-${{ github.sha }}
path: ./build/*.fgd
if-no-files-found: error
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install srctools
run: bash ./install_srctools.sh
- name: FGD build and folder copy
run: bash ./build.sh all
- name: Artifact upload
uses: actions/upload-artifact@v2
with:
name: build_${{ runner.os }}-${{ github.sha }}
path: ./build/*.fgd
if-no-files-found: error
59 changes: 30 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@

<hr>

[releases]: https://github.com/TeamSpen210/HammerAddons/releases
[installationwiki]: https://github.com/TeamSpen210/HammerAddons/wiki/Installation
[unifiedfgd]: https://github.com/TeamSpen210/HammerAddons/wiki/Unified-FGD
[skotty]: http://forums.thinking.withportals.com/downloads.php?view=detail&df_id=507
[tf2]: http://forums.tf2maps.net/showthread.php?t=4674
[ts2do]: http://halflife2.filefront.com/file/HalfLife_2_Upgraded_Base_FGDs;48139
[zps]: http://www.necrotalesgames.com/tools/index.php


## Features

* 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.
Expand All @@ -29,26 +20,28 @@
* 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.
* 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:

| Entity | Description |
|------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `comp_choreo_sceneset` | Chains a set of choreographed scenes together. |
| `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. |
| `comp_entity_mover` | Shift an entity by a given amount. This is useful to place entities into the void, for example. |
| `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. |
| `comp_numeric_transtition` | When triggered, animates a keyvalue/input over time with various options. |
| `comp_pack` | Explicitly identify resources to pack into the map. If more are needed, add additional keyvalues with SmartEdit off. |
| `comp_pack_rename` | Pack a file into the BSP, under a different name than it starts with. |
| `comp_pack_replace_soundscript` | Replace a soundscript with a different one. |
| `comp_precache_model` | Force a specific model to load, for runtime switching. Duplicates will be removed. |
| `comp_precache_sound` | Force a specific sound to load, for runtime switching. Duplicates will be removed. More keyvalues can be added. |
| `comp_prop_cable`/`comp_prop_rope` | Generates cables using a static prop. |
| `comp_propcombine_set` | Specifies a group of props that will be combined together. |
| `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. |
| `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. |
| `comp_vactube_end` | Marks the end point of a vactube. Objects reaching here will be cleaned up. |
| `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. |
| `comp_vactube_object` | Registers objects that can appear in the tubing. |
| `comp_vactube_start` | Marks the start point of a vactube. This is where they spawn. |
| Entity | Description |
|----------------------------------------------------|-------------|
| `comp_choreo_sceneset` | Chains a set of choreographed scenes together. |
| `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. |
| `comp_entity_mover` | Shift an entity by a given amount. This is useful to place entities into the void, for example. |
| `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. |
| `comp_numeric_transtition` | When triggered, animates a keyvalue/input over time with various options. |
| `comp_pack` | Explicitly identify resources to pack into the map. If more are needed, add additional keyvalues with SmartEdit off. |
| `comp_pack_rename` | Pack a file into the BSP, under a different name than it starts with. |
| `comp_pack_replace_soundscript` | Replace a soundscript with a different one. |
| `comp_precache_model` | Force a specific model to load, for runtime switching. Duplicates will be removed. |
| `comp_precache_sound` | Force a specific sound to load, for runtime switching. Duplicates will be removed. More keyvalues can be added. |
| `comp_prop_cable`/`comp_prop_rope` | Generates 3D cables using a static prop. |
| `comp_prop_cable_dynamic`/`comp_prop_rope_dynamic` | Modifies the above to generate a dynamic prop, instead. |
| `comp_propcombine_set`/`comp_propcombine_volume` | Specifies a group of props that will be combined together, so they more efficiently render. |
| `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. |
| `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. |
| `comp_vactube_end` | Marks the end point of a vactube. Objects reaching here will be cleaned up. |
| `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. |
| `comp_vactube_spline` | Generates a dynamic vactube model following a set of points. |
| `comp_vactube_object` | Registers objects that can appear in the tubing. |
| `comp_vactube_start` | Marks the start point of a vactube. This is where they spawn. |


## Installation
Expand All @@ -65,3 +58,11 @@
* [The TF2 Ultimate Mapping Resource Pack][tf2]
* [ZPS: Supplemental Hammer Icons][zps]
* [ts2do's HL FGDs][ts2do]

[releases]: https://github.com/TeamSpen210/HammerAddons/releases
[installationwiki]: https://github.com/TeamSpen210/HammerAddons/wiki/Installation
[unifiedfgd]: https://github.com/TeamSpen210/HammerAddons/wiki/Unified-FGD
[skotty]: http://forums.thinking.withportals.com/downloads.php?view=detail&df_id=507
[tf2]: http://forums.tf2maps.net/showthread.php?t=4674
[ts2do]: http://halflife2.filefront.com/file/HalfLife_2_Upgraded_Base_FGDs;48139
[zps]: http://www.necrotalesgames.com/tools/index.php
65 changes: 50 additions & 15 deletions build.bat
Original file line number Diff line number Diff line change
@@ -1,15 +1,50 @@
robocopy hammer build/hammer /S /PURGE
robocopy instances build/instances /XF *.vmx /S /PURGE
robocopy transforms build/postcompiler/transforms /PURGE
python unify_fgd.py exp p2 srctools -o "build/portal2.fgd"
python unify_fgd.py exp p1 srctools -o "build/portal.fgd"
python unify_fgd.py exp hl2 srctools -o "build/hl2.fgd"
python unify_fgd.py exp ep1 ep2 srctools -o "build/episodic.fgd"
python unify_fgd.py exp gmod srctools -o "build/gmod.fgd"
python unify_fgd.py exp csgo srctools -o "build/csgo.fgd"
python unify_fgd.py exp tf2 srctools -o "build/tf2.fgd"
python unify_fgd.py exp asw srctools -o "build/asw.fgd"
python unify_fgd.py exp l4d srctools -o "build/l4d.fgd"
python unify_fgd.py exp l4d2 srctools -o "build/left4dead2.fgd"
python unify_fgd.py exp infra srctools -o "build/infra.fgd"
python unify_fgd.py exp mesa srctools -o "build/blackmesa.fgd"
@echo off
setlocal EnableDelayedExpansion

SET games=p2 p1 hl2 ep1 ep2 gmod csgo tf2 asw l4d l4d2 infra mesa

:: If set, override the FGD filename generated.
SET filename.p2=portal2
SET filename.p1=portal
SET filename.ep1=episodic
SET filename.tf2=tf
SET filename.l4d=left4dead
SET filename.l4d2=left4dead2
SET filename.mesa=blackmesa
SET game=%1

:: Make sure game isn't empty
:while
IF [%game%]==[] (echo Games: %games% & echo Enter game to build. Use ALL to build every game. & SET /P game= & GOTO :while)

IF /I %game%==ALL (
CALL :copy_hammer_files
(FOR %%i in (%games%) do (
CALL :build_game %%i
))
EXIT
) ELSE (
(FOR %%i in (%games%) do (
IF /I %game%==%%i (
CALL :copy_hammer_files
CALL :build_game %game%
EXIT
)
))
echo Unknown game. Exitting. & EXIT /B 1
)

:build_game
SET tag=%1
IF DEFINED filename.%tag% (SET fname=!filename.%tag%!) ELSE (SET fname=%tag%)
echo Building FGD for %1 as "%fname%.fgd"...
py unify_fgd.py exp "%tag%" srctools -o "build/%fname%.fgd"
IF %ERRORLEVEL% NEQ 0 (echo Building FGD for %tag% has failed. Exitting. & EXIT)
EXIT /B

:copy_hammer_files
echo Copying Hammer files...
IF %ERRORLEVEL% LSS 8 robocopy hammer build/hammer /S /PURGE
IF %ERRORLEVEL% LSS 8 robocopy instances build/instances /XF *.vmx /S /PURGE
IF %ERRORLEVEL% LSS 8 EXIT /B 0
echo Failed copying Hammer files. Exitting. & EXIT
48 changes: 48 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/sh
games="p2 p1 hl2 ep1 ep2 gmod csgo tf2 asw l4d l4d2 infra mesa"
game=$1
if [ $# -eq 0 ]; then
echo Games: "${games[*]}" & echo Enter game to build. Use ALL to build every game. & read -p "" game
fi

copy_hammer_files() {
echo "Copying Hammer files..."
mkdir -p build/postcompiler &&
cp -rf hammer build/hammer &&
cp -rf instances build/instances &&
cp -rf transforms build/postcompiler/transforms &&
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.

if [ $? -ne 0 ]; then
echo "Failed copying Hammer files. Exitting." & exit 1
fi
return 0
}

build_game() {
echo "Building FGD for $1..."
python3 unify_fgd.py exp $1 srctools -o "build/$1.fgd"

if [ $? -ne 0 ]; then
echo "Building FGD for $1 has failed. Exitting." & exit 1
fi
return 0
}

if [ "${game^^}" = "ALL" ]; then
copy_hammer_files
for i in $games
do
build_game $i
done
else
for i in $games
do
if [ "$i" = "$game" ]; then
copy_hammer_files
build_game $game
exit
fi
echo "Unknown game. Exitting." & exit 1
done
fi
4 changes: 3 additions & 1 deletion fgd/base_entity.fgd
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

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


Expand Down
Loading

0 comments on commit a13d129

Please sign in to comment.