Skip to content

Custom NPCs, Dialogues, and Quests

Custom NPCs, dialogue trees, and quests are the foundation of Unturned™ roleplay and story-driven server experiences. A fully functional NPC encounter requires four separate authoring layers that work together: the NPC asset (character appearance and placement), the Dialogue asset (conversation tree with messages and responses), the Quest asset (conditions, objectives, and rewards), and the Vendor asset (items available for purchase or sale). Each layer is a separate .dat file with its own GUID, its own field set, and its own cross-links to the other layers.

This article is the cohort-validated end-to-end reference for authoring all four layers. It covers every significant field in each .dat format, explains how quest flags persist across sessions, and provides a complete worked example of a supply-run quest chain that demonstrates all four asset types working together. The article also documents the cross-links between NPC assets and the item system, so quest rewards can reference custom items from the throwable asset reference and other item categories.

57 Studios™ uses the patterns in this article for NPC encounters on the Horizon Life RP server and for standalone story-mode content published through Workshop.

Custom NPC character with dialogue prompt visible in Unturned roleplay server

Prerequisites

What you'll learn

  • How Unturned's NPC system relates the four asset types to each other.
  • How to author the NPC asset .dat with appearance, pose, equipped item, and dialogue GUID.
  • How to author the Dialogue asset .dat with messages, responses, and conditional flags.
  • How to author the Quest asset .dat with types, conditions, and rewards.
  • How to author the Vendor asset .dat with buying and selling item lists.
  • How quest flags persist across sessions and how to use them for conditional branching.
  • How to reference custom items from other mod categories as quest rewards.
  • How to test NPC encounters in single-player and on a dedicated server.

System architecture

The four NPC system asset types connect in a directed graph. The NPC asset is the entry point. It holds the character's appearance and a reference to the Dialogue asset's GUID. The Dialogue asset holds the conversation tree: each response the player can choose advances to another Dialogue asset, starts a Quest, or opens a Vendor. The Quest asset defines what the player must do and what they receive. The Vendor asset defines what the NPC will buy or sell.

The system is entirely data-driven. No scripting is required to author a standard NPC quest chain. Every behavior is encoded in the .dat files and the flag system.

NPC asset authoring

Folder structure

Each NPC is a separate folder inside your mod's Objects/ or NPCs/ directory. The cohort-validated folder structure is:

Workshop/Content/304930/<ModID>/
└── NPCs/
    └── ExampleTrader/
        ├── ExampleTrader.dat      ← NPC asset definition
        └── English.dat            ← localization (display name)

The NPC asset's GUID must be unique across all loaded mods. Generate a new GUID for each NPC. See Project Folder Structure and GUIDs for the GUID generation workflow.

NPC .dat fields

FieldTypeExamplePurpose
IDuint165001Unique NPC ID. Use IDs above 50000 to avoid collision with vanilla and established mods.
GUIDuint128a1b2c3d4e5f6478aab1c2d3e4f5a6b7cGlobally unique identifier for this NPC asset.
TypeenumNPCThe asset type. Always NPC for character NPCs.
NamestringExampleTraderInternal name. Not shown to players.
Dialogueuint128d4e5f6a7b8c9410dabc1d2e3f4a5b6c7GUID of the Dialogue asset shown when the player interacts with this NPC.
PoseenumStandIdle pose. Values: Stand, Sit, Lean, Rest.
Equippeduint160ID of an item the NPC visually holds. 0 = nothing.
Faceuint85Face index (0–31 matching vanilla face palette).
Hairuint83Hair style index.
Bearduint80Beard style index.
Skincolor255,204,153RGB skin color.
Color_Haircolor80,40,10RGB hair color.
Hatuint160ID of a clothing item placed on the head slot.
Glassesuint160ID of a glasses item.
Vestuint16300ID of a vest/jacket item.
Shirtuint1615ID of a shirt item.
Pantsuint1651ID of a pants item.
Shoesuint16145ID of shoes.

NPC item appearance

The Equipped, Hat, Glasses, Vest, Shirt, Pants, and Shoes fields accept vanilla Unturned item IDs. They control the visual appearance of the NPC. The items are display-only — the NPC does not use them functionally. Equipping vanilla items on an NPC is a quick way to establish character identity without authoring a custom clothing mod.

