Jump to content

Recommended Posts

The issue here, budding modders and modstresses out there, is that if you use any sort of WEIGHTing for creating new entries in Biobanter DLGs, you have to be sure that you weight beneath all of the states in that DLG which are called by script: such as LOVETALKs, somebody died/somebody was raised talks, etc. Those values are reasonably easy to find using InfExp/NI/DLTCEP's editor (actually, NI's Edit mode in the state trigger list is probably the best way to locate it quickly.)

 

You can also glance at the Banter Packs for "safe" zones for weighting.

Edited by cmorgan

Share this post


Link to post
...you have to be sure that you weight beneath all of the states in that DLG which are called by script...

In simple english that means using WEIGHT values higher than what are already present in the default DLG files. (If the default highest weight is 8, you'd use 9 or something to start your weights and go up from there.) Or pad them a bit, by making them higher than necessary, to account for someone else's mod playing weight games.

 

(If WeiDU allowed relative weighting, this wouldn't be a problem. Hmmm, a WeiDU request is in order...)

Share this post


Link to post

thanks guys, that is one candidate for that "frequent first-time errors" thread :)

Share this post


Link to post
...you have to be sure that you weight beneath all of the states in that DLG which are called by script...

In simple english that means using WEIGHT values higher than what are already present in the default DLG files. (If the default highest weight is 8, you'd use 9 or something to start your weights and go up from there.) Or pad them a bit, by making them higher than necessary, to account for someone else's mod playing weight games.

Except that you do not need to (and indeed, should not) use WEIGHT if all you want to do is have your new state be the lowest-weighted item. APPEND/CHAIN will do that by default.

 

Your proposal only makes sense if you know that you always want your weighted item to be "five up from the bottom."

Share this post


Link to post

I thought that wider circle of aspiring modders would benefit from reading it than just me :)

Share this post


Link to post
Except that you do not need to (and indeed, should not) use WEIGHT if all you want to do is have your new state be the lowest-weighted item. APPEND/CHAIN will do that by default.

 

Your proposal only makes sense if you know that you always want your weighted item to be "five up from the bottom."

I already knew that about new dialogs being appended, etc.

 

I knew my proposal had limited use, thus my subsequent request to Wes on his PPG forum. Regardless, I don't use WEIGHT myself, and as part of my ongoing project, have been removing all WEIGHTs from the default dialogs as I recode them.

Share this post


Link to post

Sorry, but why should the weight be of higher values? What happens if it's not? My experience with weights is very limited and I try not to need them. I only had to add one for a talk that should happen when you talk to the prelate of the Order of the Radiant Heart in Athkatla after the PC finished some quest. There I had to take a lower number than the existing ones, otherwise the talk wouldn't appear (I think I took -1 or something). Is this a different situation than you meant above? Could / should I do it differently?

 

Another question: What happens, if two mods are installed, and both add a weighted dialog to a .dlg with the same number - Does WeiDU treat them differently or change the weight number (depending on setup-order or something)?

Share this post


Link to post

If the weight is not sufficiently far down the stack, you could get your new banter firing when a script (such as a romance component, or one of the "comments on death/raising of a party member" bit) tries to call that DLG instead.

 

So let's say you're developing the Sussudio NPC (the girl that's been on my mind all the time), and you write a banter that Jaheira starts with her, if you WEIGHT #-1 it into BJAHEIR, then what happens is that when Jaheira's script tries to call LOVETALK 2, if Sussudio is in the party, you'd get the Sussudio banter instead.

 

If you omitted a WEIGHT statement when appending to BJAHEIR, then the banter would be at the bottom of the stack--which isn't BAD, but it means that any other valid Bioware banters would appear first, and that can look a bit like "mod content" if you have to wait through all of the other stuff first.

 

WEIGHT #45 is the first Jaheira banter that isn't script or special-condition (low-HP) related. So slotting in around #50 is a good idea.

 

(If she called me, I'd be there...)

 

Two states can't have the SAME weight no matter what you do. If two mods come along and both claim they have something at #-1, the SECOND mod to be installed will get priority. I'm not sure how it works for positive numbers, but one bumps the other.

Edited by jcompton

Share this post


Link to post

It might help to know that weights aren't specific variables in a DLG file. They are simply skewed indeces into the state trigger table. The value you specify in WEIGHT # is really the position in the state trigger table that you wish to insert your new trigger (as part of a new state) into.

 

States are listed in a DLG file from the first state to the last. Each state may or may not link into the state trigger table. If a link is present, the index will be a positive value. If no link is specified, the index value will be -1. States are scanned from the first to the last, but it is the state trigger index within each state that determines which state is given priority. By skewing the triggers, and thus the indeces, you can give special weighting, or different priority, to states.

 

In a DLG with no special weighting, each state that references the state trigger table will do so using the next higher index value than that of the last state, or 0 if this is the first trigger. So if State 0 links to State Trigger 0 and State 1 also has trigger information, it will link to State Trigger 1. If State 2 has no trigger info but State 3 does, then State 3 will link to State Trigger 2, the next available trigger, and so on. This is the normal progression for states and state triggers as they are added to a dialog file, either by means of creating a new DLG or by means of appending to one.

 

In a DLG with special weighting, State 1 could be given higher priority than State 0 by having it link to State Trigger 0 and letting State 0 link to State Trigger 1. During the scan, the triggers for State 1 would be checked first because State 1 links to the first trigger, State Trigger 0, which is always at the top of the list.

 

If two states share the same trigger, only the first state in the state list will be used. This is why WeiDU enforces unique triggers (and thus weights) for each state. Since you can't get higher priority than State Trigger 0, if two or more mods try to gain control of that trigger, only the last mod to do so will get it. The mods that previously captured State Trigger 0 will be bumped to State Triggers 1, 2 and so on, depending on how many mods made the attempt. Positive numbers have a similar effect, only they work further down the line, so if a DLG already has a state weighted at #40 (State Trigger 40) and a mod specifies a new state with WEIGHT #40, then the original state is bumped to State Trigger 41 (WEIGHT #41).

 

Hope this helps a little.

Share this post


Link to post

It does! At least it will, after I've read your post for let's say another three or four times...

No, honestly, that helps me a lot. Thank you, both!

Share this post


Link to post
If the weight is not sufficiently far down the stack, you could get your new banter firing when a script (such as a romance component, or one of the "comments on death/raising of a party member" bit) tries to call that DLG instead.

 

Shouldn't proper use of conditions prevent that from happening?

Share this post


Link to post

Apparently it does not. I might be mistaken, but I think what happens, you script checks that Globals are good, and gives Interact command. Then Interact garbs the top B-banter that has all conditions fulfilled. And on a regular banter with both NPC's present in the group it is. Or anything that has True() on it.

Share this post


Link to post
you script checks that Globals are good, and gives Interact command. Then Interact garbs the top B-banter that has all conditions fulfilled.

 

As I said, proper use of globals will prevent the wrong dialogue from firing.

Share this post


Link to post

This issue had been known for some times, actuallt Rastor. Try experimenting with negative WEIGHTs and different set ups pf LOCALS/GLOBALs and let us all know the winning combination, if you find it. By some reason I only heard of Jaheira's lovetalks being affected by it :)

Share this post


Link to post
you script checks that Globals are good, and gives Interact command. Then Interact garbs the top B-banter that has all conditions fulfilled.

 

As I said, proper use of globals will prevent the wrong dialogue from firing.

No, not really.

 

It would be patently insane to do something like

 

!Global("Lovetalk","LOCALS",2)

!Global("Lovetalk","LOCALS",4)

!Global("Lovetalk","LOCALS",6)

.

.

.

!Global("Lovetalk","LOCALS",70)

 

in each dialogue.

 

You learn how to use WEIGHT properly. Or you break stuff.

Share this post


Link to post
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...