Joshua Stream Pre
Page 1 of 2 12 Last
  1. #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.
    Attached Files Attached Files
    Last edited by zombielord; May 19th, 2020 at 04:34.
    Ultimate License Holder
    Systems:Savage Worlds (SWADE + Companions, 50 Fathoms), Call of Cthulhu 6th, FIASCO, Realms of Cthulhu (SWADE), Paranoia XP

    FG Con 16 Fantasy Grounds Online RPG Convention - Friday April 24th to Sunday April 26th, 2020
    Register at www.fg-con.com for all the latest info.

  2. #2
    LordEntrails's Avatar
    Join Date
    May 2015
    Location
    -7 UTC
    Posts
    11,124
    Blog Entries
    9
    Nice work. I'm sure this is going to make lots of people happy

  3. #3
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Newcastle, UK (for a bit)
    Posts
    26,493
    Moved to the Armory sub-forum.
    FG Con 16 Fantasy Grounds Online RPG Convention - Postponed New date To Be Confirmed.
    Register at www.fg-con.com for all the latest info.

    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!

  4. #4
    Im sanitizing a .mod right now. I have now idea what this does but it looks like fun. Thnx man!

  5. #5
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    21,573
    Blog Entries
    1
    Is this effective against corona viruses?

    MoreCore - Generic Ruleset
    --- Projects ---
    Extensions | Tutorials | MoreCore | MoreCore Themes | Call of Cthulhu | Maelstrom | FG Con

  6. #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:Savage Worlds (SWADE + Companions, 50 Fathoms), Call of Cthulhu 6th, FIASCO, Realms of Cthulhu (SWADE), Paranoia XP

    FG Con 16 Fantasy Grounds Online RPG Convention - Friday April 24th to Sunday April 26th, 2020
    Register at www.fg-con.com for all the latest info.

  7. #7
    hawkwind's Avatar
    Join Date
    Oct 2012
    Location
    London Calling
    Posts
    2,374
    just tried it on Shaderavens Bestairy PF2 mod and it broke it, neither classic or unity versions could see the module any more

  8. #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 them
    Attached Files Attached Files
    Last edited by zombielord; May 19th, 2020 at 01:08.
    Ultimate License Holder
    Systems:Savage Worlds (SWADE + Companions, 50 Fathoms), Call of Cthulhu 6th, FIASCO, Realms of Cthulhu (SWADE), Paranoia XP

    FG Con 16 Fantasy Grounds Online RPG Convention - Friday April 24th to Sunday April 26th, 2020
    Register at www.fg-con.com for all the latest info.

  9. #9
    hawkwind's Avatar
    Join Date
    Oct 2012
    Location
    London Calling
    Posts
    2,374
    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...

  10. #10

    Join Date
    May 2016
    Location
    Jacksonville, FL
    Posts
    1,978
    Blog Entries
    7
    Quote Originally Posted by zombielord View Post
    I don't have the pathfinder rule set to verify
    Yes, you do, it ships free with FG.

    Quote Originally Posted by hawkwind View Post
    ts a problem with Paizo using a en dash instead of a regular minus
    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)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Starfinder Playlist

Log in

Log in