Results 1 to 5 of 5

Thread: Custom Tool Stats

  1. #1

    Custom Tool Stats

    Recently, I programmed a mod that made it so that you can break heavier stones into lighter stones. This was to make more of a purpose for heavier stones. The idea was that you would get 2 of the lighter stone, making it more efficient to mine deeper and a reason to mine heavier stones. Now I was programming it to have more stone pickaxes of every stone strength for another reason. I changed the normal pickaxe recipe to not have any other stones. I then added a tool stat and a weapon stat for the compact stone pickaxe as well as the tool and id and the recipe. With this code right now, it didn't work. The problem is that if I reference the custom tool stat "CompactStonePickaxeStats", it freezes up if you click on the item in the crafting it. If I change that reference to the same one as before "StonePickaxeStats" in the tool declaration (the one with the id), then it works just fine, just without the increase in speed that I specified.

    	"CompactStonePickaxeStats": {
    		"Type": "ToolStats",
    		"Data": {
    			"ToolCategories": [
    			"Age": 1,
    			"Level": 2,
    			"DigMineRadius": 0.375,
    			"BaseTime": 0.72
    	"CompactStonePickaxeStats": {
    		"Type": "WeaponStats",
    		"Data": {
    			"Durability": 200,
    			"TypeName": "Melee",
    			"AtkRange": 1.0,
    			"HitTime": 0.25,
    			"MinDamage": 28,
    			"MaxDamage": 37,
    			"AttackSpeed": 1.0,
    			"AttackSpeedCategory": "OneHanded",
    			"EnchantingSlots": 1,
    			"EnchantingBonus": 0.15
    	"CompactStonePickaxe": {
    		"Type": "Tool",
    		"Data": {
    			"ID": "21729100",
    			"Name": "strCompactStonePickaxeName",
    			"Description": "strSimplePickaxeDesc",
    			"Category": "str1-HandName",
    			"Sprite": "StonePickaxeSprite",
    			"ToolStats": "CompactStonePickaxeStats",
    			"WeaponStats": "CompactStonePickaxeStats",
    			"EquipableResource": "Pickaxe"
    	"CompactStonePickaxeRecipe": {
    		"Type": "Recipe",
    		"Data": {
    			"CreatedTool": "CompactStonePickaxe",
    			"Age": "1.1",
    			"SortOrder": 1,
    			"CraftTime": 1.0,
    			"Quantity": 1,
    			"RecipeCost": [
    					"Components": [
    					"Count": 18
    					"Components": [
    					"Count": 6
    					"Components": [
    					"Count": 10
    			"Categories": [
    I have found the point of error as being the reference to custom tool stats, but I don't know why. If it is in my code, tell me. Otherwise, I think it is a bug. Thank you.

  2. #2
    Hi again Robert, I think you've spotted a bug here. I've created a Mod on my PC with that json data and it's not working for me either. I just wanted to let you know I'm working on it but it's pretty late here so it'll probably be next week before I know what's happening. I'll let you know once I know anyway!


  3. #3
    Any updates please Bri?

  4. #4
    Hi GeGeek, sorry I was so slow getting back to you on this, just found it on my to-do list :P

    So, this isn't actually a bug, it's more to do with how json files work. Or should I say how our json parser works. There are two entries with the key "CompactStonePickaxeStats" but the json parser can only handle one of each key so it is only reading one of those values. If those two items were in different files it would work or if they had different keys like "CompactStonePickaxeToolStats" and "CompactStonePickaxeWeaponStats" then it would work.

    Hope that makes sense

  5. #5
    Thank you Bri, I will try that out and see if it works.

Tags for this Thread

Posting Permissions

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