Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: The most effective way to program dialogue  (Read 5461 times)

0 Members and 1 Guest are viewing this topic.

deadworm222

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 197
  • Wintermute Army
    • View Profile
The most effective way to program dialogue
« on: June 21, 2004, 05:24:07 PM »

I have had hard time coding dialogue into the game. This is what the beginning of Jaf.script looks like at the moment (There's a character called Jaf in the game.)

Code: [Select]
// ===================================================================
// Some dialogue variables
global TalkedToJaf=false;

global AskedJafAboutFirst=false;
global AskedJafAboutSecond=false;
global AskedJafAboutThird=false;
global AskedJafAboutFourth=false;
global AskedJafAboutFifth=false;

global AskedJafAboutFirst_A=false;
global AskedJafAboutSecond_A=false;
global AskedJafAboutThird_A=false;
global AskedJafAboutFourth_A=false;
global AskedJafAboutFifth_A=false;

global AskedJafAboutFirst_A_a=false;
global AskedJafAboutSecond_A_a=false;

global AskedJafAboutFirst_A_b=false;
global AskedJafAboutSecond_A_b=false;

global AskedJafAboutFirst_B=false;
global AskedJafAboutSecond_B=false;

global AskedJafAboutFirst_C=false;
global AskedJafAboutSecond_C=false;
global AskedJafAboutThird_C=false;
global AskedJafAboutFourth_C=false;
global AskedJafAboutFifth_C=false;

global AskedJafAboutFirst_C_a=false;
global AskedJafAboutSecond_C_a=false;
global AskedJafAboutThird_C_a=false;

global AskedJafAboutFirst_D=false;
global AskedJafAboutSecond_D=false;
global AskedJafAboutThird_D=false;
global AskedJafAboutFourth_D=false;
global AskedJafAboutFifth_D=false;

global AskedJafAboutFirst_D_a=false;
global AskedJafAboutSecond_D_a=false;
global AskedJafAboutThird_D_a=false;

Is there an easier way?
Logged

Igorrr

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 130
  • Ugh...Ughugh!!!!!!
    • View Profile
    • Struggle For Life And Honour
Re: The most effective way to program dialogue
« Reply #1 on: June 21, 2004, 05:51:12 PM »

Hmmm well the only thing I could think of to keep the coding small is to use one array instead of many variables.
Logged

deadworm222

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 197
  • Wintermute Army
    • View Profile
Re: The most effective way to program dialogue
« Reply #2 on: June 21, 2004, 06:02:19 PM »

Our new programmer said that he could create a custom dialogue format using DLLs. ??? What are your thoughts, folks?
« Last Edit: June 21, 2004, 06:09:20 PM by deadworm222 »
Logged

Igorrr

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 130
  • Ugh...Ughugh!!!!!!
    • View Profile
    • Struggle For Life And Honour
Re: The most effective way to program dialogue
« Reply #3 on: June 21, 2004, 06:11:35 PM »

That might ease the writing of dialogues, but you still have to save that dialogue status in native variables.
What would be a really nice Idea is a dialogue writing tool. You could write your dialogue in their and have the tool save it in a WME compliant format.
Like exporting to a script file that you simply include in another script.
I have such a tool here for the first custom engine we used for SFLAH, but our programmer left so we abandoned writing our own engine.
But this tool helped a lot, so when I am starting to write a lot of dialogued maybe I will write a small tool for WME and post it here.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: The most effective way to program dialogue
« Reply #4 on: June 21, 2004, 07:07:55 PM »

Our new programmer said that he could create a custom dialogue format using DLLs. ??? What are your thoughts, folks?

Possibly, but the problem would be to find the right format to store the dialogue tree in. That's also the trouble with dialogue editors, because IMHO they can never be as flexible as a script.
How does your editor work, Igorrr?
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Igorrr

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 130
  • Ugh...Ughugh!!!!!!
    • View Profile
    • Struggle For Life And Honour
Re: The most effective way to program dialogue
« Reply #5 on: June 21, 2004, 09:55:22 PM »

Here's a link to the old SFLAH dialog editor:

http://www.igorrr.com/files/dialog_editor.ace

Well it's more than 2 years ago that I used it.
It actually has a very simple tree structure and differeintiates between first or following encounters.
I have no idea how our previous programmer planned to implement the usage of scripts and variables concerning
the dialogs.
Best take a look at it yourself.
Logged

ClémentXVII

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 18
  • Ralph the Wonder Llama
    • View Profile
Re: The most effective way to program dialogue
« Reply #6 on: December 16, 2004, 08:04:55 AM »

What about this:

Writing the dialogue in an XML format -->

* a dialogue schema would define how a dialogue can be written, and XML files would have to validate against that schema.
* sentences could have an attribute "condition", which is a numeric (hex?) code which could be checked against some variables that have been set before, in order to decide whether or not it is relevant to display the dialogue option

Having dialogues in XML format could even ease the development of dialogue (even without a real dialogue editor), by using an XML editor that is able to create a document from a schema.

The only thing that would then be needed, is to write a parser dll to display the dialogue correctly.

I'm currently researching an optimal schema, and if I found something good, I'll keep you posted! :D
Logged

MMR

  • Global Moderator
  • Frequent poster
  • *
  • Karma: 3
  • Offline Offline
  • Gender: Male
  • Posts: 349
  • http://mmrdeveloper.wordpress.com/
    • View Profile
    • TinyWME
Re: The most effective way to program dialogue
« Reply #7 on: December 16, 2004, 11:27:10 AM »

As ClémentXVII say, I think the XML way would be a good choice. You could write a XML file (with the right DTD that validates the XML file) and I think it should be faster than the way now is implemented. (faster in development; writing the dialogue file)
Logged
 

Page created in 0.046 seconds with 24 queries.