Seasonal variant fields

Unturned™ supports Christmas and Halloween variant overrides on NPCs. When the server is running during the seasonal event period, these fields override the base fields:

FieldPurpose
Christmas_DialogueGUID of the dialogue to show during the Christmas event.
Halloween_DialogueGUID of the dialogue to show during the Halloween event.
Christmas_HatItem ID for the hat worn during the Christmas event.
Halloween_HatItem ID for the hat worn during the Halloween event.

If seasonal variant fields are not defined, the NPC uses the base fields year-round.

NPC placement

Placement requires level editing

NPCs cannot be spawned at runtime through the standard .dat system. Placement requires the Unturned™ level editor. If you are adding NPCs to an existing community map you do not own, you need to author a separate custom map that copies the layout and adds the NPC placements. Confirm the map license terms before copying community map content.

NPCs are placed in the level editor or in a map's Objects.dat. For server-side NPC placement without a custom map, the cohort approach is to place NPCs in a custom map loaded by the server. NPCs cannot be spawned at runtime through the standard .dat system; placement requires level editing.

Example NPC .dat

ID 5001
GUID a1b2c3d4e5f6478aab1c2d3e4f5a6b7c
Type NPC
Name ExampleTrader

Dialogue d4e5f6a7b8c9410dabc1d2e3f4a5b6c7

Pose Stand
Face 5
Hair 3
Beard 0
Skin 255,204,153
Color_Hair 80,40,10

Shirt 15
Pants 51
Shoes 145
Vest 300
Equipped 0

English.dat for NPCs

Name Example Trader

The Name field is the display name shown above the NPC's head and in the dialogue window header.

Dialogue asset authoring

A Dialogue asset defines the conversation structure. Each Dialogue asset represents a single conversation node: it shows one or more messages from the NPC and presents a set of responses the player can choose. Choosing a response can advance to another Dialogue node, start a Quest, open a Vendor, or close the dialogue window.

Folder structure

Workshop/Content/304930/<ModID>/
└── Dialogues/
    └── ExampleTraderDialogue/
        ├── ExampleTraderDialogue.dat
        └── English.dat

Dialogue .dat fields

Identity fields:

FieldTypeExamplePurpose
IDuint166001Unique Dialogue ID.
GUIDuint128d4e5f6a7b8c9410dabc1d2e3f4a5b6c7Globally unique identifier. Must match the GUID referenced in the NPC asset.
TypeenumDialogueAlways Dialogue.

Message fields:

A Dialogue asset can show 1–8 messages. Each message is conditionally shown based on quest flag conditions. The first message whose conditions are satisfied is shown to the player. This allows a single Dialogue node to present different text depending on quest state.

FieldTypeExamplePurpose
Messagesuint82Total count of messages defined in this dialogue node.
Message_0_Conditionsuint81Number of conditions that must be true for Message_0 to show.
Message_0_Condition_0_TypeenumQuest_Flag_BoolType of condition. See condition types below.
Message_0_Condition_0_IDuint16100The quest flag ID to check.
Message_0_Condition_0_Valuebool/intTrueThe expected value of the flag.
Message_0_Condition_0_LogicenumEqualComparison logic: Equal, Not_Equal, Greater_Than, Less_Than.
Message_0_EnglishstringThanks for completing the supply run!The message text for this condition.

Response fields:

Each Dialogue node can have 1–8 responses. Responses are the choices presented to the player. Like messages, responses can be conditionally shown based on quest flags.

FieldTypeExamplePurpose
Responsesuint83Total count of responses.
Response_0_Conditionsuint80Number of conditions for this response to be shown. 0 = always shown.
Response_0_Dialogueuint128...GUID of the next Dialogue node if the player selects this response. Leave blank if not advancing to another dialogue.
Response_0_Questuint167001Quest ID to start when this response is selected. Leave 0 if no quest starts.
Response_0_Vendoruint168001Vendor ID to open when this response is selected. Leave 0 if no vendor opens.
Response_0_OpenEffectuint160Effect ID to play when this response is selected.
Response_0_EnglishstringTell me about the supply run.The response text shown to the player.

Condition types

