by dja » Mon Feb 01, 2010 9:32 am
Unfortunately I didn't achieve nearly as much as I would have liked.
I have created a Talk script, which can be connected to any NPC, this gives them the ability to talk. You then connect dialogue scripts to the NPC to give them things to say, and you can connect Link scripts to the NPC and connect dialogue scripts to them, to have topics in each dialogue.
It is quite confusing, but think of it as having 2 dialogue scripts, one which greets the user, the other tells them about a topic. Dialogue script 1 has 1 topic, so there is 1 link script, that is connected to it. The other dialogue script describes the topic, but has no links, and therefore has no link script.
When a player clicks on the NPC (within range) the talk script is run, and automatically pulls all the information together. It is important to ensure the linkId in the link script is for the correct dialogue script, and that the dialogue script has a unique id.
I also got the text to wrap (an issue I was having with the build I sent Macar yesterday).
I promise to do some screenshots when I have implemented trading, but I got carried away with conversations, when I wanted to make it extensible for multiple NPCs to chat, allowing them to say the same statements about topics, but not have to write scripts for NPC that speaks.
Hopefully someone will have done some icon textures for things to trade with NPCs by the time I get chance to implement trade.
I have some textures for implementing damage UI (thanks Thogrim), but I didn't get chance to implement it yet (its 2.30am now, and I have to be up at 6).
--
dja