Unturned

Unturned

164 ratings
Workshop: NPCs
By Nelson Sexton
This guide explains how to create NPCs, quests and dialogue for Unturned.
   
Award
Favorite
Favorited
Unfavorite
Characters
To help speed up character creation you can press the "End" key in the appearance menu to copy your face, hair, beard and skin/hair color to the clipboard.

Data:
  • Type: NPC
  • ID: The character ID is used to spawn it into the game, and is represented as an unsigned 16 bit integer meaning the range [0, 65535]. It is recommended not to use a value less than 2,000 as those are reserved for official content.
  • Shirt: Worn clothing item ID.
  • Pants: Worn clothing item ID.
  • Hat: Worn clothing item ID.
  • Backpack: Worn clothing item ID.
  • Vest: Worn clothing item ID.
  • Mask: Worn clothing item ID.
  • Glasses: Worn clothing item ID.
  • Face: Index of face image.
  • Hair: Index of hair mesh.
  • Beard: Index of beard mesh.
  • Color_Skin: Hex format color e.g. #ffffff.
  • Color_Hair: Hex format color e.g. #ffffff.
  • Backward: Specified if character is left-handed.
  • Primary: Weapon parallel to the spine or in hands.
  • Secondary: Weapon on the hip, perpendicular to the spine or in hands.
  • Tertiary: Non-weapon item to equip.
  • Equipped: The "Primary", "Secondary" or "Tertiary" item will be held in hands.
  • Dialogue: ID of the dialogue asset to open when talked to.
  • Pose: Picks idle animations to use "Stand", "Sit" or "Asleep".
Localization:
  • Character: Name shown in dialogue.
Dialogue
Data:
  • Type: Dialogue
  • ID: The dialogue ID is used to link dialogue together, and is represented as an unsigned 16 bit integer meaning the range [0, 65535]. It is recommended not to use a value less than 2,000 as those are reserved for official content.
  • Messages: Number of possible messages.
  • Message_#_Pages: Number of pages to flip through.
  • Message_#_Responses: Number of responses shown when this message is shown. If 0 then all messages are candidates.
  • Message_#_Response_#: Index of the response to show.
  • Message_#_Prev: Dialogue ID to go back to if there aren't any responses. Usually this doesn't need to be manually set.
  • Message_#_Conditions: Refer to conditions section. First message top to bottom which passes conditions will be picked.
  • Message_#_Rewards: Refer to rewards section. Given when the message is shown.
  • Responses: Number of possible responses.
  • Response_#_Messages: Number of messages to only show this response for. If 0 show for all messages.
  • Response_#_Message_#: Index of the message to show for.
  • Response_#_Dialogue: ID of the dialogue to open when clicked.
  • Response_#_Quest: ID of the quest to preview when clicked.
  • Response_#_Vendor: ID of the vendor to open when clicked.
  • Response_#_Conditions: Refer to conditions section. Only visible if conditions are passed.
  • Response_#_Rewards: Refer to rewards section. Granted when clicked.
Localization:
  • Message_#_Page_#: Text shown for this page.
  • Response_#: Text shown for this button.
Quest
Data:
  • Type: Quest
  • ID: The quest ID is used to give it to a player, and is represented as an unsigned 16 bit integer meaning the range [0, 65535]. It is recommended not to use a value less than 2,000 as those are reserved for official content.
  • Conditions: Refer to conditions section. Available for turn-in when met.
  • Rewards: Refer to rewards section. Granted when turned-in to NPC/a condition resets it.
Localization:
  • Name: Text at the top of the menu and when tracked.
  • Description: Text under the quest name.
Vendor
Data:
  • Type: Vendor
  • ID: The vendor ID is linked from a dialogue, and is represented as an unsigned 16 bit integer meaning the range [0, 65535]. It is recommended not to use a value less than 2,000 as those are reserved for official content.
  • Buying: Number of buyable items.
  • Buying_#_ID: Item ID to buy from player.
  • Buying_#_Cost: Experience to pay player for item.
  • Buying_Conditions: Refer to conditions section. Buyable when conditions are met.
  • Selling: Number of sellable items.
  • Selling_#_ID: Item ID to sell toplayer.
  • Selling_#_Cost: Experience to pay NPC for item.
  • Selling_Conditions: Refer to conditions section. Sellable when conditions are met.
Localization:
  • Name: Text at the top of the menu.
  • Description: Text under the vendor name.
Objects
You can use conditions/rewards for quest progression! An object with conditions shouldn't interfere with player collision because it's different for each client.

Data:
  • Conditions: Refer to conditions section, used for showing/hiding the object. This should probably be kept to just flags.
  • Interactability_Conditions: Refer to conditions section, can only be used when conditions are met.
  • Interactability_Rewards: Refer to rewards section, granted when used.