Condition typeChecks
Quest_Flag_BoolWhether a boolean quest flag equals a given value
Quest_Flag_ShortWhether a short integer quest flag meets a numeric comparison
Quest_StatusWhether a specific quest is None, Active, or Completed
Time_Of_DayWhether the in-game time is within a range
Player_Is_FullWhether the player's inventory is full
CurrencyWhether the player has enough of a currency item

English.dat for Dialogues

Unlike other asset types, Dialogue English.dat files can hold multiple keyed entries — one per message and one per response:

Message_0 Thanks for completing the supply run!
Message_1 I have a job for you, if you're up for it.

Response_0 Tell me about the supply run.
Response_1 What are you buying?
Response_2 Goodbye.

The key format is Message_N and Response_N matching the index in the .dat file.

Dialogue tree flowchart showing branching paths in an Unturned NPC conversation

Example: two-node dialogue chain

Node 1 (ExampleTraderDialogue_Root.dat) — the first node the player sees:

ID 6001
GUID d4e5f6a7b8c9410dabc1d2e3f4a5b6c7
Type Dialogue

Messages 1
Message_0_Conditions 0
Message_0_English I need someone to run supplies to the outpost. Are you in?

Responses 2
Response_0_Conditions 0
Response_0_Quest 7001
Response_0_English I'll do it.

Response_1_Conditions 0
Response_1_English Not right now. Maybe later.

Node 2 (ExampleTraderDialogue_Complete.dat) — shown when quest is done:

ID 6002
GUID e5f6a7b8c9d0421eabc2d3e4f5a6b7c8
Type Dialogue

Messages 2
Message_0_Conditions 1
Message_0_Condition_0_Type Quest_Status
Message_0_Condition_0_ID 7001
Message_0_Condition_0_Value Completed
Message_0_Condition_0_Logic Equal
Message_0_English Excellent work. Here's your payment.

Message_1_Conditions 0
Message_1_English Safe travels out there.

Responses 1
Response_0_Conditions 0
Response_0_English Thanks.

Message ordering and fallback

Messages are evaluated in order from Message_0 to Message_N. The first message whose conditions are all satisfied is the one shown. The last message should have zero conditions to act as a guaranteed fallback — if no earlier message's conditions are met, the fallback message is shown. This prevents a dialogue node from displaying nothing to the player if all conditional messages fail.

Quest asset authoring

A Quest asset defines what the player must do (conditions), what triggers quest completion, and what the player receives when it completes (rewards). Quest assets are separate .dat files referenced by response fields in Dialogue assets.

Folder structure

Workshop/Content/304930/<ModID>/
└── Quests/
    └── ExampleSupplyRun/
        ├── ExampleSupplyRun.dat
        └── English.dat

Quest .dat identity and type fields

FieldTypeExamplePurpose
IDuint167001Unique Quest ID.
GUIDuint128f6a7b8c9d0e1432fabc3d4e5f6a7b8c9Globally unique identifier.
TypeenumQuestAlways Quest.
NamestringExampleSupplyRunInternal name.

Quest condition fields

::: note Conditions are evaluated on dialogue interaction, not continuously Quest conditions are not checked in real time as the player collects items. They are evaluated at the moment the player interacts with the NPC and the dialogue checks whether the quest can be completed. The player must return to the NPC to trigger the evaluation — the quest does not auto-complete when the last item enters the inventory. :::

Conditions define what must be true for the quest to be considered complete. Conditions are evaluated at runtime when the player opens the relevant dialogue or when the server checks quest state.

FieldTypeExamplePurpose
Conditionsuint82Total number of conditions for this quest.
Condition_0_TypeenumItemThe condition type.
Condition_0_IDuint1614The item ID to check (for Item conditions).
Condition_0_Amountuint165The required item count.
Condition_0_ResetboolTrueWhether to remove the items from inventory on quest completion.

Quest condition types:

TypeWhat it checksKey fields
ItemPlayer holds a minimum quantity of a specific itemID (item ID), Amount, Reset (remove on complete)
Quest_Flag_BoolA boolean quest flag equals a valueID (flag ID), Value
Quest_Flag_ShortA short integer flag meets a comparisonID, Value, Logic
Quest_StatusAnother quest is in a specific stateID (quest ID), Value (None / Active / Completed)
SkillsetPlayer's skillset matchesValue (skillset name)
ExperiencePlayer has a minimum XP amountAmount
ReputationPlayer's reputation meets a thresholdAmount, Logic
Time_Of_DayIn-game time is within a rangeValue (time range)
Player_Life_FoodPlayer's food stat meets a thresholdAmount, Logic
Player_Life_WaterPlayer's water stat meets a thresholdAmount, Logic

