MelanieMelicious-NPC_API_MelanieMelicious icon

NPC API MelanieMelicious

WIKI SOON. An API for setting up interactive NPCs with dialogue, stores, quests, unlockable dialogue, and built-in save system! Can be built solely in-editor, but also can be edited with code. Find me in Lethal Company Modding Discord.

CHANGELOG

1.0.3

  • Added "Add To Quota" bool option for trade items in shop nodes.
  • Made shop node less unnecessarily convoluted for user-end in syncing items and item values. Also better for modifying shops in code (should anybody choose to do that).

1.0.2

  • Added NPC save state for GameObjects turning active, or spawning (depending on referenced prefab type). Example use cases, doing more quests making more objects appear around the NPC.
  • Added optional NPC Node specifically for GameObject save states (still includes a bool for adding node to save list). NPCs should still work without these.
  • Added optional animator reference components for running animations when talking, and when no longer talking to an NPC. Currently hard-coded to "Talk" and "Idle" animator states, when entering and exiting chat box.
  • Fixed bug of sell shop showing empty elements based on number of trade shop elements visible.

1.0.1

  • Fixed an issue casued by sync re-order.

1.0.0

  • Initial release!
  • Added NPC script with public welcome trigger (to begin interacting with NPC). Typically just use an interact trigger, but you CAN activate it using something else. Also includes NPC name for chatbox, welcome message for initial interaction, and scrap spawn position for shops (FKKK I NEED TO ADD NATIVE OPTION FOR SPAWNING SCRAP BESIDES JUST FROM SHOP, but later). NPC script can be placed on ANYTHING, items, furniture, map objects, enemies, etc. Just know, if you place this on vanilla thumper for some reason, it will still attack you, BUT... you can talk to it!
  • Added NPC chat node scriptable object. Includes NPC display text (what the NPC says when this node is active), response select text (your response in other chat nodes, that lead to this chat node), a list where you add response options (0 response options closes chat box when selecting this node), locked options based on indexes in response list, if this specific node has saveable interactions, if this node opens a shop instead of dialogue (and which shop), a list of quests that will allow them to be instructed, progressed, and completed here, and the ability to trigger unity events when activating this node. Save data key (for saveable chat nodes) depends on .asset name.
  • Added NPC shop node scriptable object. Includes options to allow players to buy items for set amount of credits, sell items for their value (alongside any multiplier to this), if selling here contributes to quota, trades to turn in one item in exchange for another, and item lists for buying, selling, or trading items, either referenced directly, or by name (for third-party or vanilla items).
  • Added NPC quest node scriptable object. Includes list of conditions to consider this quest complete, ability to progress conditions via unity event and condition index, OPTIONAL item (or item name) to check held player object to show "progress option" dialogue, ability to run unity event when completed, dialogue for unfinished quest, progression opportunity, and completion message, and a bool for when completed quest has been claimed (example, after completing a quest, and claiming a reward at an NPC). Save data key depends on .asset name.
  • Usable unity events include: LockDialogue(index), and UnlockDialogue(index) for Chat Nodes, Progress(index), DespawnHeld(), and ClaimQuest(claim) for Quest Nodes, and Welcome() for NPC script.
  • WILL ADD A WIKI FOR MORE DETAILED INSTRUCTIONS, SOON!