Files
SurvivorCore/docs/content-authoring.md
T
Samuel LisonandClaude Opus 4.8 9951e09a3f feat: hunting/butchering + death loot bags (#13, #19)
Hunting & butchering (#13): mob defs gain flat carcass fields (carcassItem/Hp/
Tool/YieldMin/Max/Seconds); a slain mob leaves a butcherable CARCASS that is a
tagged Gatherable — the whole harvesting pipeline (tool gate, per-hit yields,
HP bar, gather:* hooks, progression counters) is reused as the butcher flow.
Carcass looks come from SurvivorCoreContent.Carcasses.<mobType>; reactions key
on "<mobType>_carcass"; fields editable in the admin Mobs editor. Gatherable
gains generic PromptText/PromptObject attributes.

Death loot bags (#19, TCE port): dying drops inventory AND worn equipment
(config-toggleable) into an anchored ground-clamped bag — IntValue contents,
instant-loot prompt for anyone, floating countdown, owner-only beacon, death
toast, LifetimeSeconds despawn. Pickup is loss-proof: equipment restores to
empty slots first (satchel re-grows capacity before stacks), the rest grants
up-to-fit and the remainder stays bagged. New player:died lifecycle → deaths
counters via Progression; lootbag:dropped/collected hooks; TCE respawn camera
fix. New Inventory APIs: getEquipment, clearAll (capacity-safe order), addUpTo,
restoreEquip.

Fixed: ToolEquip forces CanBeDropped=false on cloned creator templates.

Demo: stone_knife + raw_meat (risky raw: Hunger -25, Poison +8), boar carcass,
multi-objective hunt_boar quest, hunter/butcher/hard_way achievements. Docs:
mobs.md butchering section + loot-bags.md; CHANGELOG; site card copy.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-06 14:05:22 +10:00

6.6 KiB
Raw Blame History

No-code content authoring

📹 Demos: creating quests & achievements · creating mobs, weapons & ammo · creating an item + gatherable

The engine ships zero items, resources, or recipes — your game supplies them. You can do this two ways, and they coexist:

  1. From codeSurvivorCore.Items.register{…}, SurvivorCore.Resources.register{…}, SurvivorCore.Recipes.register{…} before start() (see the demo Boot.server.luau).
  2. No-code, as instances — author content in the place and the engine loads it at start(). The admin plugin's Content widget writes exactly this for you.

The SurvivorCoreContent folder

At start(), the engine reads ReplicatedStorage.SurvivorCoreContent and registers any defs found:

ReplicatedStorage
└─ SurvivorCoreContent
   ├─ Items      (Folder)
   │  └─ berry   (Configuration)   ← child Name = item id
   │     • name = "Wild Berries"        ← attributes = def fields
   │     • stack = 20
   │     • weight = 0.05
   │     • category = "consumable"
   ├─ Weapons    (Folder)        ← items with category="weapon" (loaded into the Items registry)
   │  └─ wood_club (Configuration)
   │     • category = "weapon"
   │     • toolType = "club"          (lets the hotbar equip it)
   │     • weaponKind = "melee"       ("melee" | "bow")
   │     • weaponDamage = 20
   ├─ Arrows     (Folder)        ← items with category="ammo" (loaded into the Items registry)
   │  └─ heavy_arrow (Configuration)
   │     • category = "ammo"
   │     • ammoDamage = 1.4           (× the bow's damage)
   │     • ammoDrop = 2               (× gravity = the curve)
   │     • ammoRange = 140
   ├─ Resources  (Folder)
   │  └─ berry_bush (Configuration)
   │     • item = "berry"
   │     • hp = 4
   │     • requireTool = ""    (blank = bare-hand)
   │     • yieldMin = 1
   │     • yieldMax = 3
   ├─ Mobs       (Folder)
   │  └─ husk (Configuration)
   │     • faction = "hostile"        ("hostile" | "passive" | "neutral")
   │     • health = 60
   │     • aggroRange = 40
   │     • carcassItem = "raw_meat"   (hunting: blank = no carcass; see docs/mobs.md)
   │     • carcassTool = "knife"
   ├─ Quests     (Folder)        ← flat single-objective quests (normalized at load)
   │  └─ gather_reeds (Configuration)
   │     • name = "Gather Reeds"
   │     • objectiveType = "gather"   ("gather" | "craft" | "kill" | "use")
   │     • objectiveTarget = "reed"
   │     • objectiveCount = 3
   │     • rewardItem = "berry"
   │     • rewardCount = 2
   │     • autoStart = true
   ├─ Achievements (Folder)      ← flat counter + threshold defs
   │  └─ husk_slayer (Configuration)
   │     • name = "Husk Slayer"
   │     • counter = "kills_husk"     (see docs/achievements.md for the counter catalogue)
   │     • threshold = 3
   ├─ Tools      (Folder)        ← Tool templates the hotbar equips (named by item id)
   ├─ MobModels  (Folder)        ← rigged mob templates Mobs.spawn clones (named by mob id)
   ├─ Carcasses  (Folder)        ← carcass models spawned on mob death (named by mob id)
   └─ LootBag    (Model/Part)    ← the death loot-bag look (optional; placeholder otherwise)

Each child's Name is the id; its attributes are the def fields (Registry.loadFromFolder copies them verbatim). This is the same instance-config pattern the survival stats use.

The admin plugin Content widget

Open Studio → the SurvivorCore toolbar → Content. Seven builders:

  • Items — create an item by id, then set Name / Max stack / Weight / Category / Tool type / Icon / Description.
  • Weapons — create a weapon by id, then set Kind (melee/bow) / Damage / Range / Cooldown, plus bow Draw time / Arrow speed / Max range / Ammo item. (Weapons are items with category = "weapon"; they live in their own folder so this editor never collides with the Items editor.) + Tool model drops a starter Tool (a Handle carrying the weapon's ToolType/WeaponKind) into the world so you can build the held look on it; move the finished Tool under SurvivorCoreContent.Tools (named by the weapon id) and the hotbar clones it when the weapon is equipped.
  • Arrows / Ammo — create an arrow type by id, then set Damage × / Drop (curve) × / Max range / Speed × / Carry weight. A bow's Ammo item points at one of these. (Arrows are items with category = "ammo", in their own folder — see combat.md.)
  • Gatherables — create a resource by id, then set Yields item / HP (gathers) / Tool required / Yield min / Yield max. + Add to World drops a tagged Gatherable node.
  • Mobs — create a mob type by id, then set Faction / Health / Speeds / Aggro / Leash / Attack. + Add to World drops a tagged Mob placeholder rig (swap in your own model later).
  • Quests — create a quest by id, then set Name / Description / Objective (type, target, count) / Reward (item, count) / Auto-start / Requires / Turn in. + Quest giver drops a tagged QuestGiver post offering it (see quests.md). Multi-objective chains stay code-authored, like recipes.
  • Achievements — create an achievement by key, then set Name / Description / Counter / Threshold / Icon — counters are the engine's auto-derived progression counters (see achievements.md).

Each edit is one Studio undo step. Behind the scenes it creates/edits the SurvivorCoreContent instances above, so pressing Play registers your content with no code.

Binding a world object

A creator builds any mesh, tags it Gatherable (CollectionService), and sets a Resource attribute to a resource id (e.g. "berry_bush"). The node inherits item/HP/tool/yield from the def. See harvesting.md for the full attribute list and the per-type reaction hooks (shake / fell / etc.).

For creatures, tag a rigged Model (Humanoid + PrimaryPart) Mob and set MobType to a mob id (e.g. "husk"); it inherits faction/health/speed/ranges from the def. See mobs.md and combat.md.

Tools

For a tool item, set toolType (e.g. "axe") and category = "tool". To give it a custom look, place a Tool named by the item id under SurvivorCoreContent.Tools; otherwise the engine equips a plain default. Trees etc. require the matching RequireTool.