Quest reward fields

Rewards are given to the player when all conditions are satisfied and the quest is completed. Multiple reward types can be combined in a single quest.

FieldTypeExamplePurpose
Rewardsuint83Total number of rewards.
Reward_0_TypeenumItemReward type.
Reward_0_IDuint16253For Item rewards: the item ID to give.
Reward_0_Amountuint161For Item rewards: quantity to give.

Quest reward types:

TypeWhat it givesKey fields
ItemOne or more copies of an itemID (item ID), Amount
Quest_Flag_BoolSets a boolean quest flag to a valueID (flag ID), Value
Quest_Flag_ShortSets or modifies an integer quest flagID, Value, Modification (Assign / Increment / Decrement)
ExperienceGrants XPAmount
ReputationAdjusts player reputationAmount (positive or negative)
HintShows a hint message to the playerText
EffectPlays an effectID (effect ID)
TeleportTeleports the player to a named locationSpawnpoint
CurrencyGives a currency itemGUID (currency GUID), Amount

Item reward GUID requirement

When referencing custom modded items as quest rewards, use the item's GUID in the Reward_N_GUID field rather than its ID. GUID references are stable across mod updates; ID references can collide if another mod uses the same ID. See Project Folder Structure and GUIDs for the distinction.

English.dat for Quests

Name Supply Run
Description Deliver 5 Medical Kits to the northern outpost.
Reward_0 Reward: Emergency Kit x1

The Reward_N keys are optional. If provided, they appear in the quest log as human-readable reward descriptions.

Example Quest .dat

ID 7001
GUID f6a7b8c9d0e1432fabc3d4e5f6a7b8c9
Type Quest
Name ExampleSupplyRun

Conditions 1
Condition_0_Type Item
Condition_0_ID 394
Condition_0_Amount 5
Condition_0_Reset True

Rewards 3
Reward_0_Type Item
Reward_0_ID 255
Reward_0_Amount 1

Reward_1_Type Experience
Reward_1_Amount 500

Reward_2_Type Quest_Flag_Bool
Reward_2_ID 100
Reward_2_Value True

In this example: the player must carry 5 units of item 394 (Medical Kit). Upon completion, those 5 items are removed, the player receives item 255 (Emergency Kit), 500 XP, and flag 100 is set to True. The flag can then be checked in the dialogue's conditions to show the post-completion message.

Condition_Reset and inventory management

Setting Condition_0_Reset True removes the required items from the player's inventory at the moment of quest completion. If the player's inventory is full when the reward item is granted, the reward may fail to place — it will drop on the ground near the NPC. Inform players of this in the quest description so they clear inventory space before turning in item-delivery quests.

Vendor asset authoring

A Vendor asset defines the items an NPC will buy from or sell to the player. Vendors are opened from a dialogue response with a non-zero Response_N_Vendor field.

Folder structure

Workshop/Content/304930/<ModID>/
└── Vendors/
    └── ExampleTraderVendor/
        ├── ExampleTraderVendor.dat
        └── English.dat

Vendor .dat identity fields

FieldTypeExamplePurpose
IDuint168001Unique Vendor ID. Referenced in Dialogue responses.
GUIDuint128g7h8i9j0k1l2453mabc4d5e6f7a8b9c0Globally unique identifier.
TypeenumVendorAlways Vendor.
NamestringExampleTraderVendorInternal name.
Currencyuint128``GUID of the currency item. Leave blank to use the default experience-as-currency system.
Disable_SortingboolFalseIf True, items appear in definition order instead of sorted by name.

Custom currency items

The Currency field accepts the GUID of any item defined in a loaded mod. This allows server operators to create custom in-game currencies (tokens, faction credits, barter goods) separate from the default experience system. Author the currency item as a standard item .dat with a unique GUID, then reference that GUID in the Vendor's Currency field.

Selling items (NPC sells to player)

