Creating Gun Jsons/Jtk2ds
Last updated
Last updated
Gun Jsons/Jtk2ds are files that accompany your sprites to indicate hand positions, or clip and casing ejection positions. Jtk2d files are formatted the same as JSON files, but have the benefit of not appearing in r2modman's config editor, and so are generally more used. Click here to learn more about converting between Jsons and Jtk2ds in this tutorial.
Everything in this tutorial that applies to Json files also applies to Jtk2d files.
Each animation of a gun requires at least 1 Json for the first frame containing at least hand positions to function
Jsons must be located in the same location as your gun's sprites
For every frame that has a different position, that frame will need its own Json
A Json tied to a specific frame must match that frame's sprite name
If you have a series of frames that have the exact same position, you only need a Json for the first frame it occurs for
There are two main ways to create gun Jsons: using tools we have created, or manually (nowadays, we NEVER do it manually - the tools are MUCH better), however, both options will be available for guidance.
The tools we have for creating jsons are great and are much easier than writing them manually. There are 3 available tools to use:
Gun Animation Editor (adequately named GAE)
Gun Animation Editor 2 (GAE2)
Gun Animation Editor Reloaded (GAER)
Each of these is a more improved version of the one that came before - so the best one to use currently is GAER which this tutorial will cover how to use, if need be. Links to the other two will be available at the bottom.
LINK TO GAER: https://github.com/pcrain/gungeon-modding-tools/releases
Simply go to the most up-to-date version, and click on the .exe file to download it. Nothing other than the .exe should be needed to run.
BASICS
Open up the .exe, and then you should see a basic UI with buttons on the top left.
Click "Open Gun For Editing" (shortcut Ctrl+O) and navigate/type in the file path to your gun sprites, and choose one of your sprites to open.
You should be met with this:
From here you can enable/disable which parts of the json you wish to write and follow the binds to move each part to the location you want.
Casing and Clip positions can be freely enabled/disabled on a frame-frame basis,
But whether your gun uses 1 or 2 hands must be consistent for every frame of every animation of your gun.
Ensure that you save each frame before moving on to the next - unless you have the "Autosave on switch/exit" option enabled.
Advanced view looks like this:
This contains more options and additional information regarding hotkeys and each part of the json. Use either view depending on how much information you want on the screen at once!
The only hotkey of note would be Ctrl + T - "Translate Gun Data" which takes an entire animation and translates all of the offsets by a desired amount. This is mainly useful if your sprite size has changed or if only minor adjustments are made:
The "Paste?" checkboxes at the left of each option indicate whether you want to copy/paste specific parts of each json, useful if you like doing each part of the json one at a time or if you don't want a frame you're copying into to have a Casing position, etc.
Clicking "Show Options" brings up a drop-down menu that looks like this:
Most of these options are self-explanatory, but a few that aren't are described below:
Autosave on switch/exit - autosaves changes made to each frame as a json file in your directory upon switching frames/exiting the program
Show hand sprite overlay - with this disabled, hands will appear as a small circle instead of how they would look in game. Toggle at your preference
Make backups when batch translating - when using the "Batch Translate" tool (shown in advanced view) you can choose to make a backup of your previous jsons juuust in case something goes horribly wrong. The backups will appear in a seperate folder in your directory:
Export as .jtk2d instead of .json - highly reccommended, as explained previously, exports all jsons as jtk2ds, which makes no functional difference but prevents them from showing up where they shouldn't
High DPI Display (WIP) - makes the screen resolution BIG if you like it that way (WIP so if it sucks don't hate it)
Access the original GAE and GAE 2 using this link:
Click "Manual Download" and extract the files normally.
Since Jsons and Jtk2ds are completely the same format, the only thing you need to do to convert from the two is to rename the file extension. In Windows 11 by default, file extensions are hidden, and you you need to enable them to rename the extension:
This can be quite tedious to do en masse, however, so one of us made a tool to convert a folder full of jsons into jtk2d:
Just drag the folder with your jsons onto the .exe and you should be good to go! Don't worry if your sprites are in there - etc. the program should automatically ignore those files.