JSONShadow Tool

Discussion in 'Mod Discussions' started by nixtempestas, August 29, 2014.

  1. nixtempestas

    nixtempestas Post Master General

    Messages:
    1,216
    Likes Received:
    746
    Now that this tool is in a reasonably presentable state (which is to say, no longer an abomination of java programming that happened to still be useful) I have decided to give it a thread of its own.

    Purpose:
    As the name implies, it is meant to shadow and modify .json files for mod creation purposes.

    Advantages:
    - Provides one location for all modded json files and values in ActionLists.txt
    - Once ActionLists.txt is setup (the syntax is very simple) you can perform rapid tweaks of values and recreate the mod in a matter of seconds. Ideal for rapid iteration on balance mods (Anti-Popcorn Units is generated entirely with this tool, which you will see in the default ActionLists.txt) though can be used in other circumstances as well.
    -don't have to worry about folder structures, it should do it all for you.

    How To Use:
    1. Go to the github page posted below and download the latest release (currently v2.1)
    2. Move JSONShadow.jar and ActionLists.txt to a convenient location. I like to put them in the mod folder along with modinfo.json, though it doesn't really matter so long as they are in the same folder
    3. Open ActionLists.txt in your text editor of choice. Read the comments. Change srcdir and moddir to be appropriate for your system (specify your PA location and mod folder for your computer, see the example).
    4. At this point, it is now in a runnable state, and running it would create Anti-Popcorn Units v1.4.5. To start your own mod, delete or modify the existing code to do what you want.
    5. Once you are done your modifications, save ActionLists.txt and then run JSONShadow.jar. it'll probably take a couple seconds and your mod should appear. Create the modinfo.json (though you should be able to shadow one of uber's with the tool if you really want) and away you go.
    6. IMPORTANT: The tool will ONLY use vanilla files as it's source if it cannot find them in the mod folder. If you want it to use the vanilla files, make sure you delete any old mod files before running the tool, or you could have a cascading effect when using the multiply type.

    If you are feeling creative, adventurous or just curious, I also included the source code in the release which you can modify if you like, though fair warning it is not commented well. (or at all really...)

    if something is going wrong, run it in a console or IDE to get debug output.

    Any questions, feedback, bugs etc, please post below.

    Current Future Plans:
    No more future plans for this tool, though I'm working on another that is far more sophisticated that will make this one obsolete.

    Current Known Issues:
    if there are files named the same, it may get confused and grab the wrong one. Temporary workaround is just make sure the files which have duplicates (doesn't seem to be many thankfully) are already in the mod folder.
    Added exclude (see example ActionList.txt for anti-popcorn for example) to better support this.

    If there are repeats of a key in the json file, it may not find the right one. Will implement a means of specification next week when I have time.

    Github:
    https://github.com/lrolleman/JSONShadowTool
    Last edited: March 15, 2015
    Quitch, wondible and Corang like this.

Share This Page