Author Topic: Z-Dialog .... again  (Read 575 times)

Legacy_Phoenixoverlord

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Z-Dialog .... again
« on: July 27, 2013, 01:38:17 am »


               I've read the fix that FunkySwerve posted here and involved the fix in the HGLL scripts. Implemented that, but I'm still having an issue in the z-dialog demo mod with the well (where you can donate items from a displayed list of your inventory via the dialogue). This is what happens when you have X number of items:

  • 10 - List displays all 10 items with End at 11. -> Works fine
  • 11 - List displays all 10 items with End at 11. -> Missing 1 item
  • 12 - List displays all 10 items with End at 11. -> Missing 2 items
  • 13 - List displays 10 items on the first page, Next, End. The 2nd page contains 3 items, previous and end - Works fine.
I've also checked multiples of 12, but there's no such effect on the 2nd, 3rd page, etc. Only on the first. So it would seem that 11 and 12 items somehow leaves 1-2 of those in limbo. I just can't seem to fathom out where. Has anyone figured that out?

FunkySwerve, in case you would be reading this, I'm also highly interested in what you and Acaos have done with your dynconvo as described here. Quote:
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).


Any help is truly appreciated!

EDIT: Found out that this line in dlg_well
SetShowEndSelection( TRUE );
Causes the issue. When I set it to FALSE (don't show end on every page), all 12 items show up on the first page. However, you can only abort the convo then of course. So somehow this function isn't properly implemented in the zdlg_include_i script... Now I just need to figure out where...
               
               

               


                     Modifié par Phoenixoverlord, 27 juillet 2013 - 01:44 .
                     
                  


            

Legacy_Squatting Monk

  • Hero Member
  • *****
  • Posts: 776
  • Karma: +0/-0
Z-Dialog .... again
« Reply #1 on: July 27, 2013, 05:33:43 am »


               The problem is in zdlg_check_init. Replace lines 53-65...

    // In a multipage response list we reserver entry 13
    // for an End Dialog for later configurability.
    hasPrev = FALSE;
    int maxCount = 13;
    if( first > 0 )
        {
        hasPrev = TRUE;
        maxCount = 10;
        }

    hasNext = FALSE;
    if( count - first >= maxCount )
        hasNext = TRUE;
...with the following:

    // Show the "Previous" selection if we are starting mid-list.
    hasPrev = (first > 0);

    // Show the "Next" selection if the number of items remaining in the list
    // is greater than 10.
    hasNext = ((count - first) > 10);
Looks like he was at one point considering allowing nodes 11 and 12 to be used for responses if the Previous and/or Next options are unavailable, but the code in _SetupDlgResponse() only populates those nodes with the auto-generated responses.
               
               

               


                     Modifié par Squatting Monk, 27 juillet 2013 - 04:39 .
                     
                  


            

Legacy_Phoenixoverlord

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Z-Dialog .... again
« Reply #2 on: July 27, 2013, 01:35:02 pm »


               Whoops, I didn't even look at that script! Thanks so much for the help. '<img'>
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Z-Dialog .... again
« Reply #3 on: July 28, 2013, 05:37:59 am »


               I've actually found an issue or two with our dynconvo system. For the most part, it works really well, but it doesn't pass speaker correctly in some situations. Given the recent shortage of dev time I've had recently, I just hacked in kludge fixes instead of spending hours isolating the problem and doing a proper fix. With that caveat, if you're still interested, I still think it's a great system. It allows you to run an entire convo with a single script, and has all kinds of built-in failsafes, allowing up to 10 or 12 people to use it at once (in practice, I've never heard of that limit being reached on HG, but hey).

I'll see if I can pick out all the relevant includes and bundle them up for you, with a sample script or two, maybe the HGLL script I converted (which has seen by far the heaviest testing of it). I'm actually pretty proud of the script, as it goes well beyond the original, combining acaos' work with my own. It sorts feats by alphabetical subcategories based on 2da category, and automatically resorts them if a new total feat count is added, pulling them up from 2da (so it includes our custom feats) and inputting them into mysql tables for rapid sorting. It REALLY demonstrates some of the things you can do with a dynamic convo system.

Funky
               
               

               
            

Legacy_Phoenixoverlord

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Z-Dialog .... again
« Reply #4 on: July 28, 2013, 10:44:05 pm »


               FunkySwerve, that would be awesome! All credit will be given to the original authors obviously. '<img'> I was actually looking into modifying z-dialog to run with different colours, as zz-dialog has it, but the latter seems to run slower (caveat: this was just an observation with loading a nearly empty mod).

Thanks again! '<img'>
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Z-Dialog .... again
« Reply #5 on: July 29, 2013, 06:36:16 am »


               You can't use custom colors with dynamic convos, as they wind up breaking them in some situations (but no other performance impact, just missing lines). We had them for a while before we worked it out. I'll post those scripts as soon as I get them all pulled out of the mod.

