Jump to content

Recommended Posts

Posted (edited)

I've never messed with animations before, so Im a bit new to this part of the code. I have no issues via code but when I fire the bow, I get a missing texture for the animation.

bow code:

{
	code: "crudebow",
	tags: ["weapon", "weapon-ranged"],
	variantgroups: [
		{ code: "type", states: ["apprentice", "journeyman", "artisan", "master", "grandmaster" ] },
        { code: "wood", states: ["baldcypress", "pine" ] }
	],
	class: "ItemBow",
	maxstacksize: 1,
	durabilityByType: {
		"crudebow-apprentice-*": 100,
		"crudebow-journeyman-*": 150,
		"crudebow-artisan-*": 210,
		"crudebow-master-*": 300,
		"crudebow-grandmaster-*": 350
	},
	shape: {
		base: "weapons/bow/crude/crude",
		alternates: [
			{ base: "item/tool/bow/{wood}-charge1" },
			{ base: "item/tool/bow/{wood}-charge2" },
			{ base: "item/tool/bow/{wood}-charge3" }
		]
	},
    texturesByType: 
    {
		"*-baldcypress": {
			"maple": { "base": "game:block/wood/debarked/{wood}" },
            "flint": { "base": "game:block/stone/flint" },
            "normal-westeast": { "base": "game:item/resource/ropeold" }
		},
		"*-pine": {
			"maple": { "base": "game:block/wood/debarked/{wood}" },
            "flint": { "base": "game:block/stone/flint" },
            "normal-westeast": { "base": "game:item/resource/ropeold" }
		}     
	},
	tool: "bow",
	creativeinventory: { "general": ["*"], "items": ["*"], "tools": ["*"] },
	attributes: {
		heldItemPitchFollow: 1,
		aimAnimationByType: { "*": "bowaim" },
		damageByType: {
            "crudebow-apprentice": 2.25,
            "crudebow-journeyman": 2.5,
            "crudebow-artisan": 2.75,
            "crudebow-master": 3,
            "crudebow-grandmaster": 3.25
		},
		damageTierByType: {
            "crudebow-apprentice": 0,
            "crudebow-journeyman": 0,
            "crudebow-artisan": 0,
            "crudebow-master": 0,
            "crudebow-grandmaster": 0
		},
		statModifierByType: {
            "crudebow-apprentice": { "rangedWeaponsAcc": -0.1 },
            "crudebow-journeyman": { "rangedWeaponsAcc": -0.05 },
            "crudebow-artisan": { "rangedWeaponsAcc": 0 },
            "crudebow-master": { "rangedWeaponsAcc": 0.1 },
            "crudebow-grandmaster": { "rangedWeaponsAcc": 0.2 }
		},
		toolrackTransformByType: {
			"crudebow-*": {
				translation: { x: 0.14, y: 0.93 },
				rotation: { x: 2, y: 5, z: 0 },
				scale: 1.76
			}
		},
			groundStorageTransformByType: {
			"crudebow-*":{
				translation: { x: -0.4, y: -0.11, z: 0.345 },
				rotation: { x: 26, y: -180, z: -90 }
			}
		}
	},
	attributesByType: {
		"crudebow-*": {
			attachableToEntity: {
				categoryCode: "bowshort",
				attachedShapeBySlotCode: {
					"frontrightside": { base: "game:item/wearable/hooved/elk/weaponr-bow-crude" },
					"frontleftside": { base: "game:item/wearable/hooved/elk/weaponl-bow-crude" }
				}
			}				
		}
	},
	behaviors: [{ 
		name: "GroundStorable",
		properties: {
			layout: 'WallHalves',
			wallOffYByType: {
				"crudebow-*": 1
			},
			ctrlKey: true,
			selectionBox: { x1: 0, y1: 0, z1: 0, x2: 1, y2: 0.1, z2: 1 },
			collisionBox: { x1: 0, y1: 0, z1: 0, x2: 0, y2: 0, z2: 0 },
		}
	}],
	fpHandTransformByType: {
		"crudebow-*": {
			translation: { x: 0, y: 0.5, z: 0 },
			rotation: { x: 4, y: 1, z: 84 },
			origin: { x: 0.5, y: 0, z: 0.5 },
			scale: 2.91
		}
	},
	guiTransformByType: {
		"crudebow-*": {
			translation: { x: 0, y: 0, z: 0 },
			rotation: { x: -95, y: 45, z: 37 },
			origin: { x: 0.47, y: 0, z: 0.55 },
			scale: 2.35
		}
	},
	groundTransform: {
		translation: { x: 0, y: 0, z: 0 },
		rotation: { x: 0, y: 0, z: 0 },
		origin: { x: 0.5, y: 0, z: 0.5 },
		scale: 4.8
	},
	tpHandTransformByType: {
		"crudebow-*": {
			translation: { x: -0.48, y: 0, z: -0.44 },
			rotation: { x: 107, y: 11, z: 10 },
			origin: { x: 0.5, y: 0, z: 0.5 },
			scale: 1.15
		}
	}
}

