Skip to content

ItemDefinitionQuest ​

Inherits: ItemDefinition < DatabaseResource < Resource

Quest-related items that trigger quests or serve as quest objectives. These items integrate with the quest system for story progression and player objectives.

Description ​

Quest items can:

  • Grant a quest when used (triggers_quest = true)
  • Be required for quest objectives (quest_id set, triggers_quest = false)
  • Auto-remove when their associated quest is completed
  • Drop (from loot) and exist only while their quest is running (availability)

Properties ​

intquest_id0
boolauto_use_on_pickupfalse
booltriggers_questfalse
boolremove_on_quest_completetrue
AvailabilityavailabilityAvailability.ALWAYS
BagSpacebag_spaceBagSpace.IN_THE_BAG

Methods ​

boolis_kept_aside()
boolis_quest_completed( system_hub: GameHost.SystemHub )
boolis_quest_active( system_hub: GameHost.SystemHub )
boolis_quest_running( system_hub: GameHost.SystemHub )
boolcan_drop_now( system_hub: GameHost.SystemHub )
boolmust_leave_now( system_hub: GameHost.SystemHub )
boolshould_auto_remove( system_hub: GameHost.SystemHub )
boolcan_use( user: Entity, item_instance: ItemInstance = null )
Stringget_quest_usage_failure_reason( user: Entity, item_instance: ItemInstance )
boolexecute_use( user: Entity, item_instance: ItemInstance )
Stringget_use_action_name( _item_instance: ItemInstance )
voidon_quest_item_used( item_instance: ItemInstance, user: Entity )
Array[Dictionary]validate()

Enumerations ​

enum Availability ​

When the item can drop and how long it may stay in a bag

  • ALWAYS = 0
  • DROPS_WHILE_QUEST_ACTIVE = 1
  • EXISTS_WHILE_QUEST_ACTIVE = 2

enum BagSpace ​

Where the item lives in a bag

  • IN_THE_BAG = 0
  • KEPT_ASIDE = 1

Property descriptions ​

int quest_id = 0 ​

ID of the quest this item relates to in the quest database

bool auto_use_on_pickup = false ​

Whether to automatically use/trigger this item when picked up by the player

bool triggers_quest = false ​

Whether using this item starts a new quest

bool remove_on_quest_complete = true ​

Whether to auto-remove this item when the associated quest is completed

Availability availability = Availability.ALWAYS ​

When the item can drop, and whether it only exists while the quest is running

BagSpace bag_space = BagSpace.IN_THE_BAG ​

Where the item lives in a bag: in a slot, or kept aside (no space taken)

Method descriptions ​

bool is_kept_aside() ​

Is the item kept aside, out of the bag?

bool is_quest_completed( system_hub: GameHost.SystemHub ) ​

Check if the associated quest is completed

bool is_quest_active( system_hub: GameHost.SystemHub ) ​

Check if the associated quest is active

bool is_quest_running( system_hub: GameHost.SystemHub ) ​

Is the quest running now (accepted, or done and waiting to be handed in)? Read from the quest itself, so it is already true while the start actions of the quest run (a quest that gives its own item when it starts). With no quest set, or no event manager (the editor), the answer is "yes": nothing is held back

bool can_drop_now( system_hub: GameHost.SystemHub ) ​

Can loot give this item now? (see Availability)

bool must_leave_now( system_hub: GameHost.SystemHub ) ​

Must this item leave the bag now? True for an item that only exists while its quest runs, when it does not run

bool should_auto_remove( system_hub: GameHost.SystemHub ) ​

Check if this item should be removed (quest completed)

bool can_use( user: Entity, item_instance: ItemInstance = null ) ​

Check if quest item can be used

String get_quest_usage_failure_reason( user: Entity, item_instance: ItemInstance ) ​

Get why quest item can't be used (for UI feedback)

bool execute_use( user: Entity, item_instance: ItemInstance ) ​

Execute quest item usage - handle quest triggers

String get_use_action_name( _item_instance: ItemInstance ) ​

Get display name for quest action

void on_quest_item_used( item_instance: ItemInstance, user: Entity ) ​

Virtual method for quest-specific logic when item is used Called by ItemInstance after successful usage

Array[Dictionary] validate() ​

Checks the settings. Gives the problems found (empty when it is fine).