Funky
               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Z-Dialog .... again
« Reply #6 on: July 29, 2013, 02:02:24 pm »


               

FunkySwerve wrote...

You can't use custom colors with dynamic convos, as they wind up breaking them in some situations (but no other performance impact, just missing lines). We had them for a while before we worked it out. 


Are you sure about this? I haven't seen any issues using colors with z-dialog. Was there some specific situation which triggered this? Do you recall any more details?  Is there an example script you can provide which fails?

Thanks,
meaglyn
               
               

               
            

Legacy_Phoenixoverlord

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Z-Dialog .... again
« Reply #7 on: July 29, 2013, 08:26:11 pm »


               I was able to implement custom colours with just regular conversations now. I still need to look into the implementation of colours in generated lists. My first attempt there failed, but that's probably because I don't quite get the entire code yet.. (Hey, I just started out :-)

Meaglyn, I assume you're using z-dialog on a PW? Did you encounter any issues with multiple people using the system at any given time (several players initiating conversations)? If so, were there any other bugfixes you had to implement?
               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Z-Dialog .... again
« Reply #8 on: July 30, 2013, 02:17:04 am »


               

meaglyn wrote...

FunkySwerve wrote...

You can't use custom colors with dynamic convos, as they wind up breaking them in some situations (but no other performance impact, just missing lines). We had them for a while before we worked it out. 


Are you sure about this? I haven't seen any issues using colors with z-dialog. Was there some specific situation which triggered this? Do you recall any more details?  Is there an example script you can provide which fails?


Answering part of own question...

I read the thread linked in the initial post.  That makes a bit more sense. I suspect it depends on the exact color code used. I can see how certain values could cause problem with code that manipulates strings in c/c++ fashion for example. It should be reproducible in a short script in that case. 
               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Z-Dialog .... again
« Reply #9 on: July 30, 2013, 02:23:44 am »


               

Phoenixoverlord wrote...

Meaglyn, I assume you're using z-dialog on a PW? Did you encounter any issues with multiple people using the system at any given time (several players initiating conversations)? If so, were there any other bugfixes you had to implement?


No, SP at the moment.  I believe the server is single threaded though so as long as all the variables are stored on the PC it should be okay. I'm sure there are people using z-dialog in PWs on this list that have more experience with it in MP situations.

My use of it is a couple of generic NPC conversations for quest givers and rumors and what not that are all driven by variables on the NPC.  Those don't have long lists either so I was glad to pull in the fix Squatting Monk posted. I hadn't hit that yet...

Cheers,
meaglyn
               
               

               
            

Legacy_Phoenixoverlord

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Z-Dialog .... again
« Reply #10 on: July 30, 2013, 10:21:06 am »


               Okay, makes sense! Thanks for the explanation! '<img'> And yes, Squatting Monk's fix does get rid of the 11-12 item bug.
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Z-Dialog .... again
« Reply #11 on: July 31, 2013, 01:35:36 am »


               

meaglyn wrote...

FunkySwerve wrote...

You can't use custom colors with dynamic convos, as they wind up breaking them in some situations (but no other performance impact, just missing lines). We had them for a while before we worked it out.


Are you sure about this?


Yup. We kept running into broken convos that should've worked - not just one builder, but three - and the only unifying factor was the addition of custom color codes. Removing them fixed the issue, which manifested as missing convo lines.

I'll post the convo includes from our dynamic system this evening, when I've sobered up enough from happy hour that I trust myself not to botch it. '<img'>

Funky
               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Z-Dialog .... again
« Reply #12 on: July 31, 2013, 03:45:26 pm »


               

FunkySwerve wrote...

Yup. We kept running into broken convos that should've worked - not just one builder, but three - and the only unifying factor was the addition of custom color codes. Removing them fixed the issue, which manifested as missing convo lines.

Funky


Thanks Funky.  I did not mean to sound doubtful, but that was a pretty blanket statement that contradicted my experience so I wanted to dig further.  Were you using a wide range of custom colors? There are apparently some color codes which should not be used.*  I have a small range of basic colors (16 or so) and they are all tuned not to use any of the ones that are suspect.

*http://nwvault.ign.com/View.php?view=other.detail&id=931

Do you perhaps still have one of the failing scripts in a form that could be used by someone else? This really should work.  You can put colors in custom tokens and the only real difference here is that these get stored as string variables first. I suspect certain characters are causing that part to fail.  

Cheers,
meaglyn
               
               

               
            

Legacy_Phoenixoverlord

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Z-Dialog .... again
« Reply #13 on: July 31, 2013, 04:41:04 pm »


               Right, for now I've also only used a limited set of colours and I've yet to encounter an issue with those, much like Meaglyn. '<img'>