I'm pretty sure my issue is likely within the shapes them selves. I altered them first but then reverted them all back to original game scripts. FYI the idea here is the better material you use to construct your bow, the better it will perform. Anyway here is what the animation looks like currently:

image.thumb.png.f24cba8215d27bfb925a064ecdf5c510.png

 

Edited by Micah Holmes
Posted (edited)

Tried this but crashes game:

 texturesByType: 
    {
		"*-baldcypress": {
			"maple": { "all":{ "base": "game:block/wood/debarked/{wood}" } },
            "flint": { "all":{ "base": "game:block/stone/flint" } },
            "normal-westeast": { "all":{ "base": "game:item/resource/ropeold" } }
		},
		"*-pine": {
			"maple": { "all":{ "base": "game:block/wood/debarked/{wood}" }},
            "flint": { "all":{ "base": "game:block/stone/flint" }},
            "normal-westeast": { "all":{ "base": "game:item/resource/ropeold" }}
		}     
	},

 

Tried this crashes

 texturesByType: 
    {
		"*-baldcypress": {
			"maple": { 
				base: "game:block/wood/debarked/{wood}",
				alternates: [{base: "game:block/wood/debarked/{wood}" }, {base: "game:block/wood/debarked/{wood}" }, {base: "game:block/wood/debarked/{wood}" } ]
			},
			"flint": { 
				base: "game:block/stone/flint",
				alternates: [{base: "game:block/stone/flint" }, {base: "game:block/stone/flint" }, {base: "game:block/stone/flint" } ]
			},
			"normal-westeast": { 
				base: "game:item/resource/ropeold",
				alternates: [{base: "game:item/resource/ropeold" }, {base: "game:item/resource/ropeold" }, {base: "game:item/resource/ropeold" } ]
			}
		},
		"*-pine": {
			"maple": { "all":{ "base": "game:block/wood/debarked/{wood}" }},
            "flint": { "all":{ "base": "game:block/stone/flint" }},
            "normal-westeast": { "all":{ "base": "game:item/resource/ropeold" }}
		}     
	},

 

Crashes

 texturesByType: 
    {
		"*-baldcypress": {
			"all": {
				"maple": { "base": "game:block/wood/debarked/{wood}" },
            	"flint": { "base": "game:block/stone/flint" },
            	"normal-westeast": { "base": "game:item/resource/ropeold" }
			}
		},
		"*-pine": {
			"all": {
				"maple": { "base": "game:block/wood/debarked/{wood}" },
            	"flint": { "base": "game:block/stone/flint" },
            	"normal-westeast": { "base": "game:item/resource/ropeold" }
			}
		}     
	},

 

Edited by Micah Holmes
  • Solution
Posted

It looks like the whole shape for the bow is missing. Try adding "game:" prefix to all the shape references:

20 hours ago, Micah Holmes said:
	shape: {
		base: "game:weapons/bow/crude/crude",
		alternates: [
			{ base: "game:item/tool/bow/{wood}-charge1" },
			{ base: "game:item/tool/bow/{wood}-charge2" },
			{ base: "game:item/tool/bow/{wood}-charge3" }
		]
	},

 

 

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.