Dialogue with 2 or more mods

Post » Sun May 29, 2011 2:36 am

Ok, I've read through some the dialogue tutorials and I seem to understand the gist of it. I do have one question however. I get that the dialogue lines are basically a giant linked list, with each line having an id, and pointers to next and previous line ids. But how does the game engine resolve the issue when you have 2 or more different mods inserting dialogue between the same 2 original dialogue lines?

So, lets say you have the original MW dialogue lines somewhere in the greetings section:

Original line #1
Original line #2
Original line #3
etc..

Now you load a mod (Mod A) that inserts a line like:

Original line #1
Mod A line #1
Original line #2
Original line #3
etc..

Ok, so with just this mod loaded, the [Original line #1] would have its next pointer changed from [Original line #2] to [Mod A line #1] and
[Original line #2] would have its previous pointer changed from [Original line #1] to [Mod A line #1].

Now, if I load another mod, Mod B, while also loading Mod A, that inserts a line in the same fashion:

Original line #1
Mod B line #1
Original line #2
Original line #3

what happens? Both mods have changed [Original line #1] and [Original line #2] next and previous pointers to point to different line ids. Does the game engine merge these linked lists in some relatively correct way? As in:

Original line #1
Mod A line #1
Mod B line #1
Original line #2
Original line #3



Thanks
User avatar
sw1ss
 
Posts: 3461
Joined: Wed Nov 28, 2007 8:02 pm

Post » Sun May 29, 2011 2:04 am

This is explained more detail in MW Scripting for Dummies (link in my sig), but basically: You need to clean the original lines that are modified, otherwise the list is (as you guessed) messed up. If the original lines are cleaned it gives warnings on load in the construction set because the next/previous lines are different than it expects, but when the game loads it sorts it all correctly (the modded dialogue still has pointers that it can place it by). What happens if the dialogue is *not* clean is that the earlier-loading mod gets its dialogue dropped to the bottom of the topic.
User avatar
Chloe Botham
 
Posts: 3537
Joined: Wed Aug 30, 2006 12:11 am

Post » Sat May 28, 2011 7:38 pm

This is explained more detail in MW Scripting for Dummies (link in my sig), but basically: You need to clean the original lines that are modified, otherwise the list is (as you guessed) messed up. If the original lines are cleaned it gives warnings on load in the construction set because the next/previous lines are different than it expects, but when the game loads it sorts it all correctly (the modded dialogue still has pointers that it can place it by). What happens if the dialogue is *not* clean is that the earlier-loading mod gets its dialogue dropped to the bottom of the topic.



By cleaning, do you mean having [Original Line #1] next pointer point to [Original Line #2] and [Original Line #2] previous pointer point back to [Original Line #1]?
User avatar
Tyler F
 
Posts: 3420
Joined: Mon Aug 27, 2007 8:07 pm

Post » Sat May 28, 2011 9:23 pm

That is the effect of cleaning, yes. You have to remove the changes to the original lines (so they're not saved in your esp file, otherwise they count as new lines that overwrite the old ones). That's why it gives warnings when loading dialogue in TESCS, but the game doesn't give warnings and sorts it as intended.

Cyrano did a lot of research on this a while back... IIRC the last mod to load gets its dialogue first (or it could be the other way round... can't really remember... but it's predictable anyway). But if all mods are clean, the dialogue will be placed correctly with regard to the original lines.
User avatar
bimsy
 
Posts: 3541
Joined: Wed Oct 11, 2006 3:04 pm

Post » Sun May 29, 2011 1:56 am

That is the effect of cleaning, yes. You have to remove the changes to the original lines (so they're not saved in your esp file, otherwise they count as new lines that overwrite the old ones). That's why it gives warnings when loading dialogue in TESCS, but the game doesn't give warnings and sorts it as intended.

Cyrano did a lot of research on this a while back... IIRC the last mod to load gets its dialogue first (or it could be the other way round... can't really remember... but it's predictable anyway). But if all mods are clean, the dialogue will be placed correctly with regard to the original lines.



Thanks melian for your responses. I did take a look at the MWSFD and some other dialogue posts, but please indulge me and let me know if I understand this correctly.
If I create 2 mods that insert new dialogue lines between original lines (O1 - O2 being original game dialogue lines, A1-A3 mods A's lines, and B1-B3 mod B's lines):

MOD A:
O1
A1
A2
A3
O2
...

MOD B:
O1
B1
B2
B3
O2
..

then clean both mods by deleting the changes made to O1 and O2 in each mod,
(thus O1 and O2 have no knowledge of the new dialogue lines, although A1.previous/B1.previous point to O1 and A3.next/B3.next point to O2)

and load both mods the game, due to whatever logic its engine employs, will correctly resolve and place the new lines of both mods in some sequential order between O1 and O2, i.e.:

O1
A1
A2
A3
B1
B2
B3
O2
...

I understand that the order I've given might be wrong, perhaps the B lines come before the A lines, but in either case the pointers of the O lines will be updated to point to the new lines, yes?
And in the above case, it's able to resolve the fact that originally A3.next pointed to O2 and B1.previous pointed to O1, after both mods load A3.next and B1.previous now point to each other?

If this is so, then I guess it works because even though the O lines have no knowledge of the new lines before the mods load (their pointers point to each other), any "clean" dialogue mod's first line will have a previous pointer back to an original line (O1) and it's last line will have a next pointer to an original line (O2).

I am somewhat surprised that the game is able to resolve this though. Not so much with just one mod, but what if you have 10 mods, all adding new dialogue lines between the same 2 original lines, thus all 10 have first and last lines that point to the same original lines.

Anyway, sorry if this sounds confusing and long, but the whole dialogue thing is still sort of mysterious to me.

Thanks
User avatar
Bad News Rogers
 
Posts: 3356
Joined: Fri Sep 08, 2006 8:37 am

Post » Sat May 28, 2011 11:17 pm

Yes, that's all correct :)

You can find the archived thread where all this was discussed http://www.yacoby.net/es/forum/11/6816271177042920.html (Yacoby's ES forum archive), if you want to read the original discussion. Cyrano made some very detailed posts about his tests and results (and that's where the SfD info came from).
User avatar
Verity Hurding
 
Posts: 3455
Joined: Sat Jul 22, 2006 1:29 pm


Return to III - Morrowind