renamed main ink loop to postfix _d_end instead of main to make its point more obvious

This commit is contained in:
Sokomine 2024-12-26 16:11:13 +01:00
parent 28c3e7eed9
commit 8456a10107

View File

@ -120,7 +120,7 @@ yl_speak_up.export_to_ink.print_choice = function(lines, choice_text, n_id, star
divert_to = tostring(start_dialog)
elseif(divert_to == "d_end" or divert_to == tostring(n_id).."_d_end") then
-- go back to choosing between talking to NPC and end
divert_to = tostring(n_id).."_main"
divert_to = tostring(n_id).."_d_end"
elseif(string.sub(divert_to, 1, 2) ~= "n_") then
-- make sure it is prefixed with the n_id
divert_to = tostring(n_id).."_"..tostring(divert_to)
@ -391,9 +391,13 @@ yl_speak_up.export_to_ink_language = function(dialog, n_id)
start_dialog = tostring(n_id).."_"..tostring(start_dialog)
end
local main = tostring(n_id).."_main"
local tmp = {"-> ", main,
"\n=== ", main, " ===",
-- go to the main loop whenever the player ends the conversation with the NPC;
-- this allows to create an additional dialog in INK where the player can then
-- decide to talk to multiple NPC - or to continue his conversation with the
-- same NPC
local main_loop = tostring(n_id).."_d_end"
local tmp = {"-> ", main_loop,
"\n=== ", main_loop, " ===",
"\nWhat do you wish to do?",
"\n+ Talk to ", tostring(dialog.n_npc), " -> ", tostring(start_dialog),
"\n+ End -> END"}
@ -499,7 +503,7 @@ yl_speak_up.export_to_ink_language = function(dialog, n_id)
end -- dealt with the option
-- add way to end talking to the NPC
ink_export.print_choice(tmp, "Farewell!", n_id, start_dialog,
nil, tostring(n_id).."_main", false, nil, dialog_names)
nil, tostring(n_id).."_d_end", false, nil, dialog_names)
-- add the knots for actions and effects for this dialog and all its options:
for _, line in ipairs(tmp2) do