To make your own weapons, like any blacksmith, you'll need some tools.
The first tool you'll need is a SQLite browser. https://sqlitebrowser.org/ is the one I use. Use this to access the database located at \Portia_Data\StreamingAssets\CccData\LocalDb.bytes
The rest of the tools are really just text files. You'll need a good text editor, like Notepad++. Text files are located in this mod's assets folder.
weaponItems.json
weaponItems.json is the main file you use to create a custom weapon. The one that comes with the mod contains two JSON nodes, each of which is a custom weapon. Just copy one of the nodes, curly brackets, comma, and all, to make a third node and edit it to create your weapon.
Notes on weaponItems.json entries:
- The three path strings are to be found in the database table Props_total_table. Find the entries for the item you want to weaponize and copy all three to your node's entries. I've included a list of item names by ID in another article.
- orderIndex determines how the item is sorted in a storage
- intendType doesn't do much, I don't think
- displayScale relates to how big the item looks in the store.
- skillIds is the most important entry, which I'll talk about below
- attack, defence, etc. values for existing weapons can be found in the Item_equipment table for reference.
- critical is crit chance (0.0 - 1.0)
- rate refers to how much stamina it uses, I think
- storeId is the id of the store where this weapon is found. ids are listed below.
- chance is the chance of the chosen store stocking your weapon.
Store IDs:
1 Farm Store
2 The Round Table
3 Clothing Store
4 Best Brother
5 Total Tools
7 Martha's Bakery
8 Alice's Flower Shop
9 Clinic Shop
10 Mysterious Man
11 Emily's Food Stall
12 Church Store
13 Badge Exchange
14 A&G Construction Store
15 Tody's Fish-o-Rama
16 McD's Jumpin' Livestock
17 Temporary Store
18 Temporary Store
19 Temporary Store
20 South Block Trade Store
21 Harbor Trade Station
22 Gift Exchange
23 Church Store
24 Research Center Exchange
25 Oaks' Handicrafts
26 McBurger
skills.json
This file is based on the existing Skill.json found in \Portia_Data\StreamingAssets\CccData\ (you could also just use that file's skills, or edit them to change existing weapon effects).
Simply put, these files let you tweak to a very great extent the animations, damage, sounds, and pretty much everything else about how a weapon's attack works. I've never had this much control over a game's weapons before :D
Sadly, it takes some work to figure out how to read them, and I'm wading in just like you are. Basically, there are JSON nodes for each weapon attack or "skill", each of which has a number id that you then add to the weapon's skillIds in weaponItems.json above. Multiple skills, separated by commas, allow for combos. Ordinary swords, for example, use a skillIds entry of "2,3,4,5", which allows you to perform the four different "skill" attacks in combo sequence. You can see which skills a weapon uses in the Props_total_table table in the database.
To create new attacks or "skills", you can copy and paste from the game's Skill.json file; just make sure you change the node's id value to a new and unique number that you can reference in your weapon's skillIds.
Notes on skills.json entries:
- totalTime is I think the time it takes for the entire attack to play (use as speed, I think)
- Each attack has a Cmd node that is an array of subnode commands that appear to fire in order. Some are animations, some are sounds, some cause damage, etc.
- FilterCmd is I think used to filter out who gets affected - RegionFilter is the weapon's hitbox I think.
- EffectCmd does damage, I think
- executeFactor is I think the relative amount of time a command takes
I really haven't tested all this out, you can tweak the variables and see what they do yourself. If you make a cool weapon, feel free to post it as a comment!
7 comments
Also, it seems like using a storeID value above 21 causes the game to crash on load with an out of bounds error, and, while the item shows up in the expected shop, the flavor text says it came from a different shop. For example, I used 5 initially and the weapon showed up in Total Tools, but when I looked at the weapon info it said it came from Martha's Bakery. I haven't tried any of the other values on where the item shows up, but 10 makes it say that it came from the Church Store, 19 Research Center Exchange, and 21 McBurger. Not sure if it's something you can fix, but something I just kind of noticed.
I do have a question though, as I've attempted to make a custom weapon by just copying the entries provided in the tutorial and simply changing the model of the item (just to see if it works before tweaking) and it never seems to show up anywhere. I always have it set to show up in the Farm Store, as I've set to have all of the weapons from the mod show up there. Any idea what could be going on there? Never tried modding that required this much effort before and any info is appreciated.
I can't build a new and improved Triple Snakebite if I don't know what the filepath for the models/skills are. I've been trying to crack open the Unity assets but I haven't made any real progress. You made a dang impressive weapon with the chainsaw model and attacks, any help doing something similar would be great, thanks!