Jump to content


Photo

WEIGHTS


  • Please log in to reply
21 replies to this topic

#1 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 03 July 2004 - 04:14 PM

I'm have to admit that I haven't understood the WEIGHTS-variable, mainly concerning B**.d-files, (banter-files, duh!).

I know something of course. I know that you use them when you write the B-dialogue for one NPC, and you want another NPC to initiate the banter. For example: (from jcompton's Gareth, sorry Jason, but it's a good example...)
CHAIN IF WEIGHT #33
~InParty("FWGhareth")
See("FWGhareth")
!StateCheck("FWGhareth",STATE_SLEEPING)
Global("FWAerieGhareth","LOCALS",0)~ THEN BAERIE ghar1
~A~ DO ~SetGlobal("FWAerieGhareth","LOCALS",1)~
== BFWGHAR ~B~ [FWGHAR68]
== BAERIE ~C~
etc.
EXIT
Here Aerie initiates the dialogue (THEN BAERIE...), and the WEIGHT-variable is used. But when Gareth initiates the dialogues, it isn't used.

I understood from the WeiDU readme, that it has to do with sorting banters in the BioWare-NPC's .dlg's. If you don't add the WEIGHT, the banter'll be at the bottom of the BW-NPC's B***.dlg. This is used to place the current banter higher up in the B**.dlg. So far I'm with you (if that's correctly understood...).

What I wonder, though, is how to use them. I mean, I've seen negative values, positive, high, low, etc. How do you determine which value to choose?

I also wonder about this quote from the weidu-readme:

IF WEIGHT #8 /* Triggers after states #: 11 12 24 25 26 36 58 even though they appear after this state */

That's kind of the opposite of what I thought WEIGHTS are.

Please explain to a poor modder, and I won't bother you with stupid questions again (I wouldn't bet my money on that, though... ;) ).

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner


#2 seanas

seanas
  • Modder
  • 1906 posts

Posted 03 July 2004 - 04:19 PM

there's a weights tutorial posted today at pocketplane. i can claim zero expertise in this area, but it looks to me like the questions yr asking are being answered there. it also looks, from the time of the postings, that you and jcompton were having similar thoughts simultaneously. *spooky*

"A simple test of the relative merits of science and religion is to compare lighting your house at night by prayer or electricity" - A. C. Grayling
"EFF files have saves, too." - CamDawg
|| this is radio seanas || BP Series v3 || seanas at work ||


#3 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 03 July 2004 - 04:34 PM

there's a weights tutorial posted today at pocketplane. i can claim zero expertise in this area, but it looks to me like the questions yr asking are being answered there. it also looks, from the time of the postings, that you and jcompton were having similar thoughts simultaneously. *spooky*

Thanks for the notice...

But jcompton posted two days before me, so it wasn't exactly simultaneously, unfortunently...

Still, a clearer explanation is highly wanted... Sure, jcompton's tutorial is clarifying, but a further explanation about if it matter which exact weight I choose...

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner


#4 seanas

seanas
  • Modder
  • 1906 posts

Posted 03 July 2004 - 04:48 PM

hmm, in which case maybe i was thinking of this thread, which i was reading at the same time.

"A simple test of the relative merits of science and religion is to compare lighting your house at night by prayer or electricity" - A. C. Grayling
"EFF files have saves, too." - CamDawg
|| this is radio seanas || BP Series v3 || seanas at work ||


#5 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 03 July 2004 - 05:03 PM

That makes it a lot clearer...

And it seems we were writing quite simultaneously. How nice, different continents and such...

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner


#6 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 03 July 2004 - 05:04 PM

But it still isn't enough information about which values I can and cannot use (if there are such values).

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner


#7 CamDawg

CamDawg

    ALL GLORY TO THE HYPNOTOAD

  • Modder
  • 1505 posts

Posted 03 July 2004 - 06:36 PM

WEIGHTs are relative, so WEIGHT #3 is meaningless by itself until you compare it to other WEIGHTs in the dlg. If a given dlg file has no WEIGHTs at all, then a WEIGHTed dialogue will be evaluated first, even if WEIGHTed extremely high. So when a dlg file is called, the engine evaluates triggers looking for true conditions in this order:

1) States with WEIGHTs, from lowest WEIGHT to highest.
2) States without WEIGHTs.

In the case of states having equal WEIGHT, (or having no WEIGHT at all), the tie-breaker is which one is the lower numbered state.

WEIGHT #8, in this particular instance in BJAHEIR, puts this state behind the others listed because they are lower WEIGHTed, or also have WEIGHT#8 and appear before this state. Decompile BJAHEIR and look thrugh the states to see the existing WEIGHTing on the file.

Why is this Hypnotoad video so popu... ALL GLORY TO THE HYPNOTOAD.
____
The Gibberlings Three - Home of IE Mods

The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release.


#8 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 04 July 2004 - 08:40 AM

WEIGHT #8, in this particular instance in BJAHEIR, puts this state behind the others listed because they are lower WEIGHTed, or also have WEIGHT#8 and appear before this state. Decompile BJAHEIR and look thrugh the states to see the existing WEIGHTing on the file.

