There are so much stuff on kdev, I am bored searching for that "dialog lump"; what if we reorganise kdev contents at once?
Anyway, here's my proposal on how dialog script could look like:
Code:
#person
name=$<localized string>
pic=
<other data here>
#hello
switch=<switch number local>[, <switch number global>]
text=$<localized string>
#bye
switch=<switch number>[, <switch number global>]
text=$<localized string>
#replica
switch=<switch number>[, <switch number global>]
text=$<localized string>
answerid=<answer id (number)>
#answer <id>
switch=<switch number>[, <switch number global>]
text=$<localized string>
trigger local <switch number>[, <switch number>, ...]
trigger global <switch number>[, <switch number>, ...]
script <map number> <script number>
[some other actions]
Example:
Code:
#person
"Legion Officer"
PIC101
#hello
0
"Hail, warrior"
#bye
0
"Fare thee well"
#replica
0
"Hi, how are you?"
1
#replica
0
"Do you have any quests for me?"
2
#answer 1
0
"I am fine, thank you"
#answer 2
!1
"Not this time, come again later"
#answer 2
1
"Yes, I've got one task for you"
So, we have 4 types of entries here: 'hellos',"byes", "replicas" and "answers".
Hellos are person's phrases said when conversation commences, byes - when it ends.
Replicas are available player sentences. Answers are NPC's replicas.
Availability is controlled by SWITCHES (kind of boolean variables). They could be global or local (that affect only this current NPC) for convenience. In the sample above player's replica "Do you have any quests..." have 2 possible answers, first available if switch 1 is OFF ( '!1' means "NOT 1"), second available when switch 1 is ON. Assuming switch 1 is OFF initially, switch 1 could be set ON, so answer changes from #1 to #2.
Every entry can have additional commands activated when the phrase "comes into play"; commands could be switch toggling, script running etc whatever, like displaying shop buy/sell menu like:
Code:
#hello
display shop
Shop contents could be defined in same script, in #person entry, as well as initial amount of gold as similar things.