RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Dialog NPC

Arya

Wanderer
Apparently the stupid hotel gateway is blocking all posts larger than a given size, so here's the most concentrated changlog I can come up with:

- Outfit/Properties configuration. (Appearance, skills, stats, damages, mount and more)
- Unicode encoding for Russian/Chinese languages
- Custom initialization and trigger functions (check the readme for details)
- DialogName property can be set for use with spawners
- Fixed editor crash when used with other languages
- Custom properties can be set (even if they belong to a class derived from DialogNPC)
 

rasic

Wanderer
Are the XML files included in that link about 4 post above? I just see 'Dialog Editor' and 'DialogNPC Scripts' and of course that readme
 

Arya

Wanderer
Yes I forgot to add the XML samples. I'll try to update later.

Also I forgot to add that the new version is completely compatible with your older datafiles.
 

Suffering

Wanderer
Umm, am I blind or is there no download? (lol) i looked for like 10 mins...:p
Can't wait to try this out tho, your scripts totally amaze me.
~I bet you were sleepy and forgot when you updated~
:D


"If you want to build a ship, don't herd people together to collect wood and don't assign them tasks and work, but rather teach them to long for the endless immensity of the sea." --Antoine de Saint-Exupery
 

Suffering

Wanderer
I searched and searched for the " link " and it took me almost an hour of reading this thread over and over and over.... to notice the "display" mode....I switched to Linear and then could see all the posts and find the link.
In the Hybrid mode ( which I dont even know how it got changed to hybrid) I couldn't even see the post with the link.
So, I apologize for asking you my meanial question...I was about two seconds from giving up the search because I felt stupid for not being able to find the link. But I truly could not even find the post in the display mode I somehow had on.



"If you want to build a ship, don't herd people together to collect wood and don't assign them tasks and work, but rather teach them to long for the endless immensity of the sea." --Antoine de Saint-Exupery
 

bizbol

Wanderer
Thank you, Arya.

Thanks for the update and having included my custom trigger request. Also, the outfit feature is a really nice addition. What can I say? Great job, as usual! :D
 

steamin

Wanderer
In DialogEditor.exe
- If you delete the topmost choices it will not save the guid for new top-entry.
- MoveUp works not everytime. In DialogEditor it move up but not in the DialogNPC dialog.
 

Smile_zjm

Wanderer
Arya said:
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.

good job
 

Scifer_12

Wanderer
Help

Hello I really like your editior but i got a question once i have finsihed a quest thing and i save where do i place the file i have tryed in my server file but it doesnt find it please help me
 

Arya

Wanderer
You must place the xml files on the server machine, by default in the RunUO\TheBox\Dialog folder (this can be changed in the script though). Once you do that, double click a DialogNPC and you will get a configuration panel where you can choose the datafile you wish to use for it.
 

Arya

Wanderer
The folder is:

RunUO\TheBox\Dialog

so you if your file is Test.xml the full path will be:

RunUO\TheBox\Dialog\Test.xml
 

Dagor

Wanderer
Awesome script, Arya. I have one request, though: is it possible to have the dialog triggered by item name in addition to type? It's much simpler to add, say, a head and rename it to "Head of Crombie" rather than coding a whole new item from scratch. :)
 

Jackmorsey

Sorceror
Cant get property to work

Hey Arya,

Your program has been quite awesome for my shard, but there is one problem. I can't seem to get the property "CantWalk=true" to work. I've tried all sorts of ways but it seems the npc always runs away! :b Even when manually doing it after setting dialogNpc up, after a server restart he will be walking again.

Thanx

Jack
 
Top