VMF Remove New IDs tool

Function:
Takes a valve map file (VMF) and an ID number and deletes all of the entities and solids that have ID numbers higher than the inputted ID number.

Usage:
It's a Python script so you will need Python 3
-map <Map file.vmf>
-id <Highest ID number>
-output <output filename>
-old (OPTIONAL: Removes all entities with IDs LOWER than the inputted ID instead)

Usage Example:
python3 vmf_remove_new_id.py -map "F:Beta Archivesall_valve_vmfsportal-mappack2006   estchmb_a_06.vmf" -output "F:Beta Archivesall_valve_vmfsportal-mappack2006   estchmb_a_06_prospekt.vmf" -id "175974"

Reason:
If a level archeologist wants to find all of the map objects that existed during a particular point in the map’s development and is able to find the highest ID number of a map object that they KNOW existed during that time, this program can be used to remove all map objects that were added after the object that they input the ID of. Because Hammer uses “Linear Allocation,” map objects are NOT in order from lowest to highest, as new map objects are placed in the spaces of old map objects that have been deleted.

Caveats:
1. This can only be used on original map sources, because decompiled maps would not retain the ID numbers.
2. When programming this parser, it is insufficient to just search for lines with “id” in them, because “world,” “side,” and “group” all use numerical IDs as well. Additionally, “side” uses ID numbers that are independent of “entity” and “solid.” This means that some numbers that “entity” and “solid” use are also used by “side.” This means that the parser needs to specifically check and see if the upcoming chunk of data has solid or entity as a heading before entering the curly brackets and checking for the first ID.
3. Some entities are hidden and have “hidden” as an additional curly bracket above the entity definition. This will need to be accounted for somehow.

Credits:
Maelstrom - author of the script
Wolfcl0ck - idea, specification
Дата: 19.08.2024
Скачано 58 раз
Рейтинг: ***** Всего оценок: 2

Скачать (4kB)

Онлайн

  • Точка Гостей: 18
  • Точка Пользователей: 0