about advanced dialog

Nov 8, 2011 at 12:24 PM

Dear Colin Vella,

Just let you know that your Conscript is so cool. I love it very much. Although, I am not sure if you can see this post on time. I still want to ask how to create a dialog for player talking with NPC, in which player can choose different answers by themselves. Could you please give me some idea how to make it?

Nov 8, 2011 at 12:50 PM

I don't have much experience on RPG dialogue systems, although I did implement a very simple system within the Dungeon of Despair game demo for Conscript. This was only for scripted linear dialogue, and did not offer the player any choices however. You may want to look at this as a starting point.

First of all you need to write some engine-side code to display a dialog window and present narrative text and/or a choice of answers. You then need to expose some host functions to Conscript for things such as opening the dialog prompt with the text and/or answer choices. You can pass these as host function parameters. The dialog's close button or chosen answer could be linked to another host function much like an event handler is linked to a control in visual form programming. The parameter of such a function could be an index of the chosen answer, or null if no choices where presented. You can then keep some kind of global state within a script to keep track of the player's choices and progression within the game. 

Nov 8, 2011 at 3:43 PM

thank you for your quick and detail response.

I am planning to start from the Dungeon of Despair, it is the best game sample that I ever seen. I am not quite sure about writing engine-side code to display a dialog window. Do you mean that I need to modify Conscript. Or I should done it in the Dungeon of Despair?

Many Thanks

Nov 8, 2011 at 7:30 PM

No you don't need to modify Conscript itself.. you write the host functions in your game engine, and then register them with Conscript so you can call them from a script. Have a look at how the scripted conversations between characters are implemented in DoD and it should start making sense. Also have a look at this Codeproject article about Conscript. It should give you a good idea of how to use it.

Nov 8, 2011 at 9:56 PM

Thank you so much. You are awesome.

Nov 22, 2011 at 4:54 AM

I have done tha conversation dialog. Use mouse can have different answer choices. When you select one, conscript can have proper response. But this is only limited to the first scense. While I try to talking one of the Trolls, I am failed. I looked Troll.cns.  There is a loop in it. I cannot add anything to check status. (During conversation, NPC should stop walking and facing you).  Any ideas?  How to let them stop, and after conversation walking again.  

Nov 23, 2011 at 7:51 AM

One way of handling it would be to have a boolean variable in the Troll script that determines if the troll is moving about or not, for example "facingPlayer". Within the troll script, when this is set to true, the troll character can be turned to face the player, and not wander about. You can set this variable externally from your game code whenever the player character intracts with the troll. You can actually make this script more generic so it works for NPCs in general.

Nov 24, 2011 at 12:01 AM

thank you for your quick response.  I tried to put a boolean variable in the Troll script. It works, but all trolls stopped talking.  Maybe I need to add collision check in it.

Nov 24, 2011 at 7:46 AM
See my other post. Basically you need to define your flag within the main function not outside. If you define it outside, it will be shared by all instances of the script.

On 24 November 2011 02:01, yeeler <notifications@codeplex.com> wrote:

From: yeeler

thank you for your quick response. I tried to put a boolean variable in the Troll script. It works, but all trolls stopped talking. Maybe I need to add collision check in it.

Read the full discussion online.

To add a post to this discussion, reply to this email (conscript@discussions.codeplex.com)

To start a new discussion for this project, email conscript@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com