View Single Post
Old 07-25-2006, 01:41 PM   #176
Mostly dormant
stoffe's Avatar
Status: Administrator
Join Date: Apr 2002
Posts: 5,850
Helpful!  10 year veteran!  Notable contributor 
Originally Posted by ChAiNz.2da
You've won me over with just these few lines. Hellish work or no, given the possibilities with this function.. oh yeah.. I'm feeling the urge to "tinker"

Thanks so much stoffe... If I run into any bugs I'll let ya' know
If you want to play with it these are rougly the steps you go through to make it work:
  1. Start with a clean copy of the DLG file, and add your new dialog entries to it like usual with the DLGEditor. Store this somewhere else, since it will not be part of the install.

  2. Write down somewhere the Entry node and Reply node indexes (displayed at the top of the edit area in tk102s DLGEditor) for your new nodes and how they connect to eachother.

  3. Extract another clean copy of the same DLG file and put it into the tslpatchdata folder.

  4. Use the GFF Compare function in ChangeEdit to compare your modified DLG file with the unaltered version, creating AddField modifiers for the new fields.

  5. Edit the generated modifiers to replace the necessary static values with dynamic, token-based ones to make it work with already modified DLG files. For each struct added to the EntryList or ReplyList and their corresponding EntriesList and RepliesList, set the TypeId field to "ListIndex". This sets the Struct field's type id to the same value as the list index it will be added as, which seems to be how DLG files work.

  6. Also for each struct added to the EntryList or ReplyList (but not EntriesList or RepliesList), put a 2DAMEMORY token into the "Index token" input box. This will store the resulting list index the struct i added as in a token which will be used later to link the nodes together. Write down (preferably in the same place as step 2 above) which token is used for which entry/reply.

  7. For each "Index" field inside the structs added to the EntriesList and RepliesList of an Entry/Reply struct, put the name of a 2DAMEMORY token into the Path token input box. Write down which replies/entries which token is used.

  8. The data stored in the two above steps will be needed in order to link the new entry and reply nodes together. The "Index" field tokens assigned in the EntriesList and RepliesList structs now holds the GFF field paths to the fields which needs to have their values updated, while the tokens assigned in the EntryList and ReplyList structs hold the values that need to be assigned to those fields. Which brings us to the next step...

  9. Go back out to the main "Modify GFF Field" panel in the ChangeEdit main window, and add new modifiers here. Set the "GFF Field" input box to the name of a 2DAMEMORY token which holds the path to one of the Index fields, and the "Value" input box to the name of the 2DAMEMORY token which holds the Entry/Reply List Index it should link to.

Using the requested mod linked to as example, the info I wrote down to keep track of how things were connected looked like:
(Remember: The index numbers below match the numbers in the auto-generated modifier labels, but not necessarily those in the DLG file after it has been modified, since it's inserted dynamically. (Except E587))

Entry 587 (standard, static)
    --> Reply 738 (first new, dynamic)
        --> Entry 627 (dynamic)
            --> Reply 739
                --> Entry 628
            --> Reply 740
                --> Entry 629
EntryList 587: (exists in standard DLG, insertion point)
RepliesList: 738 (2DAMEMORY8 = FieldPath) (new added to RepliesList)

ReplyList 738:	 (2DAMEMORY7 = ListIndex)
EntriesList: 627 (2DAMEMORY6 = FieldPath)

EntryList 627: (2DAMEMORY5 = ListIndex)
RepliesList: 739 (2DAMEMORY12 = FieldPath)
RepliesList: 740 (2DAMEMORY4 = FieldPath)

ReplyList 739: (2DAMEMORY11 = ListIndex)
EntriesList: 628 (2DAMEMORY10 = FieldPath)

EntryList 628: (2DAMEMORY9 = ListIndex)

ReplyList 740: (2DAMEMORY3 = ListIndex)
EntriesList: 629 (2DAMEMORY2 = FieldPath)

EntryList 629: (2DAMEMORY1 = ListIndex)
...from which you can see that things need to be connected like:


This is since dialog nodes are connected like:
(? = a listindex, irrelevant to keep track of here since it isn't referenced from anywhere else.)
EntryList\587\RepliesList\?\Index=738 --> ReplyList\738\EntriesList\?\Index=627 --> EntryList\627\RepliesList\?\Index=739 --> ReplyList\739\EntriesList\?\Index=628 --> EntryList\628
...which when written with the token values from above to make it dynamic would be like:
As said, quite load of manual work involved to make it work at this stage.


Last edited by stoffe -mkb-; 07-26-2006 at 09:28 AM. Reason: Soooooooo sloooooooow...
stoffe is offline   you may: quote & reply,