Localization:
  • Interactability_Condition_0: Text to show when the object can't be used.
Text
Aside from the normal formatting features there are several specifically for NPCs:

Localization:
  • <color=rarity></color> Use the color of an item rarity "common", "uncommon", "rare", "epic", "legendary", "mythical".
  • <name_npc> Insert NPC's character name.
  • <name_char> Insert player's character name.
  • <br> Begin new line.
  • <pause> Wait 0.5 seconds before continuing.
Conditions
Data:
  • Conditions: Number of conditions to check.
  • Condition_#_Type: "Experience", "Reputation", "Flag_Bool", "Flag_Short", "Quest", "Skillset", "Item", "Kills_Zombie", "Kills_Horde".
  • Condition_#_Reset: Set back to equivelant of 0 when completed.
  • Condition_#_Logic: How to compare the current state to the target state "Less_Than", "Less_Than_Or_Equal_To", "Equal", "Not_Equal", "Greater_Than_Or_Equal_To" or "Greater_Than".
Localization:
  • Condition_#: Text to use in the UI anywhere this condition is shown.
Experience:

Data:
  • Condition_#_Value: Target experience.
Reputation:

Data:
  • Condition_#_Value: Target reputation.
Flag_Bool:

Data:
  • Condition_#_ID: Similar to normal IDs, flag ID on the player to check.
  • Condition_#_Value: Target value for the flag "True" or "False".
  • Condition_#_Allow_Unset: Pass condition if the player doesn't have this flag yet.
Flag_Short:

Data:
  • Condition_#_ID: Similar to normal IDs, flag ID on the player to check.
  • Condition_#_Value: Target value for the flag, 16 bit integer meaning the range [-32768, 32767].
  • Condition_#_Allow_Unset: Pass condition if the player doesn't have this flag yet.
Quest:

Data:
  • Condition_#_ID: Quest ID to check for.
  • Condition_#_Status: "Active" has the quest, "Ready" can complete, "Completed" already finished.
Skillset:

Data:
  • Condition_#_Value: "Fire", "Police", "Army", "Farm", "Fish", "Camp", "Work", "Chef", "Thief" or "Medic".
Item:

Data:
  • Condition_#_ID: Item ID to search inventory for.
  • Condition_#_Amount: Number of the item required.
Kills_Zombie:

Data:
  • Condition_#_Zombie: Type of zombie required "Normal", "Mega", "Crawler", "Sprinter", "Flanker_Friendly", "Flanker_Stalk", "Burner", "Burner", "Acid", "Boss_Electric", "Boss_Wind" or "Boss_Fire". Set to "None" for any zombies.
  • Condition_#_ID: Short flag to track stat.
  • Condition_#_Value: Target kills.
  • Condition_#_Spawn: Specified if zombie should be generated (like for bosses), will be killed when you leave the area.
  • Condition_#_Nav: Index of the navmesh visible when selecting it in the editor.
Kills_Horde:

Data:
  • Condition_#_ID: Short flag to track stat.
  • Condition_#_Value: Target beacons completed.
  • Condition_#_Nav: Index of the navmesh visible when selecting it in the editor.
Kills_Animal:

Data:
  • Condition_#_Animal: ID of animal required.
  • Condition_#_ID: Short flag to track stat.
  • Condition_#_Value: Target kills.

Compare_Flags:
Compares flag A to flag B. For example a Less_Than logic type would pass if the value of flag A is less than the value of flag B.

Data:
  • Condition_#_A_ID: Left hand side flag ID.
  • Condition_#_Allow_A_Unset: If not specified the condition will fail if the player doesn't have this flag yet.
  • Condition_#_B_ID: Right hand side flag ID.
  • Condition_#_Allow_B_Unset: If not specified the condition will fail if the player doesn't have this flag yet.

Time_Of_Day:

Data:
  • Condition_#_Second: Second of the 24 hour clock to compare against, where 43200 is noon and 86400 is the full day. It's formatted in military time 00:00:00. This will pass regardless of the current in-game day of the year.
Kills_Player:

Data:
  • Condition_#_ID: Short flag to track stat.
  • Condition_#_Value: Target kills.
Rewards
Data:
  • Rewards: Number of rewards to grant.
  • Reward_#_Type: "Experience", "Reputation", "Flag_Bool", "Flag_Short", "Quest", "Item", "Item_Random".
Localization:
  • Reward_#: Text to use in the UI anywhere this reward is shown.
Experience:

Data:
  • Reward_#_Value: Amount of experience to give.
Reputation:

Data:
  • Reward_#_Value: Amount of reputation to give.
Flag_Bool:

