My Time at Portia

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!

Article information

Added on

Edited on

Written by

aedenthorn

7 comments

  1. warlockadam999
    warlockadam999
    • member
    • 0 kudos
    Its a wonderful mod, thanks for making it. But I'm having issues with the animations. I made a weapon but when I use it, it doesn't show any animations but the damage is done. So is the animation part a problem from my side or does it have to do something with the mod?
    1. warlockadam999
      warlockadam999
      • member
      • 0 kudos
      Edit: No worries, figured it out. Once again thank you for the mod
  2. KyutaSyuko
    KyutaSyuko
    • premium
    • 0 kudos
    Seems like the intendType is for what the item's intended to do. For example, if I set the intendType to 2 and walk up to a tree it'll display the tree's health as if I'm holding an axe, and if you look in the database, different weapons/tools all have the same intendType: Ranged weapons 16, Axes 2, Pickaxes 11, Fishing Poles 8, etc. *edit* All the intends are in the database under Player_Intend

    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.
  3. LaviModzShit
    LaviModzShit
    • member
    • 0 kudos
    Just want to say thanks for this, and the tutorial. I really think the equipment variety could be so much more in this game (Just for flavor's sake).

    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.
    1. aedenthorn
      aedenthorn
      • premium
      • 1,244 kudos
      Most likely it can't find your file (though there may be other reasons). You shouldn't copy the entries to another file, you should edit the existing weaponItems.json file itself. If you did that, your json might have errors, or it could be a bug in the mod. If you visit my discord server we can try and work it out.
  4. Gunstling
    Gunstling
    • supporter
    • 1 kudos
    Thanks for putting this together, but you've kinda forgotten a critical step: the filepaths.

    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!
    1. aedenthorn
      aedenthorn
      • premium
      • 1,244 kudos
      I didn't forget them, as explained above, they are found in the database. Also, I don't think this mod will work with ranged weapons.