Author Topic: ZDialog - Missing entries  (Read 435 times)

Legacy_Kato -

  • Hero Member
  • *****
  • Posts: 747
  • Karma: +0/-0
ZDialog - Missing entries
« on: May 16, 2011, 10:02:30 pm »


                Hi there,

I'm having an issue with ZDialog not displaying all the entries in a dynamic dialog, and since there seems to be no documentation available, I thought that one of you wise developers/scripters might help the humble scripter I am...

Strangely enough, the entries are correctly displayed most of the time, yet sometimes the page is missing some of the last entries. Here is the code setting the entries on the page: (The dialog is used to display my PW's guild system infos to players via a guild journal)

         DeleteList(PAGE3, oPC);
         string sSQL = "SELECT terry, guild, name FROM terries";
         SQLExecDirect(sSQL);
         while(SQLFetch())
         {
            int nTerry = StringToInt(SQLGetData(1));
            int nGuild = StringToInt(SQLGetData(2));
            string sTerry = SetGuildTextColor(nGuild, SQLGetData(3));
            AddStringElement(sTerry, PAGE3, oPC);
            ReplaceIntElement(nTerry-1, nTerry, PAGE3, oPC); 
         } 
        AddStringElement(ColorString("Previous options", 255, 165, 0), PAGE3, oPC);
        ReplaceIntElement(GetElementCount(PAGE3, oPC)-1, -1, PAGE3, oPC);
        SetDlgPageString(PAGE3);

Of course, this is just a snippet, and the database system(MySQL) is working flawlessly. The code above is called from the HandleSelection() function, although I've also tried to call it from the PageInit() function, with similar results. The retrieved entries to display are VARCHAR64, there are 10 to display(currently), and the memory reserved for readings is 16 * 128 instead of 8 * 128, tested, working fine. Also, I have several ZDialog files working well in the module, yet this one is the only one setting entries using loops, and it seems that the pages populated with loops do not always display all the entries, even if the loop performs very few iterations(Maybe I'm totally wrong here). Finally, I have tested the bug in MP environment, and even if I'm alone on the server, the bug is still there...

So that's the picture. I've thought about trying ZZDialog instead, but my PW already implements the amazing HGLL system, wich uses ZDialog, so I would rather stick to it too...

Any help would be greatly appreciated, thank you for reading this ':crying:'
               
               

               


                     Modifié par Kato_Yang, 18 mai 2011 - 07:49 .
                     
                  


            

Legacy_zunath

  • Full Member
  • ***
  • Posts: 152
  • Karma: +0/-0
ZDialog - Missing entries
« Reply #1 on: May 18, 2011, 07:06:25 pm »


               We use ZZDialog and have the same issue from time to time. I still don't know what causes it or how to fix it, so I'm probably not much help.
               
               

               
            

Legacy_TSMDude

  • Hero Member
  • *****
  • Posts: 1515
  • Karma: +0/-0
ZDialog - Missing entries
« Reply #2 on: May 18, 2011, 08:19:10 pm »


               While I am not sure if this is the cause but in amazingly long convos I know the system sometimes, not all the time, conks out a bit.
               
               

               
            

Legacy_Kato -

  • Hero Member
  • *****
  • Posts: 747
  • Karma: +0/-0
ZDialog - Missing entries
« Reply #3 on: May 18, 2011, 08:43:17 pm »


               Thanks to both of you for the infos, I'll keep on searching and I'll report my findings, if any '<img'>
               
               

               


                     Modifié par Kato_Yang, 18 mai 2011 - 07:43 .
                     
                  


            

Legacy_Kato -

  • Hero Member
  • *****
  • Posts: 747
  • Karma: +0/-0
ZDialog - Missing entries
« Reply #4 on: May 29, 2011, 04:06:13 am »


               Well, after some extensive testing, it looks like the number of missing entries is always the same for each page where this happens. No more clues for now. It looks like Paul Speed and FunkySwerve are the only ones to have the solution, since Mr. Speed wrote the system and Funky's awesome HGLL system is exempt of the bug in question, yet it displays a lot of entries during feat selection(I've been using HGLL for quite some time in my PW: No bug).

