pub enum Objective {
TalkTo {
id: ObjectiveId,
title: Option<String>,
hint: Option<String>,
npc: NpcId,
after: Vec<ObjectiveId>,
requires_flags: Vec<FlagId>,
forbids_flags: Vec<FlagId>,
requires_state: Vec<StateCompare>,
stealth: bool,
happening: Option<Happening>,
},
ReachAnchor {
id: ObjectiveId,
title: Option<String>,
hint: Option<String>,
anchor: AnchorId,
radius: u32,
after: Vec<ObjectiveId>,
requires_flags: Vec<FlagId>,
forbids_flags: Vec<FlagId>,
requires_state: Vec<StateCompare>,
stealth: bool,
happening: Option<Happening>,
},
Kill {
id: ObjectiveId,
title: Option<String>,
hint: Option<String>,
wave: WaveId,
after: Vec<ObjectiveId>,
requires_flags: Vec<FlagId>,
forbids_flags: Vec<FlagId>,
requires_state: Vec<StateCompare>,
stealth: bool,
happening: Option<Happening>,
},
Collect {Show 16 fields
id: ObjectiveId,
title: Option<String>,
hint: Option<String>,
item: String,
count: u32,
anchor: AnchorId,
container: Option<AnchorId>,
dropped_by: Option<WaveId>,
item_name: Option<String>,
fill_count: u32,
after: Vec<ObjectiveId>,
requires_flags: Vec<FlagId>,
forbids_flags: Vec<FlagId>,
requires_state: Vec<StateCompare>,
stealth: bool,
happening: Option<Happening>,
},
Interact {Show 13 fields
id: ObjectiveId,
title: Option<String>,
hint: Option<String>,
anchor: AnchorId,
requires_item: Option<String>,
missing_item_hint: Option<String>,
prop: Option<Prop>,
after: Vec<ObjectiveId>,
requires_flags: Vec<FlagId>,
forbids_flags: Vec<FlagId>,
requires_state: Vec<StateCompare>,
stealth: bool,
happening: Option<Happening>,
},
}Expand description
A quest objective.
Every variant may carry requires_flags:
flag-gated activation, satisfied only once each referenced flag has been set
by a set-flag effect.
Variants§
TalkTo
Completed by a dialogue option’s complete-objective effect.
Fields
id: ObjectiveIdObjective id.
after: Vec<ObjectiveId>Prerequisite objectives (intra-quest ordering).
forbids_flags: Vec<FlagId>Negative flag gate (DSL v0.6): the
objective is suppressed (cannot activate or complete) while ANY listed
flag is set for the player — the dual of requires_flags.
requires_state: Vec<StateCompare>Numeric gate terms (DSL v0.10, spec-0031): every listed comparison must hold for this gate to be open. The third field of the one gate, carried by every gate consumer — never by the verb that first wanted it. Default empty, so a pre-0.10 campaign is byte-identical.
ReachAnchor
Completed by reaching an anchor once prerequisites are met.
Fields
id: ObjectiveIdObjective id.
after: Vec<ObjectiveId>Prerequisite objectives (intra-quest ordering).
forbids_flags: Vec<FlagId>Negative flag gate (DSL v0.6): the
objective is suppressed (cannot activate or complete) while ANY listed
flag is set for the player — the dual of requires_flags.
requires_state: Vec<StateCompare>Numeric gate terms (DSL v0.10, spec-0031): every listed comparison must hold for this gate to be open. The third field of the one gate, carried by every gate consumer — never by the verb that first wanted it. Default empty, so a pre-0.10 campaign is byte-identical.
Kill
Completed when the referenced wave is fully slain (v0.3).
Fields
id: ObjectiveIdObjective id.
after: Vec<ObjectiveId>Prerequisite objectives.
forbids_flags: Vec<FlagId>Negative flag gate (DSL v0.6): the
objective is suppressed (cannot activate or complete) while ANY listed
flag is set for the player — the dual of requires_flags.
requires_state: Vec<StateCompare>Numeric gate terms (DSL v0.10, spec-0031): every listed comparison must hold for this gate to be open. The third field of the one gate, carried by every gate consumer — never by the verb that first wanted it. Default empty, so a pre-0.10 campaign is byte-identical.
Collect
Completed when count of item have been collected (v0.3).
The items are provided in a container: the compiler’s own chest at
anchor by default, or — since DSL v0.8 — the prefab’s existing
chest/barrel at Objective::Collect::container, optionally carrying an
Objective::Collect::item_name and padded to read full with
Objective::Collect::fill_count.
Fields
id: ObjectiveIdObjective id.
container: Option<AnchorId>Adopt the container the prefab already placed: the anchor whose
assembled-world cell holds
a chest / trapped_chest / barrel this collect fills instead of
conjuring its own chest at Objective::Collect::anchor.
Same division of labour a loot entry and a trap’s dispenser already
keep with the prefab: furniture belongs in the piece. A beach camp’s
barrel is scenery the player has been walking past since minute one —
having the compiler setblock a second, floating chest beside it to
hold the quest item is exactly the downstream workaround the no-hack
rule forbids. A container whose cell holds no container is a build
error (DW0438), never a silent fill into a wall.
The critical-path step’s position follows the container (the bot opens
this block), and no chest is placed at anchor when it is set.
dropped_by: Option<WaveId>The item comes off a body, not out of a box: the wave whose
declared drops[] yield
this objective’s item. No container is placed — not the compiler’s own
chest at anchor, not a prefab one — and container is therefore
mutually exclusive with it (DW0100-adjacent; DW0492).
This is what makes “kill the boss → pick up its key → open the door”
a proved chain rather than an authoring intention. The compiler
requires (a) that the named wave really declares an {item} drop of
this item (DW0492), and (b) that a kill objective for that wave
precedes this collect in the objective graph (DW0493). The existing
flow machinery then carries the ordering the rest of the way: the
door’s requires_flags hangs off this collect exactly as it would off
a chest one.
Waves only. An actor’s death is not observable by any objective —
there is no vanilla-side signal the flow machinery could consume — so
an actor-gated collect would be an unprovable claim, and per the
no-hack doctrine it is excluded rather than approximated. An actor may
still declare drops[]; those drops just cannot gate a quest.
item_name: Option<String>Display name for the collected item (DSL v0.8), emitted as the vanilla custom_name item component.
A quest item is a named thing in the story (“Cheese”, “Tide
Ledger”), and a player who opens the barrel must read that name — an
unnamed minecraft:pumpkin_pie says nothing about what the quest asked
for. Player-visible, so it enters the l10n string inventory
(obj.<quest>.<obj>.item_name) and translates like any other line.
Naming changes nothing about adjudication: the completion advancement and the per-tick held check both match on the ITEM ID, which a named stack still carries.
fill_count: u32Padding stacks that make the container read full. Default 0 =
the single required
stack and nothing else.
A barrel of cheese that opens on one lonely wheel reads as a bug, and
vanilla’s notion of “full” is occupied slots, not stack size — so
this counts SLOTS: the objective’s own stack lands in container.0 and
each padding stack repeats it in container.1, container.2, … Slot
assignment is positional and total, the same determinism story loot
tells (ADR-0006): no RNG, no loot tables, nothing to reseed.
The padding is the same item, so taking the whole barrel still completes the objective and never over- or under-counts it.
after: Vec<ObjectiveId>Prerequisite objectives.
forbids_flags: Vec<FlagId>Negative flag gate (DSL v0.6): the
objective is suppressed (cannot activate or complete) while ANY listed
flag is set for the player — the dual of requires_flags.
requires_state: Vec<StateCompare>Numeric gate terms (DSL v0.10, spec-0031): every listed comparison must hold for this gate to be open. The third field of the one gate, carried by every gate consumer — never by the verb that first wanted it. Default empty, so a pre-0.10 campaign is byte-identical.
Interact
Completed by interacting with an entity at anchor; if requires_item is
set, the item must be held in the main hand (v0.3; held semantics since
DSL v0.7 — see Objective::Interact::requires_item).
Fields
id: ObjectiveIdObjective id.
requires_item: Option<String>Item the player must be holding in the main hand for the interaction to complete (optional).
Held, not merely possessed: presenting the
item IS the action — a player who right-clicks a sleeping giant with a
sharpened stake buried in their backpack has not stabbed anything.
Before this ruling the gate read the whole inventory, which made every
requires_item interaction fire the moment the item was picked up
anywhere, whatever the player was actually doing with their hands.
missing_item_hint: Option<String>Diegetic feedback for a click that arrives without the required item in
hand (DSL v0.7): narrated to that player in
chat instead of the silence the gate used to answer with. Requires
requires_item (DW0437).
Only fires while the objective is genuinely open — same activation gate as the affordance itself — so a finished or not-yet-active interaction stays quiet.
prop: Option<Prop>Prop block that IS the interaction affordance (DSL v0.4, spec-0008
§2): the compiler setblocks it at the anchor on activation (exactly
as collect uses a real chest). Omitted = the glowing-lantern
hologram marker (the v0.3 fallback).
after: Vec<ObjectiveId>Prerequisite objectives.
forbids_flags: Vec<FlagId>Negative flag gate (DSL v0.6): the
objective is suppressed (cannot activate or complete) while ANY listed
flag is set for the player — the dual of requires_flags.
requires_state: Vec<StateCompare>Numeric gate terms (DSL v0.10, spec-0031): every listed comparison must hold for this gate to be open. The third field of the one gate, carried by every gate consumer — never by the verb that first wanted it. Default empty, so a pre-0.10 campaign is byte-identical.
Implementations§
Source§impl Objective
impl Objective
Sourcepub fn id(&self) -> &ObjectiveId
pub fn id(&self) -> &ObjectiveId
This objective’s id.
Sourcepub fn after(&self) -> &[ObjectiveId]
pub fn after(&self) -> &[ObjectiveId]
This objective’s prerequisites.
Sourcepub fn title_mut(&mut self) -> &mut Option<String>
pub fn title_mut(&mut self) -> &mut Option<String>
Mutable access to the optional player-facing title (i18n localization).
Sourcepub fn hint_mut(&mut self) -> &mut Option<String>
pub fn hint_mut(&mut self) -> &mut Option<String>
Mutable access to the optional one-line hint (i18n localization).
Sourcepub fn requires_flags(&self) -> &[FlagId]
pub fn requires_flags(&self) -> &[FlagId]
The flags that must be set before this objective activates (v0.3).
Sourcepub fn forbids_flags(&self) -> &[FlagId]
pub fn forbids_flags(&self) -> &[FlagId]
The negative flag gate (DSL v0.6): flags whose being set suppresses
this objective. The dual of Objective::requires_flags.
Sourcepub fn requires_state(&self) -> &[StateCompare]
pub fn requires_state(&self) -> &[StateCompare]
The numeric gate terms (DSL v0.10, spec-0031): comparisons that must hold
before this objective activates. See StateCompare.
Sourcepub fn happening(&self) -> Option<&Happening>
pub fn happening(&self) -> Option<&Happening>
What this objective does to the story (DSL v0.8, spec-0025).
Sourcepub fn collect_container(&self) -> Option<&AnchorId>
pub fn collect_container(&self) -> Option<&AnchorId>
The container this objective ADOPTS (DSL v0.8), if it is a collect that
declares one: the anchor whose prefab-placed chest/barrel it fills instead
of conjuring its own chest. None on every other objective and on a
collect that keeps the compiler-placed chest.
Sourcepub fn collect_dropped_by(&self) -> Option<&WaveId>
pub fn collect_dropped_by(&self) -> Option<&WaveId>
The wave whose declared drops provide this objective’s item (DSL v0.9),
if it is a collect that declares one. None on every other objective
and on a collect fed by a container.
Sourcepub fn collect_fill_count(&self) -> u32
pub fn collect_fill_count(&self) -> u32
The padding-stack count of a collect (DSL v0.8); 0 for every other
objective and for a collect that fills the single required stack only.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Objective
impl<'de> Deserialize<'de> for Objective
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Objective
impl JsonSchema for Objective
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more