Data:
  • Reward_#_ID: Similar to normal IDs, flag ID on the player to set.
  • Reward_#_Value: Set to "True" or "False".
Flag_Short:

Data:
  • Reward_#_ID: Similar to normal IDs, flag ID on the player to set.
  • Reward_#_Value: Adjust value for the flag, 16 bit integer meaning the range [-32768, 32767].
  • Reward_#_Modification: "Assign" to set equal to value, "Increment" to add value, "Decrement" to subtract the value.
Flag_Short_Random:

Data:
  • Reward_#_ID: Similar to normal IDs, flag ID on the player to set.
  • Reward_#_Min_Value: Min inclusive value for the flag, 16 bit integer meaning the range [-32768, 32767].
  • Reward_#_Max_Value: Max inclusive value for the flag, 16 bit integer meaning the range [-32768, 32767].
  • Reward_#_Modification: "Assign" to set equal to value, "Increment" to add value, "Decrement" to subtract the value. Will pick a random value in the range [Min_Value, Max_Value].
Quest:

Data:
  • Reward_#_ID: Quest ID to give.
Item:

Data:
  • Reward_#_ID: Item ID to give.
  • Reward_#_Amount: Number of the item.
Item_Random:

Data:
  • Reward_#_ID: Spawn ID to pick an item from.
  • Reward_#_Amount: Number of the randomly selected item.
Vehicle:

Data:
  • Reward_#_ID: Vehicle ID to give.
  • Reward_#_Spawnpoint: ID of the spawnpoint (set in the inspector) in the level to spawn at.
Teleport:

Data:
  • Reward_#_Spawnpoint: ID of the spawnpoint (set in the inspector) in the level to teleport the player to.
Flag_Math:

Data:
  • Reward_#_A_ID: Flag to apply the math to.
  • Reward_#_B_ID: Flag containing the math value to use.
  • Reward_#_Operation: Assign, Addition, Subtraction, Multiplication or Division. For example "Multiplication" would set A to the value of A * B.
48 Comments
Festiveszter Apr 29, 2022 @ 12:46pm 
Where is "Kills_Object" condition guide?
MEMATİ Jul 7, 2021 @ 10:36pm 
Poses: "Sit", "Stand", "Rest", "Prone", "Crouch", "Under_Arrest"
Cheredon Jan 17, 2021 @ 7:29am 
Hi Nelson,

I figure this question might be weird to ask, after learning the dat files and others,
I realised one type of Reward Type is not included, however really wish to understand
That is

Reward type: event
Reward ID: Teleporter_A

Could I please ask how could i implement that on my own custom map?:Hiii:
Анальный дебошир Sep 29, 2020 @ 12:57pm 
/:friendly::griefer:))
Joe Mongus Apr 30, 2020 @ 12:19pm 
░░░░█▐▓▓░████▄▄▄█▀▄▓▓▓▌█ HELP
░░░░░▄█▌▀▄▓▓▄▄▄▄▀▀▀▄▓▓▓▓▓▌█ DOGE
░░░▄█▀▀▄▓█▓▓▓▓▓▓▓▓▓▓▓▓▀░▓▌█ TAKE
░░█▀▄▓▓▓███▓▓▓███▓▓▓▄░░▄▓▐█▌ OVER
░█▌▓▓▓▀▀▓▓▓▓███▓▓▓▓▓▓▓▄▀▓▓▐█ STEAM
▐█▐██▐░▄▓▓▓▓▓▀▄░▀▓▓▓▓▓▓▓▓▓▌█▌ COPY
█▌███▓▓▓▓▓▓▓▓▐░░▄▓▓███▓▓▓▄▀▐█ AND
█▐█▓▀░░▀▓▓▓▓▓▓▓▓▓██████▓▓▓▓▐█ PASTE
▌▓▄▌▀░▀░▐▀█▄▓▓██████████▓▓▓▌█▌
▌▓▓▓▄▄▀▀▓▓▓▀▓▓▓▓▓▓▓▓█▓█▓█▓▓▌█▌DO IT.
█▐▓▓▓▓▓▓▄▄▄▓▓▓▓▓▓█▓█▓█▓█▓▓▓▐ DOGE = LIFE
Powerknight Jan 27, 2020 @ 9:15pm 
How did you do the Kaiser quest (without NPCs)?
BowieD Mar 19, 2019 @ 10:14am 
Where is "Kills_Object" condition guide?
Ray Quay Nov 25, 2018 @ 12:39pm 
you need to add a a video explaining where things go.
moopydoll Oct 16, 2018 @ 2:00pm 
I still have no clue what I'm doing.
Wolf_Maniac Jul 7, 2018 @ 12:12pm 
Can you set one of the quest conditions to experience or reputation? So the player has meet that requirement to complete the quest?