Jump to content


Photo

WEIGHTs in BG2 Dialogues

weidu tp2 coding tutorial WEIGHT lovetalks friendtalks troubleshooting

27 replies to this topic

#16 Domi

Domi

    Where is now your Troy, O Cassandra?

  • Gibberlings
  • 12630 posts
  • Location:Canada

Posted 16 December 2004 - 07:49 AM

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.

OK, please bare with me. I have a persistent problems of scripted banters sunstituted by nons scripted banters cross-file.

What we did in the behginning we weighed all banters, both CHAINs and APPENDs with -1 on all files to push them above BioWARE stuff on B-files in BG1.

Now, obviously I got a conflict between custom banters (ie the script calls for Kivan's talk with Player one at Rest, and instead a non-scripted Minsc's banter with Kivan shows up.

To me it means that I have to weight all *scripted* talks LOWER than all *simple* talks and do so for ALL the files. Ie all the banters which are not called by script should be weighed as -1.

All the banters that have script should be weighed lower... but what WEIGHT should I ascribe to them to have them "lower" Do they all have to go as -2? or should they be progressed? If they are progressed, how do I know which NPC takes precedence over which? Ie I number Kivans PC talks as -2, -3, -4, etc, while Minsc's scripted talk will still be -2... will Minsc's talk jump for Kivan's if both are in the party?

Does this conflict occur only with Interact() command or Dialogue() is a subject to it as well?

Also will using

IF ~False()~

Instead of IF ~~

On the intermediate states (the ones that do not start up the conversation, but are referenced to) and CHAINs prevent them from showing up when the character is forcetalked?

Edited by Domi, 16 December 2004 - 07:52 AM.

Faster. Faster. Faster would be better. -Mal Reynolds, Serenity
I understand that folks prefer code that works. -CamDawg, G3

#17 jcompton

jcompton

    Lord Bigenvy

  • Members
  • 626 posts

Posted 16 December 2004 - 08:32 AM

OK, please bare with me. I have a persistent problems of scripted banters sunstituted by nons scripted banters cross-file.

What we did in the behginning we weighed all banters, both CHAINs and APPENDs with -1 on all files to push them above BioWARE stuff on B-files in BG1.

Now, obviously I got a conflict between custom banters (ie the script calls for Kivan's talk with Player one at Rest, and instead a non-scripted Minsc's banter with Kivan shows up.


A few things here:

The more negative the number is, the higher it will be weighted (top of the stack.)

Anything that you want to appear only when explicitly called by script should be weighted higher than anything that is intended to appear when the banter timer trips.

So if anything that you need to happen on rest, called from a player script, whatever is called #-2 and the regular banters are called #-1, that should help alleviate the problem. Sorting all the #-2s at the top of the file will also help clear things up.

Ie I number Kivans PC talks as -2, -3, -4, etc, while Minsc's scripted talk will still be -2... will Minsc's talk jump for Kivan's if both are in the party?


Try not to overlap weight numbers for things that are of a different category (intended to be called by script vs. intended to be called by banter timer.)

Does this conflict occur only with Interact() command or Dialogue() is a subject to it as well?


DLG is DLG is DLG. It's not a "conflict", it's just a problem with the design of your .d files.

Basically, if you find yourself perplexed by how your state weights are being sorted, you should then decompile the DLG and/or open it in NI and look at the edit tab to see how the weighting is coming out in the wash.

Also will using

IF ~False()~

Instead of IF ~~

On the intermediate states (the ones that do not start up the conversation, but are referenced to) and CHAINs prevent them from showing up when the character is forcetalked?


A state trigger of IF ~~ is equivalent to IF ~False()~ . In either case, there is absolutely no way that you would see them when the character is click-talked/Dialogue()'ed/Interact()'ed/etc.
"[I]t's a testament to the determined RPG fraternity that a number of Baldur's Gate II mods have been successfully produced. The best can be found at pocketplane.net." PC Gamer UK

#18 Domi

Domi

    Where is now your Troy, O Cassandra?

  • Gibberlings
  • 12630 posts
  • Location:Canada

Posted 16 December 2004 - 08:40 AM

A state trigger of IF ~~ is equivalent to IF ~False()~ . In either case, there is absolutely no way that you would see them when the character is click-talked/Dialogue()'ed/Interact()'ed/etc. 


Are the constructions

IF ~~ THEN BEGIN StateName

IF ~~ StateName

treated differently (ie first as the dialogue state "starting up the convo" which can be called by script and the second only when summoned by the EXTERN or GOTO?). Is there other mechanism by which dialogue can distinguish between these two types?

Same with CHAIN: is

CHAIN _JAHEIJ StateName

any different from

CHAIN IF ~Global()~ THEN _JAHEIJ StateName?

Because at least in one case I saw the Chain of second type pop up instead of PID, and that with PID's compiled last of all and WEIGHTs non-assigned to the CHAIN...
Faster. Faster. Faster would be better. -Mal Reynolds, Serenity
I understand that folks prefer code that works. -CamDawg, G3

#19 jcompton

jcompton

    Lord Bigenvy

  • Members
  • 626 posts

Posted 16 December 2004 - 09:31 AM

A state trigger of IF ~~ is equivalent to IF ~False()~ . In either case, there is absolutely no way that you would see them when the character is click-talked/Dialogue()'ed/Interact()'ed/etc. 


Are the constructions

IF ~~ THEN BEGIN StateName

IF ~~ StateName

treated differently (ie first as the dialogue state "starting up the convo" which can be called by script and the second only when summoned by the EXTERN or GOTO?). Is there other mechanism by which dialogue can distinguish between these two types?

You are looking for distinctions where they do not exist.

The words "THEN BEGIN" are optional in WeiDU syntax, so

IF ~~ THEN BEGIN StateName

IF ~~ StateName

say exactly the same thing.

A state can only ever be played to start a conversation if it contains a valid state trigger.

IF ~~ is equivalent to IF ~False()~, and since False() can never be true, there is no circumstance under which a state of IF ~~ will ever start a dialogue.

Same with CHAIN: is

CHAIN _JAHEIJ StateName

any different from

CHAIN IF ~Global()~ THEN _JAHEIJ StateName?


Again, we have the distinction of what does and does not possess a state trigger. The second example contains a state trigger. That state trigger is the state trigger for the first line of the CHAIN. Therefore it is in the state trigger list, therefore it is eligible to be played to start a dialogue if an Interact()/Dialogue()/banter pass hits that DLG and looks for a valid state.

Edited by jcompton, 16 December 2004 - 09:31 AM.

"[I]t's a testament to the determined RPG fraternity that a number of Baldur's Gate II mods have been successfully produced. The best can be found at pocketplane.net." PC Gamer UK

#20 Domi

Domi

    Where is now your Troy, O Cassandra?

  • Gibberlings
  • 12630 posts
  • Location:Canada

Posted 16 December 2004 - 09:45 AM

Thank you, that's great.

One last question. If I had a character override script that checked the conditions, and set Global and then tried to trigger Dialogue(Player1), but there was (erroneously) no valid trigger on the D' file; I saw it make another character talk to Player 1 instead. Is this some sort of a substitute to good-old fashioned stutter bug? Or does it occur under a different set of circumstances and the Dialogue(Player1) simply looks for and dialogue with a valid trigger?
Faster. Faster. Faster would be better. -Mal Reynolds, Serenity
I understand that folks prefer code that works. -CamDawg, G3

#21 jcompton

jcompton

    Lord Bigenvy

  • Members
  • 626 posts

Posted 16 December 2004 - 11:09 AM

I'd want to see the script before I buy that, because it shouldn't just go hopping to other CREs.
"[I]t's a testament to the determined RPG fraternity that a number of Baldur's Gate II mods have been successfully produced. The best can be found at pocketplane.net." PC Gamer UK

#22 Domi

Domi

    Where is now your Troy, O Cassandra?

  • Gibberlings
  • 12630 posts
  • Location:Canada

Posted 16 December 2004 - 12:14 PM

Heh, well, nothing special, really. The bad guys get killed
IF
Dead()
Global(0)
THEN
Global(1)
Dialogue(Player1)
END

in Jaheira's override; in D the trigger was wrong on Jahs' J.D, so instead I had Shar-Teel's lovetalk to go off... Fixed Global on Jah's J.D - got Jahiera talking as wanted.

Edited by Domi, 16 December 2004 - 12:16 PM.

Faster. Faster. Faster would be better. -Mal Reynolds, Serenity
I understand that folks prefer code that works. -CamDawg, G3

#23 Domi

Domi

    Where is now your Troy, O Cassandra?

  • Gibberlings
  • 12630 posts
  • Location:Canada

Posted 29 March 2005 - 07:54 PM

I thought I was doing nice and good by putting WEIGHT -2 on all my scripted banters and WEIGHT -1 on all the 'simple' ones.

But alas, in the end my scripted banters ended up WEIGHT'd below non-scripted because I guess non-scripted were in the file that compiled later on...

So... what do I do, to ensure that my scripted banters always get the lowest weight?
Faster. Faster. Faster would be better. -Mal Reynolds, Serenity
I understand that folks prefer code that works. -CamDawg, G3

#24 Meira

Meira

    I'm the snow on your lips

  • Gibberlings
  • 1987 posts
  • Location:Helsinki, Finland

Posted 30 March 2005 - 05:39 AM

Can't you just put them in the same file?
Ihmeellinen meri

Kummalliset kalat liukuvat syvyydessä,
tuntemattomat kukat loistavat rannalla;
olen nähnyt punaista ja keltaista ja kaikki toiset värit -
mutta ihana meri on vaarallista nähdä,
se herättää tulevien seikkailujen janon:
mitä on tapahtunut sadussa, on tapahtuva minullekin.

- Edith Södergran



Amber - The BG2 NPC Mod Project Now released!
Amber's discussion forum at Gibberlings 3

#25 Domi

Domi

    Where is now your Troy, O Cassandra?

  • Gibberlings
  • 12630 posts
  • Location:Canada

Posted 30 March 2005 - 06:25 AM

No, they are separate parts of the project, installed as separate components...
Faster. Faster. Faster would be better. -Mal Reynolds, Serenity
I understand that folks prefer code that works. -CamDawg, G3

#26 jcompton

jcompton

    Lord Bigenvy

  • Members
  • 626 posts

Posted 30 March 2005 - 07:17 AM

It depends. One obvious choice is "change the install order."

If you can be assured that the scripted banters will always be installed if the non-scripted ones are going to be installed, then you can count the number of scripted banters up and use that as the WEIGHT value for the second batch. (Might be value minus 1, I forget exactly where WeiDU starts counting.)

So if you have 24 scripted banters going on first, weight the second batch with WEIGHT #24 (or #23?)
"[I]t's a testament to the determined RPG fraternity that a number of Baldur's Gate II mods have been successfully produced. The best can be found at pocketplane.net." PC Gamer UK

#27 Domi

Domi

    Where is now your Troy, O Cassandra?

  • Gibberlings
  • 12630 posts
  • Location:Canada

Posted 30 March 2005 - 07:33 AM

what if I do not weight the unscripted banters in the second batch at all? We used weight of -1 to weight all our banter above bio's small snippets, but I do not mind these ones to have the lowest priority.
Faster. Faster. Faster would be better. -Mal Reynolds, Serenity
I understand that folks prefer code that works. -CamDawg, G3

#28 jcompton

jcompton

    Lord Bigenvy

  • Members
  • 626 posts

Posted 31 March 2005 - 06:55 AM

Then that's fine too.
"[I]t's a testament to the determined RPG fraternity that a number of Baldur's Gate II mods have been successfully produced. The best can be found at pocketplane.net." PC Gamer UK



Reply to this topic



  



Also tagged with one or more of these keywords: weidu tp2 coding, tutorial, WEIGHT, lovetalks, friendtalks, troubleshooting

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users