Selling entries define what the NPC has available for the player to purchase.

FieldTypeExamplePurpose
Sellinguint83Total count of items the NPC sells.
Selling_0_TypeenumItemEntry type: Item or Vehicle.
Selling_0_IDuint16255Item ID of the item being sold.
Selling_0_Costuint32100Cost in experience points (or currency item units if Currency is set).
Selling_0_Conditionsuint81Number of conditions that must be true for this listing to appear. 0 = always visible.
Selling_0_Condition_0_TypeenumQuest_Flag_BoolCondition type for unlocking this listing.
Selling_0_Condition_0_IDuint16100Flag ID to check.
Selling_0_Condition_0_ValueboolTrueRequired flag value for the listing to appear.

Buying items (NPC buys from player)

Buying entries define what the NPC will purchase from the player.

FieldTypeExamplePurpose
Buyinguint82Total count of items the NPC buys.
Buying_0_TypeenumItemEntry type: Item.
Buying_0_IDuint16394Item ID the NPC will purchase.
Buying_0_Costuint3225Amount paid to the player per unit.
Buying_0_Conditionsuint80Conditions for this buying entry to appear.

Example Vendor .dat

ID 8001
GUID g7h8i9j0k1l2453mabc4d5e6f7a8b9c0
Type Vendor
Name ExampleTraderVendor

Selling 2
Selling_0_Type Item
Selling_0_ID 255
Selling_0_Cost 200

Selling_1_Type Item
Selling_1_ID 56
Selling_1_Cost 50
Selling_1_Conditions 1
Selling_1_Condition_0_Type Quest_Flag_Bool
Selling_1_Condition_0_ID 100
Selling_1_Condition_0_Value True
Selling_1_Condition_0_Logic Equal

Buying 1
Buying_0_Type Item
Buying_0_ID 394
Buying_0_Cost 25

In this example: the NPC always sells item 255 (Emergency Kit) for 200 experience. Item 56 (Bandage) is unlocked for sale only after flag 100 is True (i.e., after the supply run quest completes). The NPC buys Medical Kits at 25 experience each.

The following diagram shows how the vendor evaluates which items to display when a player opens it:

English.dat for Vendors

Name Example Trader Shop

The display name is shown in the vendor window header.

Quest flag persistence

Quest flags are short integer or boolean values stored in the player's save file. They persist across server restarts and across sessions. Flags are keyed by a numeric ID (1–65535) that is shared across all quests and dialogues within the same mod. Flags from different mods do not conflict because Unturned scopes them to the mod's Workshop content ID.

Flag types

TypeStorageRangeUse case
Boolean flagboolTrue / FalseQuest completion state, binary unlock gates
Short integer flagshort-32768 to 32767Quest step counters, reputation scores, item delivery counts

Flag ID management

Flag ID collisions are silent and destructive

If two quests use the same flag ID with different intentions — for example, Quest A uses flag 100 as a completion gate and Quest B uses flag 100 as a kill counter — the quests will corrupt each other's state. The system does not report this conflict at load time. All validation is on the author. Maintain the flag registry document described below before authoring the second quest in any mod.

The cohort's convention for flag ID management is to maintain a flags.md document within the mod's source folder that lists every flag ID, its type, its name, and the quests that read and write it. This prevents two quests from accidentally using the same flag ID with different semantics.

Example flags.md:

Flag 100 (Bool) — supply_run_complete
  Written True by: Quest 7001 (ExampleSupplyRun) on completion
  Read by: Dialogue 6002 (ExampleTraderDialogue_Complete), Vendor 8001 (ExampleTraderVendor)

Flag 101 (Short) — supply_runs_completed_count
  Incremented by: Quest 7001 on each completion (if repeatable)
  Read by: Dialogue 6003 (ExampleTraderDialogue_Repeat) for unlocking new quests

Flag 102 (Bool) — advanced_trader_unlocked
  Written True by: Quest 7002 (AdvancedSupplyRun) on completion
  Read by: Vendor 8001, Selling_2 (advanced item unlocked after this quest)

Using flags for quest chaining

Quest chains are built by using a completion quest's Reward_N_Type Quest_Flag_Bool to set a flag, and then using that flag as a condition in the next quest's dialogue or in an unlocked vendor entry. This pattern supports arbitrarily deep quest chains without requiring plugin code.

