Results 1 to 2 of 2

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.

    Code:
    {
    	"CompactStonePickaxeStats": {
    		"Type": "ToolStats",
    		"Data": {
    			"ToolCategories": [
    				"Mine",
    				"CrystalMine"
    			],
    			"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": [
    						"CompactStoneResource",
    					],
    					"Count": 18
    				},
    				{
    					"Components": [
    						"OakWoodResource",
    						"SpruceWoodResource"
    					],
    					"Count": 6
    				},
    				{
    					"Components": [
    						"FiberResource"
    					],
    					"Count": 10
    				}
    			],
    			"Categories": [
    				"strTools"
    			]
    		}
    	}
    }
    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!

    Brian

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
  •