πCreate Dialog
Creating Dialogs
1. Dialog Structure
exports['koja-dialogs']:CreateDialog({
id = "<unique_dialog_id>",
npc = "<npc_model>",
coords = vector4(<x>, <y>, <z>, <heading>),
name = "<npc_display_name>",
message = "<initial_npc_message>",
tag = "<display_tag_above_npc>",
animations = {
{ type = "<animation_type>", dict = "<animation_dict>", anim = "<animation_name>" },
{ type = "<animation_type>", dict = "<animation_dict>", anim = "<animation_name>" }
},
actions = {
{
label = "<button_label>",
player_message = "<message_player_says>",
onclick = {
message = "<npc_response_after_selection>",
actions = {
{ ... } -- nested actions for more dialogue branches
},
open = {
window = "<window_type>", -- "shop", "market" or "crafting"
data = {
-- depends on window type
}
}
},
close = <boolean> -- close dialog after clicking?
},
-- more actions
}
})2. Shop Window
3. Market Window
4. Crafting Window
5. Summary of Fields and Window Differences
Field / Context
Shop
Market
Crafting
Last updated