Help:Automation

From Valve Developer Community
Revision as of 03:17, 5 April 2024 by NOUG4AT (talk | contribs)
Jump to navigation Jump to search
Icon-under construction-blue.png
This is a draft help page. It is a work in progress open to editing by anyone.
Remember to check for any notes left by the tagger at this article's talk page.
Broom icon.png
This article or section should be converted to third person to conform to wiki standards.

Stub

This article or section is a stub. You can help by expanding it.

Todo: Rename and move to Automation on the VDC
Broom icon.png
This article or section needs to be cleaned up to conform to a higher standard of quality because:
Any ideas?
For help, see the VDC Editing Help and Wikipedia cleanup process. Also, remember to check for any notes left by the tagger at this article's talk page.

Scripts

Some tips on how to make your life easier when performing various tedious tasks. As you know, any simple tasks that do not contain something like "write a poem!" are subject to automation, although this is still possible today. But here I will show you some scripts that are useful... for creating something.

Tip.pngTip:Almost any AI Bot makes mistakes during automation and requires appropriate prompts. Separately written scripts are still prefer for such tasks.

Entity Lists

Creating lists of entities is not something supernatural; in fact, it is a simple task. While studying the .fgd file format, I outlined some points for myself that can be used to my advantage. Well, look!

For Source Source FGDs

Todo: Python impletation with GUI (PyQT6)
Icon-Important.pngImportant:Tested only on Linux Linux
Icon-Bug.pngBug:Sometimes the script adds entities to the wrong section (with a different prefix)  [todo tested in ?]
Icon-Bug.pngBug:Sometimes unnecessary spaces may be created.  [todo tested in ?]
Warning.pngWarning:This script is useless if the FGD format is changed in the project (on the Source Source Engine). This script is works with the standard Valve format of FGD files for all vanilla Source Source branches.

The Script[1]

  • Uses grep -i '^\(@solidclass\|@pointclass\|@NPCClass\)' "$1" to filter lines from the input file that start with @solidclass, @pointclass, or @NPCClass.
  • Creates sections based on the prefixes extracted from the processed lines. It uses an associative array declare -A seen to keep track of prefixes that have already been processed. This ensures that each prefix corresponds to a single section.
  • Uses *{{ent|$result}} to format the processed lines as wiki entries.
  • The section headers are formatted as ===%s_*=== where %s is replaced with the prefix. For example, if the prefix is example, the section header will be ===example_*===. Each processed line is then added under the appropriate section.
  • Handles unincluded lines by appending them to a separate "Unincluded" section at the end of the output file. This ensures that all lines are accounted for, even if they don't fit the criteria for the other sections.

Usage

Empty

This article or section is empty. You can help by adding it.

Examples

For GoldSrc FGDs

The Script[1]

Table Generator for Console Variables

Empty

This article or section is empty. You can help by adding it.

Bots

Empty

This article or section is empty. You can help by adding it.

References

  1. "FGD to Entity List" for Source Engine (GitHub Gist)
  2. "FGD to Entity List" for GoldSrc Engine (GitHub Gist)