-
Notifications
You must be signed in to change notification settings - Fork 22
Creating new guides for FGDs with specifics in regard to Strata #177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+152
−3
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
df28879
feat: Started guide for Strata made FGD helpers
OrsellGit ed4cf74
feat: Documented the rest of the available Strata specific FGD helpers
OrsellGit 28b58d7
feat: Added a introduction article for FGDs
OrsellGit 9a082ca
feat: Added images for FGD article
OrsellGit 57ec9b2
fix: Fixed paths for some images and removing the accidentally added …
OrsellGit f557850
fix: Fixed headers so links work and removed some comments
OrsellGit 0ff4ec0
fix: Fixed some more section links
OrsellGit be27503
fix: Fixed some wording and added the topic of the FGD specified in g…
OrsellGit dedd64e
fix: Removed informal language
OrsellGit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| --- | ||
| title: New FGD Helpers | ||
| weight: 5 | ||
| features: | ||
| --- | ||
|
|
||
| # New FGD Helpers | ||
|
|
||
| Strata Source provides new FGD helpers that can be used in FGD files to extend the functionality and visuals of entities when working with them in Hammer. Some helpers rely on parameter input by using an KeyValue (KV) entry to work or rely on various KVs existing so the helper can function. | ||
|
|
||
| > [!NOTE] | ||
| > | ||
| > FGD helpers need to be specified **before** the class name assignment for the entity. | ||
|
|
||
| ## Strata FGD Helpers | ||
|
|
||
| * [`catapult()`](./fgd-helpers#catapult) | ||
| * [`direction(angle/vector)`](./fgd-helpers#directionanglevector) | ||
| * [`orientedboundingbox(width, height, depth)`](./fgd-helpers#orientedboundingboxwidth-height-depth) | ||
| * [`orientedboundingboxhalf(width, height, depth)`](./fgd-helpers#orientedboundingboxhalfwidth-height-depth) | ||
| * [`orientedwidthheight(width, height)`](./fgd-helpers#orientedwidthheightwidth-height) | ||
| * [`worldtext()`](./fgd-helpers#worldtext) | ||
|
|
||
| ## catapult() | ||
|
|
||
| Typically used for `trigger_catapult`. Provides a preview of the launch arc of the launch by the trigger generated by other KVs. For the `catapult` FGD helper to properly render the launch preview, the KVs `playerspeed`, `physicsspeed`, `launchtarget`, `useExactVelocity`, and `exactvelocitychoicetype`, are needed whether that is from manually adding them to the entity class entry or inheriting the `trigger_catapult` class entry. | ||
|
|
||
| `catapult` produces three lines for the preview. `useExactVelocity` will change how these lines behave if set to `Yes`/`1`. | ||
|
|
||
| * Green: When `useExactVelocity` is `No`/`0` and `playerspeed` does not equal `physicsspeed` the green line will represent the predicted arc of the player as defined by `playerspeed`. When `useExactVelocity` is enabled, the green line represents the more exact launch arc. Another green line will go with this from the entity to the end of the arc. | ||
| * Yellow: The yellow line represents the predicted arc of physics objects as defined by `physicsspeed` as long as it doesn't equal `playerspeed`. | ||
|
|
||
|  | ||
|
|
||
| Preview when `useExactVelocity` is set to `Yes`/`1`. | ||
|  | ||
|
|
||
| ## direction(angle/vector) | ||
|
|
||
| The `direction` helpers allows for adding a arrow which protrudes from the entities origin to visually show a direction based on a KV input. `angle` and `vector` KV types work for a parameter for `direction` but it's recommended to use `angle` so the arrow can be more easily set. | ||
|
|
||
|  | ||
|
|
||
| ## orientedboundingbox(width, height, depth) | ||
|
|
||
| `orientedboundingbox` allows for displaying, as the name implies, an white Oriented Bounding Box at the entities origin that can be changed using KVs in the entity class entry. Using KVs named as `width`, `height`, and `depth` is not required but put here to represent what each parameter represents. The OBB will rotate with the entity. | ||
|
|
||
| Parameters: | ||
|
|
||
| * width: Defines the width size of the bounding box along the x-axis/red axis. | ||
| * depth: Defines the depth size of the bounding box along the y-axis/green axis. | ||
| * height: Defines the height size of the bounding box along the z-axis/blue axis. | ||
|
|
||
|  | ||
|
|
||
| ## orientedboundingboxhalf(width, height, depth) | ||
|
|
||
| Exact same as `orientedboundingbox` but halves the sizes specified. | ||
|
|
||
| Parameters: | ||
|
|
||
| * width: Defines the width size of the bounding box along the x-axis/red axis. | ||
| * depth: Defines the depth size of the bounding box along the y-axis/green axis. | ||
| * height: Defines the height size of the bounding box along the z-axis/blue axis. | ||
|
|
||
| ## orientedwidthheight(width, height) | ||
|
|
||
| Similar to `orientedboundingbox` but for representing flat quads. This preview uses a green plane to represent the width which extends its height based on the height parameter along the z-axis. | ||
|
|
||
| Parameters: | ||
|
|
||
| * width: Defines the depth size of the bounding box along the y-axis/green axis. | ||
| * height: Defines the height size of the bounding box along the z-axis/blue axis. | ||
|
|
||
|  | ||
|
|
||
| ## worldtext() | ||
|
|
||
| `worldtext` is used to display visible text within Hammer's 3D viewport. Originally this was used for `point_worldtext` to display text in Hammer to get a visual on how it looks in game, but has also been used for `hammer_notes` to provide visible text in Hammer only. `worldtext` relies on the `message` KV to know what text to display in Hammer. | ||
|
|
||
|  |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| --- | ||
| title: Strata FGDs | ||
| weight: 0 | ||
| features: | ||
| --- | ||
|
|
||
| # Strata Forge Game Data (FGD) | ||
|
|
||
| ## Introduction | ||
|
|
||
| **Valve's Hammer Editor**, starting from when it was the **Worldcraft** editor, uses plain text files to tell the editor what entities are available for the editor to provide. These are seen when using the **Entity Tool** or when in the **Object Properties** window, choosing classnames under the drop down for standard entities or brush entities. | ||
|
|
||
| These plain text files are named Forge Game Data or FGD for short. Every FGD file used by Hammer ends with the `.fgd` extension and are usually located (for Strata titles specifically) in their respective `GAME` folder (`p2ce`, `momentum`, etc). FGDs can be loaded from anywhere as long as they are formatted correctly for Hammer. | ||
|
|
||
| > [!CAUTION] | ||
| > | ||
| > A misconception with FGDs are that they tell the engine about what entities exist and their KeyValues and I/O. ***This is not true.*** | ||
| > | ||
| > While FGDs tell Hammer what entities do exist in the engine, the reverse does not apply. Adding an entity entry does not add this entity to the engine, and changing existing entities KeyValues or I/O will not change what KeyValves and I/O the engine has defined. While custom FGD entities can get compiled (depending on the type) into a BSP if placed in a VMF, the engine dictates what entities do and don't exist and what KeyValues and I/O they have. If the engine sees an entity which doesn't exist in code, it will ignore it and print a error in the console stating the fact. | ||
| > | ||
| > This point also applies to custom AngelScript entities. While custom AngelScript entities are not programmed in at a engine level, the engine will still try to find any registered AngelScript entities in the BSP and add them into the map. | ||
|
|
||
| While the Strata Source Wiki will provide basic details on how to add a FGD to Strata's Hammer, it will not explain every single available FGD helper, entity class type or property, I/O type, or KV type. Only specific Strata features will be documented here. To get a full list of what is available for FGDs, the [FGD page on the Valve Developer Community site](https://developer.valvesoftware.com/wiki/FGD) can provide details on lots of other pieces that can be used. Note that not everything will work with Strata Source's Hammer. | ||
|
|
||
| ## Specific Strata FGD Features | ||
|
|
||
| * Custom Entity Flags: The `flags` KV type can now be used on other KVs besides `spawnflags`. This is a good alternative to `choices` if there are various choices but also want to have multiple to be selected. | ||
|
|
||
|  | ||
|  | ||
|
|
||
| * `soundscape` KV type: A new KV type similar to `sound` or `studio` that will give the option to open the **Soundscape Browser** for choosing soundscapes. This is generally used with `env_soundscape`. | ||
|
|
||
|  | ||
|
|
||
| * `bool` and `boolean`: KV types `bool` and `boolean` are both valid and interchangeable for FGD KVs. | ||
|
|
||
| * Escape Sequences: Escape sequences `\n` `\t` `\"` `\\` are supported in FGD KV descriptions and don't cause issues with VMFs. | ||
|
|
||
| * Additional FGD Helpers: Strata Source adds several FGD helpers to aid with working with entities in Hammer. [Check this article out to find out more](./fgd-helpers). | ||
|
|
||
| * Custom AngelScript Entities: Custom FGDs allow for adding custom AngelScript entities that can be placed into Hammer. When the map is compiled, the AngelScript system will tie that entity to the scripted AngelScript entity. | ||
|
|
||
| ## Adding An FGD to Hammer | ||
|
|
||
| While this process is very similar most other versions of Hammer, the UI has changed so details will still be supplied. | ||
|
|
||
| FGDs are added to Hammer game configurations, these are located in the Hammer options via the menu bar near the top of the Hammer window under `Tools > Options`. | ||
|
|
||
|  | ||
|
|
||
| From there, navigate using the side bar to `Game Configuration`. At the top is where used FGDs are listed under `Game data files`. To add an new FGD, simply click `Add...` on the right. To get to a existing FGD to edit, select an FGD in the list and click `Edit`. This will open the FGD file in the systems default text editor. To remove an FGD, select one in the list and click `Remove`, this will not remove the actual FGD file. | ||
|
|
||
|  | ||
|
|
||
| ## Specifying FGD in a GameInfo | ||
|
|
||
| In a game's GameInfo file (`gameinfo.txt`), a FGD is specified as the "main" FGD that will be used by the VBSP for instance fixups. | ||
|
|
||
| > [!CAUTION] | ||
| > | ||
| > Any entity entries not in the "main" FGD that are placed into instances used in a map will be ignored by VBSP. Those entities will not be properly compiled into the map, and will be placed at the world origin potentially causing a leak. | ||
| > | ||
| > If using custom FGDs for AngelScript entities, any custom entity entries not in the GameInfo FGD, and custom entities in instances, they will also be ignored. | ||
|
|
||
| ## Additional Resources | ||
|
|
||
| * [FGD Helpers](./fgd-helpers) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.