Repeatable quests

A quest is repeatable if the server resets the completion flag when the quest is turned in. Author a repeatable quest by using a Quest_Flag_Short counter instead of a Quest_Flag_Bool completion flag, and not gating the quest offer on the flag value. The quest remains available after each completion because there is no Quest_Status = Completed gate blocking re-entry.

For economy-critical quests (supply runs, material delivery), the cohort recommendation is to use a repeatable short-counter flag to track the number of completions and to use that counter to unlock higher-tier quests at specific completion thresholds.

Cross-linking to custom item assets

Quest rewards can reference custom modded items by GUID. The item must be in the same Workshop mod or in a mod that is loaded before the quest mod. Cross-references to custom items follow the same pattern as the throwable asset reference: use the item's GUID in the reward field, not its numeric ID.

Reward cross-linking example — giving a custom modded item as a quest reward:

Reward_0_Type Item
Reward_0_GUID a9b8c7d6e5f4321a987654321fedcba01
Reward_0_Amount 1

The GUID a9b8c7d6e5f4321a987654321fedcba01 is the GUID from the custom item's own .dat file. Because GUIDs are stable across ID renumbering, this cross-reference remains valid even if the item's numeric ID changes during a mod update.

Load order for cross-mod reward references

If the reward item is in a separate mod from the quest, the item mod must be loaded before the quest mod. Unturned resolves GUID cross-references at load time, not at runtime. If the item mod loads after the quest mod, the reward item will be unresolved and the reward will silently fail to grant.

Complete worked example: supply run quest chain

The following section summarizes all four asset files for a minimal but complete supply run quest chain. Each file's content is shown in its final form.

Asset GUID register

AssetGUID
NPC: ExampleTradera1b2c3d4e5f6478aab1c2d3e4f5a6b7c
Dialogue: Rootd4e5f6a7b8c9410dabc1d2e3f4a5b6c7
Dialogue: Completee5f6a7b8c9d0421eabc2d3e4f5a6b7c8
Quest: ExampleSupplyRunf6a7b8c9d0e1432fabc3d4e5f6a7b8c9
Vendor: ExampleTraderVendorg7h8i9j0k1l2453mabc4d5e6f7a8b9c0

System flow

Testing NPC encounters

Single-player testing

  1. Copy the mod's Bundles/ folder to the local Unturned™ install's Workshop directory.
  2. Launch Unturned™ in single-player on a map that includes the NPC placement.
  3. Approach the NPC and press F (or the configured interaction key) to open the dialogue.
  4. Confirm the root dialogue message appears.
  5. Select the quest-start response. Confirm the quest appears in the quest log.
  6. Collect the required items and return to the NPC.
  7. Confirm the completion dialogue appears and the reward items appear in inventory.
  8. Confirm the quest is removed from the active quest log.
  9. Re-open the dialogue. Confirm the post-completion message appears (flag 100 = True condition).
  10. Open the vendor. Confirm conditional items are now visible.

Common single-player test failures

SymptomCauseResolution
NPC shows no dialogue on interactNPC Dialogue GUID does not match any loaded Dialogue assetConfirm GUID in NPC .dat matches GUID in Dialogue .dat header
Dialogue shows wrong messageMessage condition flags are in unexpected stateCheck flag state with a debug plugin or reset player save to test from a clean state
Quest does not appear in logDialogue response does not reference a valid Quest IDConfirm Response_N_Quest matches Quest ID and Quest .dat is loaded
Quest conditions never metItem ID in Condition does not match the item the player is carryingConfirm item ID with @give command and inspect what the player receives
Reward item not receivedReward GUID not resolvedConfirm reward item mod is loaded before quest mod
Vendor shows no itemsVendor ID in dialogue response does not match loaded Vendor assetConfirm Response_N_Vendor matches Vendor ID field
Conditional vendor items not visibleFlag condition uses wrong flag ID or valueInspect flag state; confirm Quest reward sets the flag with the correct ID
Quest repeats when it should notCompletion flag not set or flag gate not in dialogue conditionsAdd Quest_Status = Completed condition to quest-offer dialogue response

Test with a clean player save

