Micah Holmes Posted January 12 Report Posted January 12 I need to add some new foes for drifters etc to attack. currently they only attack back when provoked. I need the drifters to attack them like they would players. [ { file: "game:entities/lore/drifter", op: "add", path: "/server/behaviors/8/aitasks/1/*-normal/-", value: { "locust-crafted" } } ] New Foe: { code: "craftsmanship:locust", class: "EntityLocust", tags: ["mechanical", "habitat-land"], variantgroups: [ { code: "type", states: ["crafted" ] } ] , weight: 90, canClimb: true, canClimbAnywhere: true, climbTouchDistance: 0.1, rotateModelOnClimb: true, fallDamageMultiplier: 0.0, hitboxSize: { x: 0.65, y: 0.6 }, deadHitboxSize: { x: 0.65, y: 0.5 }, eyeHeight: 0.3, attributes: { spawnDamageParticles: true, isMechanical: true }, client: { renderer: "Shape", shape: { base: "game:entity/lore/locust/locust-bronze" }, textures: { "skin":{ base: "game:entity/lore/locust/bronze" } }, size: 1.2, glowLevelByType: { "*-crafted": 16 }, behaviors: [ { code: "repulseagents" }, { code: "controlledphysics", stepHeight: 1.1251 }, { code: "floatupwhenstuck", onlyWhenDead: true }, { code: "interpolateposition" } ], animations: [ { code: "hurt", animation: "hurt", animationSpeed: 2.2, weight: 5, blendMode: "AddAverage" }, { code: "die", animation: "die", animationSpeed: 1.25, weight: 10, blendMode: "Average", triggeredBy: { onControls: ["dead"] } }, { code: "idle", animation: "idlecalm", blendMode: "Average", triggeredBy: { defaultAnim: true }, } ] }, server: { behaviors: [ { code: "repulseagents" }, { code: "controlledphysics", stepHeight: 1.1251 }, { code: "health", currenthealthByType: { "*-crafted": 15 }, maxhealthByType: { "*-crafted": 15 } }, { code: "deaddecay", hoursToDecay: 24 }, { code: "floatupwhenstuck", onlyWhenDead: true }, { code: "emotionstates", states: [ { code: "fleeondamage", duration: 10, chance: 0.2, slot: 0, priority: 1, accumType: "max" }, { code: "aggressiveondamage", duration: 30, chance: 1, slot: 0, priority: 0.5, accumType: "noaccum" }, ] }, { code: "taskai", aitasks: [ { code: "meleeattack", entityCodes: ["drifter-normal", "drifter-deep", "drifter-corrupt", "drifter-corrupt", "shiver-deep", "bowtorn-deep", "locust-bronze", "locust-corrupt" ], priority: 3, damageByType: { "*-crafted": 6 }, damageTierByType: { "*-crafted": 2 }, mincooldown: 1500, maxcooldown: 1500, damageTypeByType: { "*-crafted": "PiercingAttack" }, damagePlayerAtMs: 500, attackDurationMs: 800, animation: "attack", animationSpeed: 1.8, soundStartMs: 1000 }, { code: "stayclosetoentity", priority: 3, entityCode: "player", movespeed: 0.08, maxDistance: 7, onlyIfLowerId: true, searchRange: 12, animation: "run", animationSpeed: 6.5 }, { code: "seekentity", entityCodes: ["drifter-normal", "drifter-deep", "drifter-corrupt", "drifter-corrupt", "shiver-deep", "bowtorn-deep", "locust-corrupt" ], priority: 1.5, mincooldown: 500, maxcooldown: 1000, movespeed: 0.025, seekingRange: 15, maxFollowTime: 20, animationSpeed: 7, alarmHerd: true, leapAtTarget: true, leapAnimation: "jump", animation: "rundrill" }, { code: "wander", priority: 1.3, priorityForCancel: 1.3, movespeed: 0.016, animationSpeed: 4, animation: "run", maxDistanceToSpawn: 4 }, { code: "idle", priority: 1.2, priorityForCancel: 1.35, minduration: 10000, maxduration: 30000, mincooldown: 30000, maxcooldown: 60000, animation: "sleep", animationSpeed: 1.75 }, { code: "idle", priority: 1.2, priorityForCancel: 1.35, minduration: 2500, maxduration: 2500, mincooldown: 6000, maxcooldown: 20000, animation: "lookleft", animationSpeed: 1.25 }, { code: "idle", priority: 1.2, priorityForCancel: 1.35, minduration: 2500, maxduration: 2500, mincooldown: 6000, maxcooldown: 20000, animation: "lookright", animationSpeed: 1.25 }, { code: "idle", priority: 1.2, priorityForCancel: 1.35, minduration: 2500, maxduration: 2500, mincooldown: 6000, maxcooldown: 20000, animation: "idletwitch", animationSpeed: 1.25 }, { code: "idle", priority: 1.2, priorityForCancel: 1.25, minduration: 2500, maxduration: 2500, mincooldown: 6000, maxcooldown: 20000, animation: "idlecalm", animationSpeed: 1.25 }, { code: "wander", priority: 1.1, priorityForCancel: 1.22, movespeed: 0.006, animationSpeed: 1.8, animation: "run", preferredLightLevel: 7 }, { code: "wander", priority: 1.1, priorityForCancel: 1.1, movespeed: 0.001, animationSpeed: 1.5, animation: "walk", preferredLightLevel: 7 } ] }, { code: "entitystatetags" } ], }, sounds: { hurt: "game:creature/locust/hurt", death: "game:creature/locust/death", idle: "game:creature/locust/idle" }, idleSoundChance: 0.05 }
Micah Holmes Posted January 12 Author Report Posted January 12 Update: Tried this but not working: [ { file: "game:entities/lore/drifter", op: "add", path: "/server/behaviors/8/aitasks/0/", value: { entityCodes: "locust-crafted" } }, { file: "game:entities/lore/drifter", op: "add", path: "/server/behaviors/8/aitasks/1/", value: { entityCodes: "locust-crafted" } }, { file: "game:entities/lore/drifter", op: "add", path: "/server/behaviors/8/aitasks/2/", value: { entityCodes: "locust-crafted" } }, { file: "game:entities/lore/drifter", op: "add", path: "/server/behaviors/8/aitasks/3/", value: { entityCodes: "locust-crafted" } }, { file: "game:entities/lore/drifter", op: "add", path: "/server/behaviors/8/aitasks/4/", value: { entityCodes: "locust-crafted" } } ] I got an error when i tried to use *-normal saying I could not do it by type. but this does not seem to work we as well.
Micah Holmes Posted January 12 Author Report Posted January 12 (edited) Forgot about the Mod Maker utility. Here is the code for the solution: [ { "op": "add", "path": "/server/behaviors/8/aitasks/0/entityCodes/1", "value": "craftsmanship:locust-crafted", "file": "game:entities/lore/drifter.json", "side": "Server" }, { "op": "add", "path": "/server/behaviors/8/aitasks/1/entityCodes/1", "value": "craftsmanship:locust-crafted", "file": "game:entities/lore/drifter.json", "side": "Server" }, { "op": "add", "path": "/server/behaviors/8/aitasks/2/entityCodes/1", "value": "craftsmanship:locust-crafted", "file": "game:entities/lore/drifter.json", "side": "Server" }, { "op": "add", "path": "/server/behaviors/8/aitasks/3/entityCodes/1", "value": "craftsmanship:locust-crafted", "file": "game:entities/lore/drifter.json", "side": "Server" }, { "op": "add", "path": "/server/behaviors/8/aitasks/4/entityCodes/1", "value": "craftsmanship:locust-crafted", "file": "game:entities/lore/drifter.json", "side": "Server" } ] Update: I thought this was the answer but I guess I need to adjust further Edited January 12 by Micah Holmes
Recommended Posts