does anyone know how to make a dialog where the npc will respond 4 ways based on whether i have neither item, 1 of the required items or both.
none - need both
sword - need shield
shield - need sword
both - have both!
ive been able to get it so that if i have neither and then one item it works. but when i try to get both, or either, i either cant get it to work or i get 2 dialogs trying to play at the same time (need this and need both)
ive tried setting things like below, but after this i dont know where im going, or if this even right to begin with
If anyone can help I'd appreciate it
none - need both
sword - need shield
shield - need sword
both - have both!
ive been able to get it so that if i have neither and then one item it works. but when i try to get both, or either, i either cant get it to work or i get 2 dialogs trying to play at the same time (need this and need both)
ive tried setting things like below, but after this i dont know where im going, or if this even right to begin with
Code ( lua) Select
local shield_search_quest_started = false
local sword_search_quest_started = false
local items_search_quest_started = false
local has_sword = game:has_item("sword")
if has_sword then
game:set_value("sword_search_quest_started", true)
end
local has_shield = game:has_item("shield")
if has_shield then
game:set_value("shield_search_quest_started", true)
end
local has_both = game:has_item("shield" and "sword")
if has_both then
game:set_value("items_search_quest_started", true)
end
-- Guy3
function Guy3:on_interaction()
if game:get_value("sword_search_quest_started") then
game:start_dialog("Guy3.has_sword")
else
game:start_dialog("Guy3.search")
end
end
-- the other 2 dialogs would be
-- "Guy3.has_shield"
-- "Guy3.found"
If anyone can help I'd appreciate it