When testing NPC quests in single-player, the player save file accumulates flag state from previous test runs. A flag set to True in a prior session will remain True in the next session, which can cause conditional dialogues to show the post-completion state before you have completed the quest in the current test run. Keep a clean backup of the player save file and restore it at the start of each full test cycle.

Dedicated server testing

After single-player testing passes, deploy the mod to a dedicated server and repeat the test with at least two client connections:

  1. Client A completes the quest chain. Confirm flag persistence across a server restart.
  2. Client B joins fresh and completes the quest independently. Confirm flags are per-player, not global.
  3. Both clients open the vendor simultaneously. Confirm no inventory conflict.
  4. Restart the server. Confirm Client A's completed flag is still True on reconnect.

Flag persistence across restarts

Quest flags are saved in the player's .player save file on the server. They persist across server restarts automatically. If flag state is not persisting, the most likely cause is that the player save directory is being wiped on restart by a server management script. Confirm the save directory is excluded from any wipe scripts.

Quest log UI in Unturned showing an active supply run quest with item collection progress

Frequently asked questions

How do I create an NPC that gives a quest without any dialogue?

An NPC must have a Dialogue asset — it cannot start a quest directly without dialogue. To create a minimal single-interaction quest-giver, author a Dialogue asset with one message and one response whose Response_0_Quest references the quest. This produces an NPC that shows one line of text and one "Accept" button.

Can a single dialogue node start multiple quests?

No. Each response field can reference at most one Quest ID (Response_N_Quest). To start multiple quests, author a chain of dialogue nodes where each node starts one quest and the response leads to the next node.

How many responses can a dialogue node have?

The Unturned dialogue system supports up to 8 responses per dialogue node. If more than 8 choices are needed, split the content across multiple dialogue nodes with a "More options..." response leading to the continuation node.

Can a vendor be opened from the map editor without an NPC?

No. Vendors are accessed exclusively through NPC dialogue responses. They cannot be opened by interacting with a placed object or environment element through the standard .dat system.

How do I make a quest reward give the player a vehicle?

Reward types include Vehicle in addition to Item. Use Reward_N_Type Vehicle and set Reward_N_ID to the vehicle's ID. The vehicle spawns near the player's position at the reward moment.

What is the maximum number of conditions per quest?

Unturned supports up to 8 conditions per quest. If more conditions are required, consider using a short-integer flag as an intermediate accumulator: a plugin increments the flag as each sub-condition is met, and the quest checks the flag value as its single condition.

How do I reference a custom modded item as a quest reward?

Use the Reward_N_GUID field with the custom item's GUID from its .dat file. Do not use the numeric ID for cross-mod references — numeric IDs are not guaranteed to be stable if the item mod is updated. GUIDs are stable identifiers. See Project Folder Structure and GUIDs for GUID management.

Can I use quests to track player kills or zombie kills?

Not through the standard quest .dat system. Kill tracking requires a plugin that increments a quest flag via the server API. The standard system supports item delivery, flag states, quest status, reputation, and time conditions — not event-based counters. To implement kill-count quests, use a RocketMod or OpenMod plugin that listens to death events and calls the Unturned API to increment a quest flag.

How does quest flag scoping work? Do flags conflict between mods?

Flags are scoped to the Workshop content ID of the mod that defines the quest. Flags used by Mod A do not conflict with flags in Mod B even if they share the same numeric ID. However, within a single mod, every flag ID is shared across all quests and dialogues. Maintain a flag registry (as described in the Flag ID Management section) to prevent intra-mod conflicts.

Can an NPC have different dialogue depending on the time of day?

Yes. Author two message entries in the dialogue node. Set Message_0_Condition_0_Type Time_Of_Day with a day range and Message_1_Conditions 0 as the fallback. The dialogue system evaluates the time-of-day condition at interaction time and shows the appropriate message.

How do I make an NPC disappear or stop responding after a quest is completed?

The standard NPC system does not support conditional NPC visibility through .dat authoring. Making an NPC disappear requires either a plugin that modifies NPC state at runtime, or placing the NPC in a conditional object group that is toggled by a plugin based on flag state.

Can the same NPC have both a Dialogue and a Vendor?

