# mod $define(mod_gdlogue=) # Directives # For ergnomics, end array with nullified object # "$1," is necessary for the macro "m_webui" to operate $define(dial_begin= $tempto(gdlogue.json) $tempout({ "nodes": [ ) $redir(true) ) # Has trailing ] at the end which is paired # with Starting [ $define(dial_end= # This ends json structure $redir(false) $tempout(]}) $fileout(true,$path(cache,out.json),$tempin()) ) # ========== # Dialogue nodes # Start node $define(start_node,a_text a_goto= { "id": "start", "node_type": "Start", "goto": "$a_goto^()", "text": "$a_text()", "speaker": null, "selections": null, "branches": null },) # End node # End node doesn't have trailing comma , because it is end node $define(end_node,a_text= { "id": "end", "node_type": "End", "goto": null, "text": "$a_text()", "speaker": null, "selections": null, "branches": null }) # Text node $define(text_node,a_id a_text a_goto a_speaker= { "id": "$a_id^()", "node_type": "Text", "goto": "$a_goto^()", "text": "$a_text()", "speaker": "$a_speaker()", "selections": null, "branches": null },) # Omit node $define(omit_node,a_id a_goto a_speaker= { "id": "$a_id^()", "node_type": "Omit", "goto": "$a_goto^()", "text": "", "speaker": "$a_speaker()", "selections": null, "branches": null },) # Selection node $define(sel_node,a_id a_text a_speaker a_sel_first a_sel_others= { "id": "$a_id^()", "node_type": "Selection", "goto": null, "text": "$a_text()", "speaker": "$a_speaker()", "selections": [ $a_sel_first(), $a_sel_others() ], "branches": null },) # Selection iem $define(sel,a_text a_goto={ "text": "$a_text()", "goto": "$a_goto^()" }) # Branch node $define(branch_node,a_id a_branch_first a_branch_other= { "id": "$a_id()", "node_type": "Branch", "goto": null, "text": "", "speaker": null, "selections": null, "branches": [ $a_branch_first(), $a_branch_other() ] },) # Branch item $define(branch,a_target a_qual a_goto={ "target": "$a_target()", "qual": "$a_qual()", "goto": "$a_goto^()" })