Jump to content

Recommended Posts

Posted (edited)

I need to alter the core game drifters. I think I know roughly how to do this but I wanted to ask before I break stuff. I think I build a directory path: 

  • /assets/survival/entities/lore

Then add a file called "drifter" that is a modified version of the core game "drifter" file. Do I need to add my mod tag as well in the "code" name as well? I'm trying to make sure drifters will still spawn as normal just need to modify their drops. Is this correct way to modify them? 

 

Like this:

{
	code: "craftsmanship:drifter",
	class: "EntityDrifter",
	tags: ["rust-creature", "habitat-land"],
	variantgroups: [
		{ code: "type", states: ["normal", "deep", "tainted", "corrupt", "nightmare", "double-headed"]}
	],
	weight: 140,
	canClimb: true,
	hitboxSize: { x: 0.6, y: 1.3 },
	deadHitboxSize: { x: 0.6, y: 1 },
	eyeHeight: 1.3,
	attributes: {
		allowInDevastationArea: true,
		killedByInfoText: "deadcreature-vile",
		glitchAffected: true,
		glitchFlicker: true,
		reckless: true,
		extraSplashParticlesMul: 4,
		spawnCloserDuringLowStability: true,
		onDeathStabilityRecoveryByType: {
			"drifter-normal": 0.01,
			"drifter-deep": 0.015,
			"drifter-tainted": 0.02,
			"drifter-corrupt": 0.025,
			"drifter-nightmare": 0.3,
			"drifter-double-headed": 0.35,
		},

		// Configuration for crawling drifters
		oddsToAlter: 5, // chance to alter a drifter is one in this value
		dieAnimationCode: "die",
		alternativeDieAnimationCode: "crawldie",
		idleAnimationCode: "idle",
		alternativeIdleAnimationCode: "crawlidle",
		alternativeCollisionBox: [0.9, 0.6],
		alternativeCanClimb: false,
		animationsRemapping: {
			"idle": "crawlidle" ,
			"standwalk": "crawlwalk",
			"standlowwalk": "crawlwalk",
			"standrun": "crawlrun",
			"standidle": "crawlidle",
			"standdespair": "crawlemote",
			"standcry": "crawlemote",
			"standhurt": "crawlhurt",
			"standdie": "crawldie"
		}
	},
	drops: [],
	client: {
		renderer: "Shape",
		pitchStep: false,
		shapeByType: {
			"*-normal": { base: "game:entity/lore/drifter/surface" },
			"*-deep": { base: "game:entity/lore/drifter/surface" },
			
			"*-tainted": { base: "game:entity/lore/drifter/spiked1", alternates: [{ base: "game:entity/lore/drifter/spiked2" }] },
			"*-corrupt": { base: "game:entity/lore/drifter/deerhorn" },
			"*-nightmare": { base: "game:entity/lore/drifter/knife" },
			"*-double-headed": { base: "game:entity/lore/drifter/double-headed" },
		},
		texturesByType: {
			"*-normal": {
				"skin": { base: "game:entity/lore/drifter/surface1", alternates: [ { base: "game:entity/lore/drifter/surface2" }, {base: "game:entity/lore/drifter/surface3" }] },
			},
			"*-deep": {
				"skin": { base: "game:entity/lore/drifter/deep1", alternates: [ { base: "game:entity/lore/drifter/deep2" } ] },
			},
			"*-double-headed": {
				"skin": { base: "game:entity/lore/drifter/double" },
			}
		},
		behaviors: [
			{ code: "repulseagents" }, 
			{ code: "controlledphysics", stepHeight: 1.1251 }, 
			{ code: "floatupwhenstuck", onlyWhenDead: true },
			{ code: "interpolateposition" },
			{ code: "harvestable", duration: 2 }
		],
		animations: [
			{
				code: "hurt",
				animation: "standhurt", 
				animationSpeed: 2,
				weight: 10,
				blendMode: "AddAverage" 
			},
			{
				code: "die",
				animation: "standdie", 
				animationSpeed: 0.7,
				weight: 10,
				blendMode: "Average",
				triggeredBy: { onControls: ["dead"] }
			},
			{ 
				code: "idle",
				animation: "standidle",
				blendMode: "Average", 
				triggeredBy: { defaultAnim: true },
			},
			{
				code: "crawlhurt",
				animation: "crawlhurt", 
				animationSpeed: 2,
				weight: 10,
				blendMode: "AddAverage" 
			},
			{
				code: "crawldie",
				animation: "crawldie", 
				animationSpeed: 0.7,
				weight: 10,
				blendMode: "Average",
				triggeredBy: { onControls: ["dead"] }
			},
			{ 
				code: "crawlidle", 
				animation: "crawlidle",
				blendMode: "Average",
				weight: 0.1,
				easeoutSpeed: 10
			},
			{ 
				code: "standwalk", 
				animation: "standwalk",
				blendMode: "Average"
			},
			{ 
				code: "standrun", 
				animation: "standrun",
				blendMode: "Average"
			},
			{
				code: "crawlwalk", 
				animation: "crawlwalk",
				blendMode: "Average"
			},
			{
				code: "crawlrun", 
				animation: "crawlrun",
				blendMode: "Average"
			},
			{
				code: "crawlemote", 
				animation: "crawlemote"
			}
		]
	},
	server: {
		behaviors: [
			{ code: "repulseagents" }, 
			{ code: "controlledphysics", stepHeight: 1.1251 },
			{ code: "health", 
				currenthealthByType: {
					"*-normal": 12,
					"*-deep": 16,
					"*-tainted": 22,
					"*-corrupt": 30,
					"*-nightmare": 40,
					"*-double-headed": 54
				},
				maxhealthByType: {
					"*-normal": 12,
					"*-deep": 16,
					"*-tainted": 22,
					"*-corrupt": 30,
					"*-nightmare": 40,
					"*-double-headed": 54
				}
			},
			{ code: "deaddecay", hoursToDecay: 3 },
			{ code: "floatupwhenstuck", onlyWhenDead: true },
			{ code: "despawn", minPlayerDistance: 32, minSeconds: 30 },
			{ code: "despawn", minPlayerDistance: 64, minSeconds: 6 },
			{
				code: "emotionstates",
				states: [  {
						code: "fleeondamage", 
						duration: 10,
						chanceByType: {
							"*-normal": 0.15,
							"*-deep": 0.07,
							"*-tainted": 0.03,
							"*-corrupt": 0.015,
							"*-nightmare": 0.01,
							"*-double-headed": 0.01,
						},
						slot: 0, 
						priority: 1, 
						accumType: "max" 
					},
					{ code: "aggressiveondamage", duration: 30, chance: 1, slot: 0, priority: 0.5, accumType: "noaccum" },
				]
			},
			{
				code: "taskai",
				aitasks: [
					{
						code: "fleeentity",
						entityCodes: ["player"],
						priority: 3,
						movespeed: 0.018,
						seekingRange: 20,
						fleeingDistance: 64,
						fleeDurationMs: 9999999,
						minDayLightByType: {
							"*-normal": 0.925,
							"*-deep": 0.97,
							"*-tainted": 2,
							"*-corrupt": 2,
							"*-nightmare": 2,
							"*-double-headed": 2,
						},
						ignoreDeepDayLight: true,
						cancelOnHurt: true,
						executionChance: 0.003,
						animation: "standrun",
						animationSpeed: 1.3
					},
					{
						code: "fleeentity",
						entityCodes: ["player"],
						priority: 2.5,
						movespeed: 0.018,
						seekingRange: 12,
						cancelOnHurt: true,
						animation: "standrun",
						animationSpeed: 1.3,
						whenInEmotionState: "fleeondamage"
					},
					{
						code: "meleeattack",
						entityCodes: ["player"],
						priority: 2,
						damageByType: {
							"*-normal": 2.5,
							"*-deep": 4,
							"*-tainted": 8,
							"*-corrupt": 12,
							"*-nightmare": 20,
							"*-double-headed": 24
						},
						damageTierByType: {
							"*-normal": 0,
							"*-deep": 1,
							"*-tainted": 2,
							"*-corrupt": 3,
							"*-nightmare": 4,
							"*-double-headed": 4
						},
						damageTypeByType: {
							"*-corrupt": "SlashingAttack",
							"*-nightmare": "SlashingAttack",
							"*-double-headed": "SlashingAttack"
						},
						mincooldown: 500, 
						maxcooldown: 1750, 
						damagePlayerAtMs: 400,
						attackDurationMs: 1000,
						animation: "standattack",
						animationSpeed: 1.5,
						sound: "game:creature/drifter-hit",
						soundStartMs: 400
					},
					{
						code: "throwatentity",
						entityCodes: ["player"],
						priority: 1.5,
						priorityForCancel: 9,
						mincooldown: 1000, 
						maxcooldown: 10000, 
						durationMs: 1200,
						releaseAtMs: 700,
						yawInaccuracy: 0.33,
						seekingRange: 15,
						animationSpeed: 1.5,
						animation: "standthrowleft",
						projectileDamage: 1,
						projectileDamageTier: 0
					},
					{
						code: "seekentity",
						entityCodes: ["player"],
						priority: 1.5,
						mincooldown: 400, 
						maxcooldown: 800, 
						movespeed: 0.018,
						seekingRange: 20,
						animationSpeed: 1.3,
						animation: "standrun",
						sound: "game:creature/drifter-aggro"
					},
					{
						code: "idle",
						priority: 1.2,
						priorityForCancel: 1.35,
						minduration: 4000,
						maxduration: 6000,
						chance: 0.001,
						initialMinCoolDown: 2000,
						initialMaxCoolDown: 150000,
						mincooldown: 300000,
						maxcooldown: 10000000,
						animation: "standdespair",
						animationSpeed: 1.25
					},
					{
						code: "idle",
						priority: 1.2,
						priorityForCancel: 2.1,
						minduration: 4000,
						maxduration: 6000,
						chance: 0.001,
						initialMinCoolDown: 2000,
						initialMaxCoolDown: 150000,
						mincooldown: 300000,
						maxcooldown: 10000000,
						animation: "standcry",
						animationSpeed: 1
					},
					{
						code: "wander", 
						priority: 1.0, 
						movespeed: 0.01,
						animationSpeed: 1.2,
						animation: "standwalk",
						preferredLightLevel: 15
					},
					{
						code: "wander", 
						priority: 0.99,
						priorityForCancel: 1.1,
						movespeed: 0.008,
						animationSpeed: 1.1,
						animation: "standlowwalk",
						preferredLightLevel: 15
					},
					{
						code: "getoutofwater",
						priority: 1.4,
						movespeed: 0.015,
						animation: "standwalk",
						animationSpeed: 1.55
					},
					{ 
						code: "lookaround", 
						priority: 0.5
					}
				]
			},
			{ code: "harvestable", duration: 2, fixedweight: true, dropsByType: {
				"*-normal": [
					{
						type: "item",
						code: "game:gear-temporal",
						quantity: { avg: 0.02666, var: 0 }
					},
					{
						type: "item",
						code: "flaxfibers",
						quantity: { avg: 0.2, var: 0 }
					},
					{
						type: "item",
						code: "game:gear-rusty",
						dropModbyStat: "rustyGearDropRate",
						quantity: { avg: 0.01, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:scroll-identity-papyrus",
						quantity: { avg: 0.7, var: 0 }
					}
				],
				"*-deep": [
					{
						type: "item",
						code: "game:gear-temporal",
						quantity: { avg: 0.033325, var: 0 }
					},
					{
						type: "item",
						code: "game:gear-rusty",
						dropModbyStat: "rustyGearDropRate",
						quantity: { avg: 0.03, var: 0 }
					},
					{
						type: "item",
						code: "flaxfibers",
						quantity: { avg: 0.4, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:scroll-identity-papyrus",
						quantity: { avg: 0.9, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-bow-crude",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-bow-simple",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-bow-long",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-bow-recurve",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-club-generic-wood",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-chert",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-granite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-andesite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-basalt",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-obsidian",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-peridotite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-flint",
						quantity: { avg: 0.3, var: 0 }
					}
				],		
				"*-tainted": [
					{
						type: "item",
						code: "game:gear-temporal",
						quantity: { avg: 0.03999, var: 0 }
					},
					{
						type: "item",
						code: "game:gear-rusty",
						dropModbyStat: "rustyGearDropRate",
						quantity: { avg: 0.07, var: 0 }
					},
					{
						type: "item",
						code: "game:flaxfibers",
						quantity: { avg: 0.6, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:scroll-identity-papyrus",
						quantity: { avg: 2, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-bow-crude",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-bow-simple",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-bow-long",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-bow-recurve",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-club-generic-wood",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-chert",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-granite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-andesite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-basalt",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-obsidian",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-peridotite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-flint",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-granite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-andesite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-basalt",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-obsidian",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-peridotite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-chert",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-flint",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-copper",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-tinbronze",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-bismuthbronze",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-blackbronze",
						quantity: { avg: 0.3, var: 0 }
					}
				],
				"*-corrupt": [
					{
						type: "item",
						code: "game:gear-temporal",
						quantity: { avg: 0.046655, var: 0 }
					},
					{
						type: "item",
						code: "game:gear-rusty",
						dropModbyStat: "rustyGearDropRate",
						quantity: { avg: 0.1, var: 0 }
					},
					{
						type: "item",
						code: "flaxfibers",
						quantity: { avg: 0.8, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:scroll-identity-papyrus",
						quantity: { avg: 2, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-bow-crude",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-bow-simple",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-bow-long",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-bow-recurve",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-club-generic-wood",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-chert",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-granite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-andesite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-basalt",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-obsidian",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-peridotite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-flint",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-granite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-andesite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-basalt",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-obsidian",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-peridotite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-chert",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-flint",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-copper",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-tinbronze",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-bismuthbronze",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-blackbronze",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-chert",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-granite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-andesite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-basalt",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-obsidian",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-peridotite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-flint",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-copper",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-tinbronze",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-bismuthbronze",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-blackbronze",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-gold",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-silver",
						quantity: { avg: 0.3, var: 0 }
					}
				],
				"*-nightmare": [
					{
						type: "item",
						code: "game:gear-temporal",
						quantity: { avg: 0.05332, var: 0 }
					},
					{
						type: "item",
						code: "game:gear-rusty",
						dropModbyStat: "rustyGearDropRate",
						quantity: { avg: 0.2, var: 0 }
					},
					{
						type: "item",
						code: "flaxfibers",
						quantity: { avg: 1, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:scroll-identity-papyrus",
						quantity: { avg: 3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-bow-crude",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-bow-simple",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-bow-long",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-bow-recurve",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-club-generic-wood",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-chert",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-granite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-andesite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-basalt",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-obsidian",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-peridotite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-flint",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-granite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-andesite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-basalt",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-obsidian",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-peridotite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-chert",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-flint",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-copper",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-tinbronze",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-bismuthbronze",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-blackbronze",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-chert",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-granite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-andesite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-basalt",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-obsidian",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-peridotite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-flint",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-copper",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-tinbronze",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-bismuthbronze",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-blackbronze",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-gold",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-silver",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-saw-copper",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-saw-tinbronze",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-saw-bismuthbronze",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-saw-blackbronze",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-saw-gold",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-saw-silver",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-saw-iron",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-saw-meteoriciron",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-saw-steel",
						quantity: { avg: 0.3, var: 0 }
					}
				],
				"*-double-headed": [
					{
						type: "item",
						code: "game:gear-temporal",
						quantity: { avg: 1, var: 0.4 }
					},
					{
						type: "item",
						code: "game:gear-rusty",
						dropModbyStat: "rustyGearDropRate",
						quantity: { avg: 5, var: 2.5 }
					},
					{
						type: "item",
						code: "flaxfibers",
						quantity: { avg: 2, var: 0 }
					},
					{
						type: "item",
						code: "game:stackrandomizer-alljonas",
						quantity: { avg: 0.4, var: 0 }
					},

					{
						type: "item",
						code: "craftsmanship:scroll-identity-papyrus",
						quantity: { avg: 2, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-bow-crude",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-bow-simple",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-bow-long",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-bow-recurve",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-club-generic-wood",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-chert",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-granite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-andesite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-basalt",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-obsidian",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-peridotite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-knife-generic-flint",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-granite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-andesite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-basalt",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-obsidian",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-peridotite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-chert",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-flint",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-copper",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-tinbronze",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-bismuthbronze",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-spear-generic-blackbronze",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-chert",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-granite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-andesite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-basalt",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-obsidian",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-peridotite",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-flint",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-copper",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-tinbronze",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-bismuthbronze",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-blackbronze",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-gold",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-shovel-silver",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-saw-copper",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-saw-tinbronze",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-saw-bismuthbronze",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-saw-blackbronze",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-saw-gold",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-saw-silver",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-saw-iron",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-saw-meteoriciron",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-saw-steel",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-pickaxe-copper",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-pickaxe-tinbronze",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-pickaxe-bismuthbronze",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-pickaxe-blackbronze",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-pickaxe-gold",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-pickaxe-silver",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-pickaxe-iron",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-pickaxe-meteoriciron",
						quantity: { avg: 0.3, var: 0 }
					},
					{
						type: "item",
						code: "craftsmanship:unidentified-pickaxe-steel",
						quantity: { avg: 0.3, var: 0 }
					}
				],
				},
			},
			{ code: "ripharvestable" },
			{ code: "entitystatetags" }
		],
		spawnconditions: {
			runtime: {
				group: "hostile",
				maxQuantityByType: {
					"*-normal": 10,
					"*-deep": 4,
					"*-tainted": 3,
					"*-corrupt": 3,
					"*-nightmare": 3,
					"*-double-headed": 0
				},
				maxLightLevel: 7,
				chance: 0.1,
				lightLevelType: "OnlyBlockLight",
				groupSizeByType: {
					"*-normal": { dist: "invexp", avg: 1, var: 3 },
					"*": { dist: "uniform", avg: 1.5, var: 0.5 },
				},
				insideBlockCodes: ["air", "tallgrass-*", "loosestones-*"],
				minYByType: {
					"*-normal": 0.85,
					"*-deep": 0.22,
					"*-tainted": 0.1,
					"*-corrupt": 0,
					"*-nightmare": 0
				},
				maxYByType: {
					"*-normal": 2,
					"*-deep": 0.89,
					"*-tainted": 0.55,
					"*-corrupt": 0.35,
					"*-nightmare": 0.23
				}
			}
		}
	},
	idleSoundRange: 14,
	sounds: {
		hurt: "game:creature/drifter-hurt",
		death: "game:creature/drifter-death",
		idle: "game:creature/drifter-idle"
	}
}

The drifter will still spawn as normal correct and now drop the additional items?

Edited by Micah Holmes
Posted (edited)

You could do it in such a manner, however, it would have a huge downside. If you place the drifter file in "yourmod/assets/game/entities/lore" you would overwrite the Vanilla drifter. If the developers should ever decide to change the drifter, players using your mod would never experience those changes because the original file is overwritten. This could also cause problems with other mods modifying the drifter file.

You want to patch the original file instead: https://wiki.vintagestory.at/index.php/Modding:JSON_Patching This way the original file is not replaced, but modified only in the areas you chose to address.

You could utilise the ModMaker, which you can find in the installation directory, to create patches for you based on edited Vanilla files.

Edited by Brady_The
Posted (edited)

@Brady_The

not sure if this is right but for example:

[
    { file: "game:entities/lore/drifter", op: "add", path: "/drops/-", value: { 
		type: "item", 
		code: "game:stick", 
		quantity: { avg: 2, var: 1 } 
		}
	}
]

?

 

update:

tried it and this is not working so far:

[
    { file: "game:entities/lore/drifter", op: "add", path: "/harvestable/-", value: { 
		type: "item", 
		code: "craftsmanship:scroll-identity-papyrus", 
		quantity: { avg: 2, var: 1 } 
		}
	}
]

 

Update:

Tried this and still failed:

[
    { file: "game:entities/lore/drifter-normal", op: "add", path: "/harvestable/-", value: { 
		type: "item", 
		code: "craftsmanship:scroll-identity-papyrus", 
		quantity: { avg: 2, var: 1 } 
		}
	}
]

 

Edited by Micah Holmes
Posted
4 minutes ago, Micah Holmes said:

@Brady_The

not sure if this is right but for example:

[
    { file: "game:entities/lore/drifter", op: "add", path: "/drops/-", value: { 
		type: "item", 
		code: "game:stick", 
		quantity: { avg: 2, var: 1 } 
		}
	}
]

?

Drops are a bit different for entities. Those are handled on the server side. So you would have to address "/server/behaviors/9/dropsByType/*-normal/-" if, for example you would want to add drops to the normal drifter.

Because you are patching a game file you don't need to add the game domain in front of asset codes. 

Posted (edited)

What is the 9? I plan on doing it for all drifter types. Will the path remain the same for all drifters? 

 

@Brady_The

 

Updated code to this but still not working:

[
    { file: "game:entities/lore/drifter-normal", op: "add", path: "/server/behaviors/9/dropsByType/*-normal/-", value: { 
		type: "item", 
		code: "craftsmanship:scroll-identity-papyrus", 
		quantity: { avg: 2, var: 1 } 
		}
	}
]

Update:

tried this as well still not working:

[
    { file: "game:entities/lore/drifter", op: "add", path: "/server/behaviors/9/dropsByType/*-normal/-", value: { 
		type: "item", 
		code: "craftsmanship:scroll-identity-papyrus", 
		quantity: { avg: 2, var: 1 } 
		}
	}
]

 

update: @Brady_The

I counted 10 nested subs not 9 but this still did not work:

[
    { file: "game:entities/lore/drifter", op: "add", path: "/server/behaviors/10/dropsByType/*-normal/-", value: { 
		type: "item", 
		code: "craftsmanship:scroll-identity-papyrus", 
		quantity: { avg: 2, var: 1 } 
		}
	}
]

 

update:

I tried both 9 and 10 this way as well but still not working:

[
    { file: "game:entities/lore/drifter", op: "add", path: "/server/behaviors/9/dropsByType/drifter-normal/-", value: { 
		type: "item", 
		code: "craftsmanship:scroll-identity-papyrus", 
		quantity: { avg: 2, var: 1 } 
		}
	}
]

 

update:

Tried 9 and 10 this way as well still not droping:

[
    { file: "game:entities/lore/drifter", op: "add", path: "/server/behaviors/10/dropsByType/*-normal/-", value: { 
		type: "item", 
		code: "craftsmanship:scroll-identity-papyrus", 
		quantity: { avg: 2 } 
		}
	}
]

Making sure this part is correct: 

/.config/VintagestoryData/Mods/Craftsmanship/assets/craftsmanship/patch

 

I made a new folder in my existing mod Im currently working on called "Craftsmanship. Call the new folder patch and created a new Json file called "drifterpatch.json". This is where this code lives currently. Is everything correct so far?

Edited by Micah Holmes
Posted
15 minutes ago, Micah Holmes said:
[
    { file: "game:entities/lore/drifter", op: "add", path: "/server/behaviors/9/dropsByType/*-normal/-", value: { 
		type: "item", 
		code: "craftsmanship:scroll-identity-papyrus", 
		quantity: { avg: 2, var: 1 } 
		}
	}
]

That looks correct. How did you ascertain that the drop is not working?

Posted
8 minutes ago, Micah Holmes said:

@Brady_The

Spawned a drifter and harvested it but nothing dropped. It should drop at least 1 based on drop info. 

Make sure that you are using the correct asset type and code, and that the asset is available.

image.png.fc6d0bc0ce9e1cdea5e12ce113140337.png

 

Posted (edited)

@Brady_The

Here is the items code:

{
	code: "craftsmanship:scroll",
	maxstacksize: 64,
	attributes: {
		displaycaseable: true, 
		shelvable: true
	},
	variantgroups: [
		{ code: "type", states: ["identity"] },
		{ code: "material", states: ["papyrus"] }		
	],
	shape: { base: "lore/scroll-plain" },
	texturesByType: {
		"*papyrus": {
			"tie": { "base": "lore/tie-4" },
            "scroll": { "base": "lore/scroll-3" }
		}
	},
	creativeinventory: { "general": ["*"], "items": ["*"] },
    combustibleProps: {
		burnTemperature: 900,
		burnDuration: 10
	},
	materialDensity: 700,
	guiTransform: {
		translation: { x: 1, y: 0, z: 0 },
		rotation: { x: -80, y: -39, z: -180 },
		origin: { x: 0.5, y: 0.1, z: 0.5 },
		scale: 2.17
	},
	fpHandTransform: {
		translation: { x: 0, y: 0, z: 0 },
		rotation: { x: 4, y: 15, z: 0 },
		origin: { x: 0.5, y: 0.1, z: 0.5 },
		scale: 1.97
	},
	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: 2.7
	},
	tpHandTransform: {
		translation: { x: -0.73, y: -0.1, z: -0.67 },
		rotation: { x: -50, y: 27, z: -28 },
		origin: { x: 0.5, y: 0.1, z: 0.5 },
		scale: 0.75
	}
}

 

 

Update:

still getting nothing. I even tried with a stick:

[
    { file: "game:entities/lore/drifter", op: "add", path: "/server/behaviors/9/dropsByType/*-normal/-", value: { 
		type: "item", 
		code: "stick", 
		quantity: { avg: 2 } 
		}
	}
]

 

Edited by Micah Holmes
  • Solution
Posted (edited)

image.png.ce798b535d506af676171d2443a9101e.png

  

11 minutes ago, Micah Holmes said:

Update:

still getting nothing. I even tried with a stick:

Alright, now we are getting somewhere. Where is the patch file located? It should be in "craftsmanship\assets\craftsmanship\patches". Sub-folders in the patches folder are okay.

Also, test it without any extra mods to make sure that it is not some other mod messing with the drifter file.

Edited by Brady_The
Posted (edited)

I'll adjust my directory name and test again:

 

/VintagestoryData/Mods/Craftsmanship/assets/craftsmanship/patches

 

Update:

@Brady_The

Looks like "patches" is a keyword/key directory. Thank you for your help today. 

Edited by Micah Holmes
  • Like 1
×
×
  • 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.