Yes. The NPC's Dialogue field links to a Dialogue asset. That Dialogue asset can have a response with Response_N_Vendor set to the Vendor ID. When the player selects that response, the vendor window opens. The NPC serves as the access point for both the dialogue tree and the vendor through the same interaction.

How do I test flag state during development without completing the full quest chain?

The cohort approach is to author a temporary debug dialogue node that sets flags to specific values via responses (using Response_N_Quest pointing at a debug quest whose only reward is setting the flag). This allows manual flag state control during development. Remove the debug node before publishing.

Appendix A: Complete .dat field reference tables

NPC asset fields — full reference

FieldTypeRequiredDefaultNotes
IDuint16YesMust be unique across all loaded mods
GUIDuint128YesGlobally unique; generate with a GUID tool
TypeenumYesAlways NPC
NamestringYesInternal name; not player-visible
Dialogueuint128YesGUID of root Dialogue asset
PoseenumNoStandStand, Sit, Lean, Rest
Equippeduint16No0Visually held item ID
Faceuint8No00–31
Hairuint8No0Hair style index
Bearduint8No0Beard style index
SkincolorNo255,204,153RGB
Color_HaircolorNo80,40,10RGB
Hatuint16No0Clothing item ID
Glassesuint16No0Clothing item ID
Vestuint16No0Clothing item ID
Shirtuint16No0Clothing item ID
Pantsuint16No0Clothing item ID
Shoesuint16No0Clothing item ID
Christmas_Dialogueuint128NoSeasonal override
Halloween_Dialogueuint128NoSeasonal override

Quest condition types — full reference

TypeField: IDField: ValueField: AmountField: Logic
ItemItem numeric IDRequired quantity
Quest_Flag_BoolFlag numeric IDTrue / FalseEqual / Not_Equal
Quest_Flag_ShortFlag numeric IDNumericEqual / Not_Equal / Greater_Than / Less_Than
Quest_StatusQuest numeric IDNone / Active / CompletedEqual / Not_Equal
SkillsetSkillset nameEqual / Not_Equal
ExperienceXP amountGreater_Than / Less_Than
ReputationRep amountGreater_Than / Less_Than
Time_Of_DayTime range string
Player_Life_FoodFood statGreater_Than / Less_Than
Player_Life_WaterWater statGreater_Than / Less_Than

Quest reward types — full reference

TypeField: IDField: AmountField: GUIDField: Modification
ItemItem numeric ID or use GUIDQuantityOptional; use instead of ID for modded items
Quest_Flag_BoolFlag numeric ID
Quest_Flag_ShortFlag numeric IDValueAssign / Increment / Decrement
ExperienceXP amount
ReputationRep delta
Hint
EffectEffect numeric ID
TeleportSpawnpoint name
VehicleVehicle numeric ID
CurrencyAmountCurrency item GUID

Appendix B: Flag ID reservation template

Copy this template into a flags.md file in each mod's source folder. Fill in entries as quests are authored. This prevents flag ID collisions within the mod.

# Quest Flag Registry — [Mod Name]
# Updated: [Date]

## Boolean Flags (True/False)

Flag ID | Name                        | Set by Quest | Read by
--------|-----------------------------|--------------|---------
100     | supply_run_complete         | Quest 7001   | Dialogue 6002, Vendor 8001
101     | advanced_trader_unlocked    | Quest 7002   | Vendor 8001 (Selling_2)

## Short Integer Flags (counter/score)

Flag ID | Name                        | Modified by  | Read by
--------|-----------------------------|--------------|---------
200     | supply_runs_completed_count | Quest 7001   | Dialogue 6003 (threshold gate)
201     | player_reputation_score     | Quest 7001/2 | Vendor 8001 (price modifier)

## Reserved Range
IDs 900–999: Reserved for future expansion.
IDs 1000+: Do not use in this mod.

Appendix C: Useful references

ResourceURLPurpose
Smartly Dressed Games modding docshttps://docs.smartlydressedgames.com/en/stable/Official NPC, dialogue, and quest asset documentation
Unturned on Steamhttps://store.steampowered.com/app/304930/Unturned/Official game page; verify current asset format version

Cross-references

Document history

VersionDateAuthorNotes
1.02025-05-1857 StudiosInitial publication. NPC, Dialogue, Quest, and Vendor asset authoring; flag persistence; worked example.