-
May 14th, 2020, 17:24 #1
Sanitize Mod Files Windows Command Script
Put together a some scripts for windows to Sanitize the mod files so I thought I'd share it.
It unpacks mod files, replaces characters in the db.xml, and repacks the file and replaces the original mod file.
It implements all the changes the listed as common substitutions.
Common Substitutions
searching replacing (description)
… ... (3 periods)
‘ ' (standard single quote)
’ ' (standard single quote)
“ " (standard double quote)
” " (standard double quote)
• * (asterisk)
– - (standard dash)
— - (standard dash)
& & (note this looks for & with a space after it)
Update 5-18-20: Added 2 if file exists db.xml / common.xml checks for the modules before attempting to sanitize and create them.
(WINDOWS ONLY) Unzip the contents of Sanitize_Mod into its own folder and just drag and drop your mod files onto CleanModFile.cmd
IMPORTANT!!! This creates and deletes files so its a use at your own risk kind of thing. Everything works fine for me, but I make no guarantees.Last edited by zombielord; May 19th, 2020 at 04:34.
Ultimate License Holder
Systems:ALIEN, Savage Worlds (SWADE + Companions, 50 Fathoms, Interface Zero, Realms of Cthulhu), Call of Cthulhu 6th, FIASCO, Paranoia XP
FG Con 16 – Fantasy Grounds Online RPG Convention - Friday April 16th to Sunday April 18th, 2021
Register at www.fg-con.com for all the latest info.
-
May 14th, 2020, 17:32 #2
Nice work. I'm sure this is going to make lots of people happy
Problems? See; How to Report Issues, Bugs & Problems
On Licensing & Distributing Community Content
Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
Note, I am not a SmiteWorks employee or representative, I'm just a user like you.
-
May 14th, 2020, 21:17 #3
Moved to the Armory sub-forum.
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
May 18th, 2020, 08:35 #4
Im sanitizing a .mod right now. I have now idea what this does but it looks like fun. Thnx man!
-
May 18th, 2020, 13:46 #5
Is this effective against corona viruses?
-
May 18th, 2020, 16:38 #6
It purges any heretical glyphs to the machine code and renders the blessings of the Omnissiah to appease the machine spirit.
OR...
It swaps out bits of text to common substitutions so things will display nicely in Unity or with non-extended font sets.Ultimate License Holder
Systems:ALIEN, Savage Worlds (SWADE + Companions, 50 Fathoms, Interface Zero, Realms of Cthulhu), Call of Cthulhu 6th, FIASCO, Paranoia XP
FG Con 16 – Fantasy Grounds Online RPG Convention - Friday April 16th to Sunday April 18th, 2021
Register at www.fg-con.com for all the latest info.
-
May 18th, 2020, 18:22 #7
just tried it on Shaderavens Bestairy PF2 mod and it broke it, neither classic or unity versions could see the module any more
Ultimate licence
GMT Time zone-UK
brawny hook bold thug
https://discord.gg/9MHgEqV
ON DMS Guild https://www.dmsguild.com/product/2246...&filters=45680
https://www.dmsguild.com/product/2205...&filters=45680
-
May 18th, 2020, 20:55 #8
Thanks for the feedback. I'm doing a test with that specific file.
Results of testing using current file: Created (SR-U) Bestiary.mod. The mod file created successfully. I don't have the pathfinder rule set to verify but I've included the created file.
Note: it did take a long time for the script to parse through everything, but that's not un-common for mod files with lots of text.
Let me know if it works for you. If not I'll do some more digging.
I did, recently add a new check to see if db.xml and common.xml exists in the mod files before creating themLast edited by zombielord; May 19th, 2020 at 01:08.
Ultimate License Holder
Systems:ALIEN, Savage Worlds (SWADE + Companions, 50 Fathoms, Interface Zero, Realms of Cthulhu), Call of Cthulhu 6th, FIASCO, Paranoia XP
FG Con 16 – Fantasy Grounds Online RPG Convention - Friday April 16th to Sunday April 18th, 2021
Register at www.fg-con.com for all the latest info.
-
May 21st, 2020, 11:09 #9
the mod loads but i have this problem
Annotation 2020-05-21 110504.jpg
the damage should be d4-1
its a problem with Paizo using a &"150 en dash instead of a regular minus, this isn't a problem in classic but in Unity...Ultimate licence
GMT Time zone-UK
brawny hook bold thug
https://discord.gg/9MHgEqV
ON DMS Guild https://www.dmsguild.com/product/2246...&filters=45680
https://www.dmsguild.com/product/2205...&filters=45680
-
May 21st, 2020, 13:48 #10
Yes, you do, it ships free with FG.
That is the correct character to use for publication; every publisher does it, including everyone's oh-so-precious Wizards of the Coast. Copying out of a PDF will get the correct-for-publication characters, which won't work in the trash encoding set that the cross-platform Unity library is currently stuck with. Having said that, it is the incorrect character for any computer to do math with, such as being present in a damage string here in FG.
I haven't used this script, but what it should probably do is check for both the character itself and the entity code for the character range 128–159 if it's doing pure text searching. There are plenty of community modules out there where the author just copied directly out of the PDF (which of course will have the correct characters) and never did any sanitization on their own. FG will by default convert the five characters which are XML entities, but pretty much everything else it leaves alone.Last edited by Talyn; May 21st, 2020 at 13:56.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks