Skip to content

CraftingInteraction ​

Inherits: Interaction < Resource

Crafting interaction that opens the crafting interface when activated Can be attached to NPCs, Crafting Tables, or other interactive objects Updated to use CraftingJob's existing timer system instead of redundant timers

Properties ​

intcraft_school_id0
boolrequires_personal_materialstrue
SFXSelectioncraft_open_sfx
AnimationSelectionSocialcraft_interaction_animation

Variables ​

boolcrafting_is_activefalse
Playercurrent_crafter
Array[CraftingJob]active_jobs[]
CraftingRecipeDefinitionlast_selected_recipenull

Methods ​

boolcan_interact( player: Player )
voidstart_interaction( player: Player )
voidend_interaction()
boolstart_craft( recipe: CraftingRecipeDefinition, player: Player, quantity: int = 1 )
boolcancel_craft( recipe: CraftingRecipeDefinition, player: Player )
Array[CraftingJob]get_active_crafts()
CraftSchoolDefinitionget_craft_school()
Array[CraftingRecipeDefinition]get_available_recipes_for_player( player: Player )
Dictionaryget_station_summary()
boolis_station_in_use()
voidcleanup()

Property descriptions ​

int craft_school_id = 0 ​

Which craft school is available at this crafting station

bool requires_personal_materials = true ​

If true, player must have materials in their inventory, if false can access storage

SFXSelection craft_open_sfx ​

Optional audio to play when opening crafting interface

AnimationSelectionSocial craft_interaction_animation ​

Optional animation to play when crafting interface opens

Variable descriptions ​

bool crafting_is_active = false ​

Whether the crafting interface is currently active

Player current_crafter ​

Reference to the player currently crafting (if any)

Array[CraftingJob] active_jobs = [] ​

Currently active crafting jobs at this station

CraftingRecipeDefinition last_selected_recipe = null ​

Remember the last selected recipe for this station

Method descriptions ​

bool can_interact( player: Player ) ​

Check if the player can interact with this crafting station

void start_interaction( player: Player ) ​

Start the crafting interaction - opens the crafting UI

void end_interaction() ​

End the crafting interaction - closes the crafting UI

bool start_craft( recipe: CraftingRecipeDefinition, player: Player, quantity: int = 1 ) ​

Start a craft at this station

bool cancel_craft( recipe: CraftingRecipeDefinition, player: Player ) ​

Cancel a craft at this station

Array[CraftingJob] get_active_crafts() ​

Get all active crafts at this station

CraftSchoolDefinition get_craft_school() ​

Get the craft school for this station

Array[CraftingRecipeDefinition] get_available_recipes_for_player( player: Player ) ​

Get all recipes available at this station for a player

Dictionary get_station_summary() ​

Get crafting station summary for UI display

bool is_station_in_use() ​

Check if station is currently in use

void cleanup() ​

Give the timer back (the object is going away)