35 | | == Create a proper dialogue == |
36 | | For each answer you may define a next question as a followup. For example: |
| 45 | == Adding Text to your Dialog == |
| 46 | A dialog without text would be prettey boring so we now will add text for the npc you are talking to and some replies. |
| 47 | In the interface a question is always some text the npc says and an answer is one possible option for the player to reply. |
| 48 | By linking the answers to a next question you can define how the npc reacts to the player saying someting. For the player you simply give the question all ids of the possible answers he could give. |
| 49 | You need to give each question and each answer a unique id but multiple answers can lead to the same question and multiple questions can give the same answer as an option. |
| 50 | |
| 51 | Structure of question section: |
| 52 | {{{ |
| 53 | ... |
| 54 | <questions> |
| 55 | <Question Id= "someQuestion" question= "this is where you add the text you want to let the npc say"> |
| 56 | <answerIds> |
| 57 | <AnswerId Id= "someAnswerId"> |
| 58 | <AnswerId Id= "maybeSomeOtherOptions"> |
| 59 | <AnswerId Id= "haveAsManyAsYouWant> |
| 60 | <AnswerId Id= "orNoneThatsOkayToo"> |
| 61 | </answerIds> |
| 62 | </Question> |
| 63 | |
| 64 | ... list all questions in this area with the template from above |
| 65 | </questions> |
| 66 | ... |
| 67 | }}} |
| 68 | |
| 69 | By giving no answerIds you can end the Dialog with a npc text. |
| 70 | |
| 71 | |
| 72 | Structure of answer section: |
| 73 | {{{ |
| 74 | ... |
| 75 | <answers> |
| 76 | <Answer Id= "someAnswerId" nextQuestionId ="someQuestionId" answer= "this is where you add the text you want to give as a possible response" > |
| 77 | |
| 78 | ... list all answers in this area with the template from above |
| 79 | </answers> |
| 80 | ... |
| 81 | }}} |
| 82 | |
| 83 | If you want to end the dialog on a player response simply chose a nextQuestionId that does not exist, best would be to always use the same (for example "end") but any string that is not a questionId will do. |
| 84 | |
| 85 | For both Question and Answer class it is possible to rearange the arguments but for readability and ease of use i recomend always defining ids befor text. |
| 86 | |
| 87 | == Example of a simple dialog == |
| 88 | This is a simple example how everything together could look like but there are many more possibilities to use this structure. |
| 89 | (And probably more creative texts for those too) This can also be found in the DialogShowcase level to test it directly. |
39 | | <NextQuestion question="Your question" a1="First answer" a2="Second answer" > |
40 | | <possibleQuestions> |
41 | | <NextQuestion question="Your next question if a1 was chosen" a1="First answer" a2="Second answer" /> |
42 | | <NextQuestion question="Your next question if a2 was chosen." a1="First answer" a2="Second answer" /> |
43 | | </possibleQuestions> |
44 | | <events> |
| 92 | <Dialog name="Kurt" currentQuestionId="loop1"> |
| 93 | <questions> |
| 94 | <Question Id="loop1" question="Wanna be looped?" > |
| 95 | <answerIds> |
| 96 | <AnswerId Id="yes"/> |
| 97 | <AnswerId Id="no"/> |
| 98 | <AnswerId Id="giveItToMe"/> |
| 99 | </answerIds> |
| 100 | </Question> |
| 101 | <Question Id="lorem" question="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." > |
| 102 | <answerIds> |
| 103 | <AnswerId Id="endIt"/> |
| 104 | </answerIds> |
| 105 | </Question> |
| 106 | <Question Id="loop2" question="Wanna be looped again?" > |
| 107 | <answerIds> |
| 108 | <AnswerId Id="yes"/> |
| 109 | <AnswerId Id="no"/> |
| 110 | <AnswerId Id="end"/> |
| 111 | </answerIds> |
| 112 | </Question> |
| 113 | <Question Id="ok" question="Guess not then"/> |
| 114 | </questions> |
| 115 | <answers> |
| 116 | <Answer Id="giveItToMe" answer="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." nextQuestionId="lorem"/> |
| 117 | <Answer Id="yes" answer="yeah loop me" nextQuestionId="loop2"/> |
| 118 | <Answer Id="no" answer="i'd rather not" nextQuestionId="ok"/> |
| 119 | <Answer Id="endIt" answer="i will go now..." nextQuestionId="end"/> |
| 120 | </answers> |
| 121 | <events> |