Jump to content

Recommended Posts

Posted

I made a new trader but its not visible in my creative list. I think I'm missing something:

 

{
	code: "craftsmanship:humanoid-trader-cultivation",
	class: "EntityTrader",
	tags: ["humanoid", "trader", "human", "habitat-land"],
	weight: 80,
	canClimb: true,
	hitboxSize: { x: 0.6, y: 1.75 },
	deadHitboxSize: { x: 0.75, y: 0.5 },
    behaviorConfigs: {
        nametag: {
            showtagonlywhentargeted: true,
            triggeredNameReveal: true,
            unrevealedDisplayName: "nametag-trader-unrevealedname"
        }
    },
	client: {
		renderer: "Shape",
		shape: { base: "game:entity/humanoid/trader" },
		texture: { base: "game:entity/humanoid/trader", alternates: [
            { base: "game:entity/humanoid/traderclothes/set1" },
            { base: "game:entity/humanoid/traderclothes/set2" },
            { base: "game:entity/humanoid/traderclothes/set3" },
            { base: "game:entity/humanoid/traderclothes/set4" },
            { base: "game:entity/humanoid/traderclothes/set5" }
        ] },
		behaviors: [
			{ code: "nametag" },
			{ code: "repulseagents" },
			{ code: "controlledphysics", stepHeight: 1.01 },
			{ code: "interpolateposition" },
            { code: "conversable", dialogue: "game:config/dialogue/trader" }
		],
		animations: [
			{
				code: "game:die",
				animation: "die",
				animationSpeed: 1.75,
				weight: 10,
				blendMode: "AddAverage"
			},
			{
				code: "game:hurt",
				animation: "hurt",
				animationSpeed: 2,
				blendMode: "AddAverage"
			},
            { code: "game:formal-walk", animation: "formal-walk", animationSpeed: 1.5 },
		]
	},
    attributes: {
        tradePropsFile: "config/tradelists/trader-cultivation",
        tradeProps: {
            money: { avg: 30, var: 10 },
        }
    },
	server: {
		attributes: {
			pathfinder: {
				minTurnAnglePerSec: 720,
				maxTurnAnglePerSec: 1440
			}
		},
		behaviors: [
			{ code: "nametag", "showtagonlywhentargeted": true, selectFromRandomName: ["Tidwy", "Wearda", "Eandhelm", "Freder", "Alric", "Vyncis", "Reda", "Hames"] },
			{ code: "repulseagents" },
			{ code: "controlledphysics", stepHeight: 1.01 },
			{ code: "reviveondeath", minHours: 24, maxHours: 72 },
			{ code: "health", currenthealth: 25, maxhealth: 25 },
			{
				code: "game:emotionstates",
				states: [
					{ code: "aggressiveondamage", duration: 6, chance: 0.6, slot: 0, priority: 2, accumType: "noaccum" },
					{ code: "fleeondamage", duration: 10, chance: 0.4, slot: 0, priority: 1, accumType: "max" }
				],
			},
			{
				code: "game:taskai",
				aitasks: [
					{
						code: "meleeattack",
						entityCodes: ["player"],
						priority: 2,
						damage: 5,
						mincooldown: 2500,
						maxcooldown: 3500,
						attackDurationMs: 900,
						damagePlayerAtMs: 300,
						animation: "Attack",
						animationSpeed: 2,
						whenInEmotionState: "aggressiveondamage",
					},
					{
						code: "seekentity",
						entityCodes: ["player"],
						priority: 1.5,
						mincooldown: 1000,
						maxcooldown: 1500,
						seekingRange: 20,
						movespeed: 0.035,
						animation: "Run",
						animationSpeed: 1.75,
						whenInEmotionState: "aggressiveondamage"
					},
					{
						code: "fleeentity",
						entityCodes: ["player"],
						priority: 1.5,
						movespeed: 0.035,
						seekingRange: 12,
						animation: "Run",
						animationSpeed: 1.75,
						whenInEmotionState: "fleeondamage"
					},
					{
						code: "idle",
						priority: 1.2,
						minduration: 2500,
						maxduration: 2500,
						mincooldown: 2000,
						maxcooldown: 10000,
						animation: "laugh"
					},
					{
						code: "idle",
						priority: 1.2,
						minduration: 2500,
						maxduration: 2500,
						mincooldown: 5000,
						maxcooldown: 30000,
						animation: "idle2"
					},
					{
						code: "wander",
						priority: 1.0,
						movespeed: 0.01,
						animation: "Walk",
						wanderChance: 0.005,
						maxDistanceToSpawn: 4,
						wanderRangeMin: 1,
						wanderRangeMax: 3
					},
					{
						code: "lookaround",
						priority: 0.5
					}
				]
			},
            { code: "game:conversable", dialogue: "game:config/dialogue/trader" },
			{ code: "entitystatetags" }
		],
	},
	sounds: {
	}
}

 

  • Solution
Posted

Traders are entities and what you see in the creative inventory are not entities, you need to create your own `creature` item/variant (the vintage story equivalent of a spawn egg), see `survival\itemtypes\creature.json`

×
×
  • 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.