Is that how I should do when decideing which weights (for the banters initiated by BW-NPC's) to use in my NPC's .d?

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner


#9 CamDawg

CamDawg

    ALL GLORY TO THE HYPNOTOAD

  • Modder
  • 1505 posts

Posted 04 July 2004 - 12:09 PM

WEIGHT #8, in this particular instance in BJAHEIR, puts this state behind the others listed because they are lower WEIGHTed, or also have WEIGHT#8 and appear before this state. Decompile BJAHEIR and look thrugh the states to see the existing WEIGHTing on the file.

Is that how I should do when decideing which weights (for the banters initiated by BW-NPC's) to use in my NPC's .d?

You should forego WEIGHTing whenever possible, as it generally adds a layer of complexity in the dlg files which isn't really needed. When constructing your own dialogue file from scratch, just use the inherent top-to-bottom order and not use WEIGHTs at all.

WEIGHTs are really only necessary when you have to add content to an existing dlg file, and then only if you're trying to bump it ahead of existing states.

Why is this Hypnotoad video so popu... ALL GLORY TO THE HYPNOTOAD.
____
The Gibberlings Three - Home of IE Mods

The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release.


#10 Rastor

Rastor

    Yes, I really am a dragon. Yes, I am a jerk. Live with it.

  • Member
  • 2001 posts

Posted 04 July 2004 - 12:09 PM

WEIGHT #8, in this particular instance in BJAHEIR, puts this state behind the others listed because they are lower WEIGHTed, or also have WEIGHT#8 and appear before this state. Decompile BJAHEIR and look thrugh the states to see the existing WEIGHTing on the file.

Is that how I should do when decideing which weights (for the banters initiated by BW-NPC's) to use in my NPC's .d?

Yes. There's no reason to use weights at all for banters, however.
Home of Kitanya, Improved Asylum, more...

Posted Image

#11 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 04 July 2004 - 01:49 PM

I know that, but if I want the other NPC (for example Minsc) to initiate the banter, I have to add content to an existing dlg file, in this case Bminsc.dlg. I therefore need to use weights.

My question is (again): Does it matter which value I choose; i.e. can I just pick any value, or is there a specific value (like 31 or something) I need to determine before I assign to the banter?
Does it matter (other than in which order the banters will trigger) if I choose 12 or 13 or 14 or 15 etc.?

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner


#12 Kismet

Kismet

    Mild Thang

  • Member
  • 348 posts

Posted 04 July 2004 - 03:42 PM

I know that, but if I want the other NPC (for example Minsc) to initiate the banter, I have to add content to an existing dlg file, in this case Bminsc.dlg. I therefore need to use weights.

My question is (again): Does it matter which value I choose; i.e. can I just pick any value, or is there a specific value (like 31 or something) I need to determine before I assign to the banter?
Does it matter (other than in which order the banters will trigger) if I choose 12 or 13 or 14 or 15 etc.?

If you want Minsc to initiate a random banter then you do not need to add weight to your dialogs. If you want Minsc to comment on a specific person/place/thing then it is possible that you need to add weight.

#13 Rastor

Rastor

    Yes, I really am a dragon. Yes, I am a jerk. Live with it.

  • Member
  • 2001 posts

Posted 04 July 2004 - 03:54 PM

That is true. The game seems to randomly pick a banter whose conditions evaluate to True. I've had NPCs banter with my mod NPCs even if their dialogues were not at the top (and other valid NPCs with more weights were in the party).
Home of Kitanya, Improved Asylum, more...

Posted Image

#14 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 04 July 2004 - 04:13 PM

So banters isn't determined by weights? That's great! In that case, my problem's solved.

Thank you for the explanation...

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner


#15 jcompton

jcompton
  • Modder
  • 492 posts

Posted 05 July 2004 - 08:14 AM

No, no, it's not random at all, look at my shopping list example again. Once the game is looking to initiate a banter out of a DLG, it will play the first one that evaluates to True().

Therefore, yes, if you want your banter to appear sooner than "when Minsc is done with all of the other banters he might possibly hold", you would want to use a WEIGHT. You'd look at BMINSC and see how many banters appear to be triggered for specific events (low-HP commentary, etc.), then weight yours slightly after that.

#16 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 08 July 2004 - 05:57 PM

Thanks for the answer, Jason.

Another question then: is it the same in my NPC's banter-file? That it goes from the top to the bottom?

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner


#17 CamDawg

CamDawg

    ALL GLORY TO THE HYPNOTOAD

  • Modder
  • 1505 posts

Posted 08 July 2004 - 06:47 PM

Yep.

Why is this Hypnotoad video so popu... ALL GLORY TO THE HYPNOTOAD.
____
The Gibberlings Three - Home of IE Mods

The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release.


#18 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 08 July 2004 - 07:00 PM

Ok, good to know. I've been listing all banters in alphabetic order. Not a good idea, then.

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner


#19 Rastor

Rastor

    Yes, I really am a dragon. Yes, I am a jerk. Live with it.

  • Member
  • 2001 posts

Posted 09 July 2004 - 03:13 PM

Ok, good to know. I've been listing all banters in alphabetic order. Not a good idea, then.

Actually, that's how Bioware does it. If you look at each NPC's b*.d file, you'll see all the banters with Minsc together, Viccy together, etc.

Therefore, yes, if you want your banter to appear sooner than "when Minsc is done with all of the other banters he might possibly hold", you would want to use a WEIGHT. You'd look at BMINSC and see how many banters appear to be triggered for specific events (low-HP commentary, etc.), then weight yours slightly after that.


Wouldn't it be somewhat better and easier to use globals to do this?
Home of Kitanya, Improved Asylum, more...

Posted Image

#20 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 09 July 2004 - 04:05 PM

Ok, good to know. I've been listing all banters in alphabetic order. Not a good idea, then.

Actually, that's how Bioware does it. If you look at each NPC's b*.d file, you'll see all the banters with Minsc together, Viccy together, etc.

I'm getting two different answers here. Can someone please explain how this works.

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner