View Single Post
  #1  
Old 02-11-2007, 10:44 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
RPG Dialog System

Oi, I created this thread so I can get some comments on an RPG Dialog system that I'm creating and planning to release to the public or whoever wants it, on the condition that they share all changes with everyone of course.

Anyhow this system is based completely off of the Dialog Systems featured in Morrowind and Oblivion of The Elder Scrolls series, if you don't know what that is I suggest you check it out

I myself have seen the extent of the dialog featured in Morrowind and I would like to see something similar featured in Graal as I'm an RPG fanatic and such.
Basically the dialog will give you a choice of topics to ask about. The response you get for each topic can depend on one or more conditions. Topics can also have multiple responses with scripts attached to them that only trigger when that response is given. Topics and TopicLists are stored in text files on the server.

Now, the dialog system is no doubt complex although not too extensively so, I've done my best to make it as customizable as possible and for that reason functions that are parsable or are used by the dialog system to interact with systems outside of the dialog system itself must be defined in the DialogControl.

For example, if you want a topic to give you a new item or so when it evaluates to true, then you would have something like this in the topic file:
resp2.script1=AddItem,50,gold
In file; responses, conditions, and scripts are numbered by index so that line is defining the second script of the third possible response for whatever topic.
If that response is the one thats given then a function will be called:
DialogControl.pfn<functionname>(params); and in this case:
DialogControl.pfnAddItem(50, gold);

Servers have their own systems to handle items so thats why you have to define that function for yourself.
Topic files are parsed initially and constructed into TStaticVar objects on the serverside.

Anyhow I'm making good progress on the system, and its turned out to be far easier than I expected due to the greatness of object-oriented programming.

And as I have nothing more to say, I will point you to the screenshots attached to this post. The first screenshot shows the result of selecting the topic Arkland for the first time and as a result of the script you're given 50 gold coins by the NPC and a message appears on the screen informing you of that fact. After that, sfnSetReadTopic() will be called, so as defined by the topic, the next time you request it, the responses will be evaluated and you will end up with a different message from there on.

The second screenshot is just showing the choice response option, basically when a choice is active you can only chose one of the choices (topic links) listed under the response text and you continue on from there. I have yet to write enough topics to really show that feature off though.

The third screenshot is of what I'm basing this system off of.

Suggestions and constructive criticisms are welcome.

Note: I just realized due to the spell checking in this thing that I had spelled response wrong in my scripts ;-;
Note2: Spelled received wrong too >_>
Attached Thumbnails
Click image for larger version

Name:	arkland_dialog1.jpg
Views:	378
Size:	157.8 KB
ID:	39509   Click image for larger version

Name:	arkland_dialog2.jpg
Views:	330
Size:	37.4 KB
ID:	39510   Click image for larger version

Name:	obdialogsys.jpg
Views:	346
Size:	152.6 KB
ID:	39511  
__________________

Last edited by Inverness; 02-11-2007 at 11:03 PM..
Reply With Quote