Gentlemen(aforementioned), if one of you two would agree to share some insights, it would be greatly appreciated, thanks a lot! '<img'>
               
               

               


                     Modifié par Kato_Yang, 29 mai 2011 - 03:07 .
                     
                  


            

Legacy_TSMDude

  • Hero Member
  • *****
  • Posts: 1515
  • Karma: +0/-0
ZDialog - Missing entries
« Reply #5 on: May 29, 2011, 08:09:09 pm »


               It was Funky who actually clued me in that a convo can have too long of a length and it will stop displaying so if it is a large convo and this is a simple solution to "chop" it up a bit is what he suggested a long time ago...or was that acaos? Either way it was one of the HG guys.
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
ZDialog - Missing entries
« Reply #6 on: May 30, 2011, 12:55:39 am »


               That was me, TSM, but that's not the problem here. ZDialogue is entirely dynamic, using a comparatively small bioware dlg file with a lot of custom tokens in it (likely only around 20 lines total or so). When I first built HGLL in '05, I had only an inkling of the underbelly of zdialogue, which dynamically builds lists using locals. I picked it because it did exactly what I needed, but after getting it all set up, it still didn't work. As it happens, pspeed had a couple bugs in his list code, which he fixed when I showed him what was happening. I don't know if they're the same bugs, since the dyn convo barely worked at all for me before they were fixed, and I don't know if he posted fixed versions to zdialogue after - he'd said he was going to, but he was pretty busy at the time, iirc, and I didn't notice any in the first month or so. It wouldn't suprise me at all if the person who wrote zzdialogue ported the bugs right over, either - not because I remember who it was, but because they're the kind that are enormously hard to spot if you aren't the guy who wrote the system.

My first recommendation would be to make sure you aren't trying to use color codes in your dynamic convo. That, thanks to a bio-bug, will break them. You can only use 'built-in' colors like <action> </action>  (that one for green).

If that isn't it, my second recommendation would be to run a diff of the zdialogue scripts you got from pspeed comparing them to those packaged with the legendary level system. That SHOULD light up the bugs, if they still remain, and if hgll is free of them as you say. I like WinMerge for running diffs, you can find it HERE.

Something we had happening on HG, was that players would progress too quickly through the convo, not giving all the feats time to load up in the list. We wound up installing a 'please wait a moment and try again page' that the system shunts to if the 'list built' int isn't yet set, to counter that, but if you're always getting the exact same number of missing lines, I doubt that's the problem.

Lastly, if you like, I can share our current dynconvo system with you. Acaos wrote it, so it's slick as hell, but it requires linux nwnx and nwnx_funcs (or one of vman's lin plugins, I forget - you have to be able to check convo node number, and I know vman pioneered it, but I think acaos might've dropped a similar function into funcs or another of his plugins, I really don't recall).

Funky
               
               

               


                     Modifié par FunkySwerve, 29 mai 2011 - 11:56 .
                     
                  


            

Legacy_Kato -

  • Hero Member
  • *****
  • Posts: 747
  • Karma: +0/-0
ZDialog - Missing entries
« Reply #7 on: May 30, 2011, 03:01:43 pm »


               Thank you so much Funky!!! Not knowing the existence of that bio bug regarding colored strings, I've spent hundreds of hours searching for a flaw in my code...

It's also good to know that the zdialog "version" packaged with HGLL is cleaner than the original one, I'll stick to it.

Maybe this can be helpful to someone: Curiously, using colored strings only broke the dialogs where the string elements are added using loops. For all my dialogs where the elements are added "one by one", no problem...(I'll revert back to using built-in colors, if possible, of course) Even when adding very few colored strings using loops(3-4 iterations), missing entries re-appear.

Again, a thousand thanks Funky!!!
               
               

               


                     Modifié par Kato_Yang, 30 mai 2011 - 09:21 .