Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Pages: 1 [2]  All

Author Topic: Complex dialog systems  (Read 9990 times)

0 Members and 1 Guest are viewing this topic.

lefthandblack

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 8
    • View Profile
Re: Complex dialog systems
« Reply #15 on: March 30, 2008, 12:29:55 AM »

Yeah, that did it.
Thanks, I really appreciate the help, I was starting to get frustrated.

With that problem out of the way, now I can start working on how to actually parse the files.
Logged

lefthandblack

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 8
    • View Profile
Re: Complex dialog systems
« Reply #16 on: March 30, 2008, 05:21:22 PM »

Well, I finally worked it out. Thanks to everyone that helped.
I went back to a system that uses arrays and after a lot of trial and error, it now works exactly as I intended.
I wrote a parser in C++ at the same time I wrote my NPC app and it was actually just a matter of pasting my C++ code into WM and changing commands as appropriate.

For anyone that's interested:

This is what I'm using to search and match strings in my arrays.
Code: [Select]
// SEARCH FOR MATCH
function Search(){
 for (var A = 0; A < myArray1.Length; A = A + 1)
           {
myStringVariable1 = (myArray1[A]);
if (myStringVariable1 == myStringVariable2){
myMatchedString = new String(myArray2[A]);
                          Sleep (1);
Game.Msg(myMatchedString);
}
           }
}

The only caveat is that you have to know how many lines are in your text files and put a for-loop in the section where you are importing them:
Code: [Select]
// READ TEXT FILES AND STORE CONTENT IN ARRAYS
function TextToArray(){
myFile1.OpenAsText(1);
myFile2.OpenAsText(1);
for (var a = 0; a < 4; a = a + 1){
myArray1.Push(myFile1.ReadLine());
myArray2.Push(myFile2.ReadLine());
Sleep (1000);
     }
}

Where 'a' is the number of lines in your file.
Logged

Jyujinkai

  • Global Moderator
  • Frequent poster
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 352
    • View Profile
    • Jyujinkai's WME Development Blog
Re: Complex dialog systems
« Reply #17 on: March 30, 2008, 06:05:57 PM »

wow great stuff.. would love to see a tech demo of this in action!!!
Logged
<Antoine de Saint-Exupéry> In any thing at all, perfection is finally attained not when there is no longer anything to add, but when there is no longer anything to take away...
<Carl Sagan> If you want to make a apple pie from scratch. You must first... invent the universe

manarius

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 27
  • node it. node it all together my brethren :)
    • View Profile
    • Thats one of our Games :-)
Re: Complex dialog systems
« Reply #18 on: April 11, 2008, 03:58:06 PM »

sounds great what you are doing there. always dreamed of a highly sophisticated AI for Npc talking...
atm i dont think that we will use this in our game, but maybe in one of my projects i currently develop in flash  :)

 ::hijack
i just dont get one point, in your post you said, flash would not allow you to I/O files.
what about xml? wouldnt that serve your needs?
you could just create a xml-table with strings and combine them with userinput array request.
same thing if you wanna safe some userinput (notices for example)
end of ::hijack

cheers
manarius
Logged
Pages: 1 [2]  All
 

Page created in 0.071 seconds with 19 queries.