So according to Gaoneng's detailed instructions, there are really only a handful of symbols that would cause issues. FunkySwerve, I'm curious, did you generate on the fly colours when you had those issues? Or had you already used the function where the "illegal" symbols had been removed? If the latter, then it's of course an entirely different story....
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Z-Dialog .... again
« Reply #14 on: July 31, 2013, 10:15:32 pm »


               

meaglyn wrote...

Thanks Funky.  I did not mean to sound doubtful, but that was a pretty blanket statement that contradicted my experience so I wanted to dig further.  Were you using a wide range of custom colors? There are apparently some color codes which should not be used.*  I have a small range of basic colors (16 or so) and they are all tuned not to use any of the ones that are suspect.


I honestly don't remember, though I'm pretty confident that acaos was aware of that info when he was troubleshooting. We have an include for colors separate from the SIMTools colors, which I'm pasting here, though I don't remember if these were actually the codes we used. If they have problem characters, that strengthens the case for that being the issue, but again, doesn't make it certain. We use them for ingame chat/server messages, mostly.

const string C_GENERATOR               = " !0@P`p€ Â°Ã€ÃÃ Ã°Ã¾";
const string C_END                     = "</c>";

const string C_DARK_GREY               = "<c@@@>";
const string C_MED_GREY                = "<cppp>";
const string C_LIGHT_GREY              = "<c   >";
const string C_PALE_GREY               = "<cÐÐÐ>";
const string C_WHITE                   = "<cþþþ>";

const string C_BLUE                    = "<c  þ>";
const string C_DARK_BLUE               = "<c  p>";
const string C_MED_BLUE                = "<c   >";
const string C_LIGHT_BLUE              = "<c  ð>";
const string C_PALE_BLUE               = "<c€°ð>";
const string C_BLUE_PURPLE             = "<cþ>";
const string C_PALE_BLUE_PURPLE        = "<cÀ°þ>";

const string C_GREEN                   = "<c þ >";
const string C_DARK_GREEN              = "<c p >";
const string C_MED_GREEN               = "<c ° >";
const string C_LIGHT_GREEN             = "<c ð >";
const string C_PALE_GREEN              = "<c°ð`>";
const string C_SEA_GREEN               = "<cp>";

const string C_CYAN                    = "<c þþ>";
const string C_DARK_CYAN               = "<c!pp>";
const string C_MED_CYAN                = "<c0°°>";
const string C_LIGHT_CYAN              = "<c0ðð>";
const string C_PALE_CYAN               = "<cÐ°>";

const string C_RED                     = "<cþ  >";
const string C_DARK_RED                = "<cp  >";
const string C_MED_RED                 = "<c°  >";
const string C_LIGHT_RED               = "<cð  >";
const string C_PALE_RED                = "<cð@p>";
const string C_PALE_RED_ORANGE         = "<cþ~P>";

const string C_YELLOW                  = "<cþþ >";
const string C_DARK_YELLOW             = "<c€€!>";
const string C_MED_YELLOW              = "<c°°0>";
const string C_LIGHT_YELLOW            = "<cðð0>";
const string C_PALE_YELLOW             = "<cðð€>";

const string C_PURPLE                  = "<cþ þ>";
const string C_DARK_PURPLE             = "<c!>";
const string C_MED_PURPLE              = "<c°0°>";
const string C_LIGHT_PURPLE            = "<cð0ð>";
const string C_PALE_PURPLE             = "<cÐ`ð>";
const string C_RED_PURPLE              = "<cÀ p>";

const string C_BROWN                   = "<c€@ >";
const string C_MED_ORANGE              = "<cÀ`>";
const string C_LIGHT_ORANGE            = "<cð€>";
const string C_PALE_ORANGE             = "<cðÌ€>";

const string C_TEAL                    = "<c   >";
const string C_PINK                    = "<cð€Ð>";
const string C_GOLD                    = "<cþðP>";

const string C_SUCCESS                 = "<c!à!>";
const string C_FAILURE                 = "<cÀ!!>";

const string C_UNKNOWN_SPELL           = "<cÌ™>";

const string C_SERVER_MESSAGE          = "<c°°°>";

const string C_DAMAGE_SELF             = "<c™þþ>";
const string C_DAMAGE_OTHER            = "<cÌ™Ì>";

const string C_DAMAGE_PHYSICAL         = "<cþf>";

const string C_DAMAGE_ACID             = "<c þ >";
const string C_DAMAGE_COLD             = "<cþþ>";
const string C_DAMAGE_ELEC             = "<c!`þ>";
const string C_DAMAGE_FIRE             = "<cþ  >";
const string C_DAMAGE_SONIC            = "<cþ™>";

