diff --git a/fs_initial_config.lua b/fs_initial_config.lua index 469aa21..239ddc5 100644 --- a/fs_initial_config.lua +++ b/fs_initial_config.lua @@ -151,7 +151,8 @@ yl_speak_up.input_fs_initial_config = function(player, formname, fields) -- create a new dialog f.d_id = yl_speak_up.text_new_dialog_id -- ...with this text - f.d_text = "$GOOD_DAY$ $PLAYER_NAME$,\nI am $NPC_NAME$. I don't know much yet.\n".. + f.d_text = "$GOOD_DAY$ $PLAYER_NAME$,\n".. + "I am $NPC_NAME$. I don't know much yet.\n".. "Hopefully $OWNER_NAME$ will teach me to talk soon." -- it is the first, initial dialog f.d_sort = "0" @@ -160,10 +161,39 @@ yl_speak_up.input_fs_initial_config = function(player, formname, fields) f.npc_owner = yl_speak_up.npc_owner[ n_id ] -- create and save the first dialog for this npc local dialog = yl_speak_up.fields_to_dialog(pname, f) + + -- add example answers and dialogs; they may be irritating for experienced + -- users, but help new users a lot in figuring out how the system works + -- + -- first, we create three example dialogs as such: + -- (the first one has already been created in the creation of the dialog; + -- yl_speak_up.fields_to_dialog stores d_id in yl_speak_up.speak_to[pname].d_id) + local new_d_1 = "d_1" + local new_d_2 = yl_speak_up.add_new_dialog(dialog, pname, "2", + "I'm glad that you wish me to talk to you.\n\n".. + "I hope we can talk more soon!") + local new_d_3 = yl_speak_up.add_new_dialog(dialog, pname, "3", + "Oh! Do you really think so?\n\n".. + "To me, talking is important.") + -- we are dealing with a new NPC, so there are no options yet + -- options added to dialog f.d_id: + local new_d_1_o_1 = yl_speak_up.add_new_option(dialog, pname, nil, + "d_1", "I hope so as well!", new_d_2) + local new_d_1_o_2 = yl_speak_up.add_new_option(dialog, pname, nil, + "d_1", "No. Talking is overrated.", new_d_3) + -- options added to dialog new_d_2: + local new_d_2_o_1 = yl_speak_up.add_new_option(dialog, pname, nil, + "d_2", "Glad that we agree.", new_d_1) + -- options added to dialog new_d_3: + local new_d_3_o_1 = yl_speak_up.add_new_option(dialog, pname, nil, + "d_3", "No. I was just joking. I want to talk to you!", new_d_2) + local new_d_3_o_2 = yl_speak_up.add_new_option(dialog, pname, nil, + "d_3", "Yes. Why am I talking to you anyway?", "d_end") + -- save our new dialog yl_speak_up.save_dialog(n_id, dialog) yl_speak_up.speak_to[pname].dialog = dialog dialog.n_may_edit = {} - + -- now connect the dialogs via results yl_speak_up.log_change(pname, n_id, "Initial config saved. ".. "NPC name: \""..tostring(fields.n_npc)..