Staff
Admin: Ravon
E-mail: RavonTUS@Yahoo.com
AIM: RavonTUS
 Server Status
Player Log - You Just Missed?
Who's On-line
The Book of Kills
An Nox's Bestiary
 Connect
Connect Using CUO
Download ConnectUO
Download UO Launcher
 Links
How to Get Started
Download Ultima Online
UO Player Guide
An Nox Forum
Add to Google Reader or Homepage
 Archives
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
October 2006
November 2006
January 2007
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
November 2009
December 2009
May 2010
   
 

      There was a time when I sought to leave this world and for a while I did, fleeing the poisonous rune it made of my life...

      ...but the power of this world has pulled me back in. The evil, the poison with-in shall not be quickly cured.

Thursday, May 18, 2006

Dialog NPC by Arya

Summary:
This NPC can be used to create dialogs such as those in classical single player RPGs. The creation of the dialogs is done through an external program which produces a datafile that if positioned correctly within the RunUO folder allows the NPC to reconfigure itself on the fly, without rebooting the server.

The dialog script supports also invokation of custom code whenever a player chooses an option on the dialog gump.

Description:
This NPC is an evolution of the Conversational NPC I posted some time ago. It's more complex in its functionality though and much more powerful.

The NPC simulates dialogs with players with multiple choice answers (such as those seen in classical Ultima games). The dialog itself is created through an external program called DialogEditor, provided in the download package. The whole conversation is carried through a gump displaying the NPC speech, and a number of choices the player can make in response (limited to 8).

The NPC can be configured on the fly, so it doesn't need a server reboot to apply a new dialog. The XML files containing the dialog configuration must be placed in a well known folder within the RunUO main directory (by default RunUO\TheBox\Dialog), and once they're in a staff member only needs to double click the NPC to access the dialog selection gump (which will display only the name of the XML file, not the full path).

The dialog structure can be as complex as it gets, and I tried to do my best to make creation and editing user friendly. I have written a comprehensive readme file for the DialogEditor program (in the download package) which explains everything you need to know to produce dialogs.

Probably the most powerful feature of this NPC is the ability to interact with your code without actually recoding the NPC itself. Whenever a player chooses a response to whatever the NPC said, the dialog can be configured to dynamically call a function in an external script (provided the function has a specified signature, refer to the DialogEditor readme file for details).

I have provided two very simple samples of what this script can do:

- Thief: whenever a player with over 5000 gold in their backpack approaches this NPC, a dialog will start, leading inevitably to either the player donating the thief some money, or the thief stealing if the player refuses.

- Travel: this is a NPC that will teleport the player to either Britain or Trinsic for a price of 500 gc. If you drop 500 gc on the NPC it will ask you where you wish to go, if you double click it, it will first explain its function and then ask you if you agree to pay (if you say yes, but don't have the money in your bank the NPC will kill you when you try to travel).

Refer to the installation section for information on how to install or remove the samples.

As usual any feedback is appreciated, not working on a shard makes it quite hard to decently test things so please report any issues you might find and I'll try to address them asap.

Installation:
The package you download will contain 3 folders:

- DialogEditor : this is the program used to create the dialogs. As all my programs, this requires the .NET framework 1.1 to run. This folder also contains DialogEditor.html, the readme file with instructions for the program.
- Samples : these are the XML files for the two situation described above. By default put them into ..\RunUO\TheBox\Dialog and they will be accessible by the NPC when the server starts.
- Script : this folder holds all the files needed for the NPC to operate on the server and should be placed within your Scripts folder. If you don't wish to use the samples provided, delete the DialogNPC\Samples folder as they only contain support classes for the Thief and Travel dialogs.

If you wish to change the target folder for the XML files, you can do so by editing DialogNPC.cs. The option is right at the beginning of the file (remember, all folders are realtive to the core RunUO folder).

When you start the server use:

[add DialogNPC

to create the NPC. Double click it to access the list of available dialogs. Refresh the gump, if you add or remove XML files from the dialog folder to see the changes.

Updates

June 19 (1.1):
- Fixed bug where the player wasn't removed from the current user list and therefore couldn't initiate a new dialog.
- Changed the way the item-in-backpack trigger is handled by the NPC. Now the check is done just once, when the player enters the NPC's range, so the player will no longer receive the gump multiple times when moving around the NPC.

May 18, 2006:
This zip contain some of the quests from An Nox. Enjoy.

Download
http://geocities.com/ravontus/DialogNPC/dialognpc.zip

Posted by Ravon @ 8:23 AM

  
 
 
 
 
 
Shard Info:
annox.no-ip.com;2593
 
Vote:
Help Increase Players by Voting for An Nox
 
Vote for An Nox
 
Ultima+Online Private Servers
 
private server
 
Top 100 Ultima Online sites
 
Vote on the Ultima Online Top 200
 
E-Items.com Gaming TopSites List
 
Ultima Online Free server
Ultima Online Free server
 
Top Ultima Online sites