const string C_DAMAGE_DIVINE           = "<cþþ>";
const string C_DAMAGE_MAGICAL          = "<cÃŒwþ>";
const string C_DAMAGE_NEGATIVE         = "<c™™™>";
const string C_DAMAGE_POSITIVE         = "<cþþþ>";

const string C_DAMAGE_ECTO             = "<cÀÀÀ>";
const string C_DAMAGE_PSIONIC          = "<cà!P>";
const string C_DAMAGE_SACRED           = "<cðð€>";
const string C_DAMAGE_VILE             = "<c € >";
const string C_DAMAGE_INTERNAL         = "<c€  >";
const string C_DAMAGE_PRIMAL           = "<cÀ>";
const string C_DAMAGE_ANARCHIC         = "<cÀÀ>";
const string C_DAMAGE_AXIOMATIC        = "<cÀÀ>";
const string C_DAMAGE_SUBDUAL          = "<cþ>";

const string C_DAMAGE_SP_DESICCATION   = "<c°°`>";
const string C_DAMAGE_SP_FORCE         = "<c0À>";
const string C_DAMAGE_SP_RAW_NATURE    = "<c Ð >";
const string C_DAMAGE_SP_VENOM         = "<cÀ0>";

const string C_FUNKY_DM                = "<c Ðð>";
const string C_FUNKY_ERROR             = "<cþ<<>";
const string C_FUNKY_SHOUT             = "<cþðP>";
const string C_FUNKY_NAME              = "<c þ>";

Note that some of the characters don't paste properly into this board. '<img'> If anyone knows why and how to fix it,

As for digging up a problem convo, I'd have to dig through years worth of rars looking. If you're not having issues, I wouldn't sweat it; just don't be surprised if a convo with color codes starts throwing fits. In the code I'm about to link, you'll see that we replaced them with [Action] markers and the like.

Here's the dynconv system I promised:

Click Me

It includes a bunch of mod resources, as well as a txt file explaining how things related, which I'm pasting below.

Funky

START PASTE

NOTE: These files are not erf'd because the scripts are too complex, breaking the erf compiler. You'll need to use a custom compiler like Skywing's to compile these scripts, and you will have to copy/paste or unrar these files directly into the temp0 folder if you want to add them to a module.
===============


ac_dynconv_0.dlg through ac_dynconv_19.dlg : these are the 20 conversations available to the dynamic convo system (allowing up to 20 simultaneous convos (same or different controller scripts)) - all are identical, but included to save hassle should you try to use the system; it uses the following scripts:

ac_dynconv_menu.nss
ac_dynconv_main.nss
ac_dynconv_resp.nss
ac_dynconv_cond.nss
ac_dynconv_end.nss

they all share the same two includes:

hg_inc.nss          :  (NOT INCLUDED) our catchall include for frequently used functions - let me know if you need to see anything from it
ac_dynconv_inc.nss  :  core include for the dynamic convo system

=====

tsk_tinker.utc       :  task-giver - shows how dynamic convos launched from creatures by variable;
conv_by_tag.nss      :  script fired by tsk_tinker npc; highlights problem with dynconv system failing to pass npc speaker; NB: I'm not including the dynamic convo script itself, as it's quite long - instead, I'm giving you hgll and our bardsong convos - LMK if you want it

=====

hgll_start_dlg.nss   :  script fired from chat event to begin hgll levelup convo - code below is from chat event, showing how launched


ExecuteScript("hgll_start_dlg", oCPC);
//where oCPC is the pc speaker

includes in hgll_start_dlg:

aps_include.nss     :  (NOT INCLUDED) no longer the standard aps include, but a redirect to our custom databasing functions, only tangentially relevant
ac_dynconv_inc.nss  :  per above
zdlg_include_i.nss  :  pspeed include; at this point in time, I no longer have any idea if we've modified this particular include - I'm not even certain it's used in the system anymore, though I suspect acaos piggybacked some of its listing functionality, which is why I'm including it
hgll_func_inc.nss   :  modified hgll include - at this point, there's a lot of dead code which nwnx allowed us to simplify, and a fair bit of redone code

=====

dc_hgll.nss         :  controlling script for the hgll system dynamic conversation

includes in dc_hgll:

hg_inc.nss          :  per above
ac_dynconv_inc.nss  :  per above
dc_simple_inc.nss   :  include to simplify/make more intuitive the convo system; more like the bioware system people are used to, but totally unnecessary to function of system - it's basically a conceptual reordering of the core include functions
hgll_func_inc.nss   :  per above
hg_epicspell_inc.nss:  (NOT INCLUDED) our epic spells include, referenced in the levelup process, and only tangentially relevant to the system as a whole

=====

dc_bardsong.nss     :  controlling script for our customizable bardsong conversation - much simpler than hgll, and easier to piece together the convo 'tree'