Help:Automation: Difference between revisions
Jump to navigation
Jump to search
Important:Tested only on
Linux
Bug:Sometimes the script adds entities to the wrong section (with a different prefix) [todo tested in ?]
Bug:Sometimes unnecessary spaces may be created. [todo tested in ?]
Warning:This script is useless if the FGD format is changed in the project (on the
Source Engine). This script is works with the standard Valve format of FGD files for all vanilla
Source branches.
(Created page with "{{Draft}} This article provides 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 li...") |
|||
Line 10: | Line 10: | ||
{{bug|Sometimes the script adds entities to the wrong section (with a different prefix)}} | {{bug|Sometimes the script adds entities to the wrong section (with a different prefix)}} | ||
{{bug|Sometimes unnecessary spaces may be created.}} | {{bug|Sometimes unnecessary spaces may be created.}} | ||
{{ | {{warning|This script is useless if the [[FGD]] format is changed in the project (on the {{src|4|nt=1}}). This script is works with the standard Valve format of FGD files for all vanilla {{src|4}} branches.}} | ||
'''The Script'''{{ref|1}} | '''The Script'''{{ref|1}} | ||
*Uses grep -i '^\(@solidclass\|@pointclass\|@NPCClass\)' "$1" to filter lines from the input file that start with @solidclass, @pointclass, or @NPCClass. | *Uses grep -i '^\(@solidclass\|@pointclass\|@NPCClass\)' "$1" to filter lines from the input file that start with @solidclass, @pointclass, or @NPCClass. |
Revision as of 09:02, 2 April 2024

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.
Remember to check for any notes left by the tagger at this article's talk page.
This article provides 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.
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 FGDs
Todo: Python impletation with GUI (PyQT6)







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.