Downloads: ModelDB_Formatter 3rd Party Patch v0.56

ModelDB_Formatter 3rd Party Patch v0.56

Rate this File
Uploaded by Hexdragon - May 15, 2021
Author Author Hexdragon
File Size File Size 427.3 KB
Downloads Downloads 47
+ Download
**** ModelDB_Formatter_3rdParty_Patch v0.56 ****

1.-Description:
============
This tool is a third party patch wrapped around KnightErrant's ModelDB Formatter and ModelDB Syntax Checker.

The patch adds:
-A graphic user interface
-A pre-processing stage for formatted modeldb files that require a "cleanse" in order to run syntax checker without making it to crash
-Two formatter-level options with additional line breaks
-A loadable custom faction list for the syntax checker

For brand new ModelDB files, this patched version provides just a slightly extended set of line breaks.
On the other hand, this version of tool can be used as a re-formatter for already formatted ModelDB files that require a good mopping.

Just as the previous version of the patch, the current one offers support for ModelDB files whose data lines contain uncommon characters
like "&" and "-".


2.-Downloadable Zip Content:
=======================
-ModelDB_Formatter_3rdParty_Patch _v056.py >>> This is the module you will execute. It contains both the formatter tool and the GUI.
-ModelDB_Syntax_Check_3rdParty_Patch_v056.py >>> Syntax checker, adapted to the patched formatter. No longer standalone. Use GUI to launch it.
-faction_list.txt >>> Here is where you can include your "progressive_elves" custom faction name to be considered by the syntax checker.
-Readme.txt >>> Read the Readme, always.

Four .png files with brief descrption and examples of Model DB format also included in the zip file.


3.- Requirements:
================
-Python 2.7
This tool has been coded and tested with Python 2.7.18.
I believe it may work with ealier versions like python 2.6.8 (as previous version did) but cannot confirm at the moment.

-Notepad++
Or anything else that allows you to edit xml files.


4.- Basic Use:
============
4.1- Launch the GUI (ModelDB_Formatter_3rdParty_Patch _v056.py) by either :
a) Double click, or
b) Right click + "Edit with IDLE" + "Run" (Idle's menu option) + "Run Module"

4.2- Select your ModelDB file with:
a) "Select" button. or
b) Menu Option: File + Select File

4.3- Press "Execute" button to start Format / Reformat work
At first, a report about the number of line breaks found in your file will appear on GUI
Check the report and press "Execute" button again.

4.4- With default values in parameters, your new ModelDB file will be written with suffix "F0" "F1" or "F2" depending on the chosen format-level option (see section 5 for details)


5.-Custom Execution:
================
5.1- Format Levels:
Level 0: This option removes format from file. No line breaks will remain in output ModelDB file after executing this format level option
Level 1: This option adds all meaningful line breaks to ModelDB File. Yet, it will omit some line breaks in the first mount entry, which is an irregular entry.
Level 2: This option adds all meaningful line breaks to ModelDB File, including line breaks for the first (irregular) mount entry that were omitted in level one.

5.2- Syntax Check:
-In order to run ModelDB Syntax Checker instead of ModelDB formatter, select the the option "Syntax Check" at the end of the format levels panel.
Then proceed as indicated in section 4.2 and 4.3.
-If the file faction_list.txt is not present in folder, syntax checker will only consider M2TW vanilla and kingdoms factions (may trigger false positives for faction count errors as a result)

Important: Syntax checker is compatible with format level 1 (F1) only.
Use format level 2 (F2) ) only if you do not plan to run syntax checker on you formatted file

5.3- Execution Sequence:
By default, any format level triggers a cumulative sequence of task to be caried on your source ModelDB file
a) At first, a 10-stage pre-process aimed to remove spurious blank spaces, and duplicated line breaks, as well as to add missing blank spaces, will be run.
In addition this pre-process will convert unix / lynux style line breaks into windows style line breaks and replace backslash with forward slash characters.
A custom fix that replaces a "3" plus double space with "0" plus double space has been included.
b) After pre-process, cames format removal. If user selected format-level 0, the whole process ends here.
c) After format removal, cames the (re)format process either format-level 1 or format-level 2.

5.4- Custom Level Zero:
-By means of parameter named "level_zero" user can partially change the task sequence described in section 5.3
level_zero = "F" (Full), will execute both file pre-process and format removal.
level_zero = "D" (Dull), will execute format removal only.
level_zero = "C" (Cull), will execute file pre-process.
level_zero = "N" (Null), will omit execution of both file pre-process and format removal.

-Default value for "level_zero" is "F". This value will be restored any time you select a format-level option either 0, 1 or 2.
Thus, in order to use other options for this parameter select your format level first; then change "level_zero" and execute.
Your new ModelDB file will be written with suffix that reference your choice, such as "D0" or "N1"

-If you are going to format a brand new M2TW vanilla or kingdoms ModelDB file, level_zero = "N" will save you a couple of minutes with a quicker execution.
On the other hand, if you are handling a war thorn ModelDB file, made for a mod created by a team of russian modders who love to work in linux, it will be better
to run the format routine with default settings.

-The option level_zero = "C" can be usefull if user wants to try a double pass of file pre-process task in the source file by running tool with format-level = 0 and
level_zero = "C", and later running with default options using the output file of the previous step as source file.


6.-GUI Options:
============
6.1- You can switch GUI font style by either:
a) Pressing "F" key
b) Menu Option: Appearance + Switch Font
6.2- You can switch GUI color by either:
a) Pressing "C" key
b) Menu Option: Appearance + Switch Color

----

Discussion thread
https://www.twcenter.net/forums/showthread.php?811446

----
Have fun
Hexdragon (George586)


Images

  • ModelDB_Formatter 3rd Party Patch v0.56

Comments

There are no comments yet.