Jump to content



Recommended Posts

EXTEND_BOTTOM is a really useful function, but I'm afraid to use it.


My concerns revolve around compatibility.


What happens if two mods extend the bottom of the same state? Will both of them run, or will the second negate the first, possibly hosing a quest for a different mod?


What happens when one mod extends the bottom of a state, and another mod interjects into the same state?


There isn't a single EXTEND_BOTTOM in Gavin, because I know where the ones in BG1 NPC are, and could avoid interjecting into those states. But now I'm moving into BG2 land, and the answers to those two questions become more important. For one thing, there are a lot more BG2 mods, and therefore a greater chance for conflict. Avoiding states in BG2 just isn't practical, because most of the important ones already have one or more modifications.


Edit: attempting to post while rushed leads to confusing posts.

Link to comment

All of WeiDU's fancy-pants INTERJECT_FOO commands are essentially automated EXTEND_BOTTOMs (and typically a COPY_TRANS, depending on your flavor of INTERJECT). Multiple E_Bs will not overwrite one another, but there is some danger for compatibility if you're basically redirecting a state. It's probably easier to discuss with specific examples--do you have something in mind already?

Link to comment

This post got me thinking that just about every romance with a vampiric abduction is going to need to do something with these guys. Since extending the bottom of these states is probably the easiest way to get a "How do I go about raising my lover from the dead?" question in, we're all going to be doing more or less the same thing.


In one of my contributions to the Romantic Encounters mod, I extend the bottom of Weathermistress Ada's dialogue for a male PC. I can't imagine too many other mods do it, but she's involved in the Thief Stronghold quest, and I wouldn't want to mess that up!


But from the looks of things, you can add as many PC responses to the bottom of a state as you want. That's good to know. ;)

Link to comment

The problem with E_B and many of the other cool WeiDU stuff is figuring a way to add the stuff without conflicting at all with another mod, i.e., transitioning back into things without having duplicate/repeating states (The BG1 NPC Project "Zeke and Jahiera over Branwen" is an example, I think - we have to go fix that one - Jaheira intervenes, but then if you talk to Zeke again, the original line plays). This means that you can actually be ok with E_B, as long at the state is not permanently hijacking the original. Of course, it leads to oddities when you have one set of interactions and then another with the same NPC...


I have been playing with this for awhile and would love more notes on how to successfully add content in a manner that stops this potential conflict. So far, the only way I have come up with is to ADD_TRANS_ACTION (or similar) a variable, and have this variable trigger a separate temporarily assigned .DLG, toggling on and off from the .BAF extension. So,


set a variable from original content


then in .bcs if variable = 1 then set NPC .dlg fle to a "shell file", and initiate contact again


then in .DLG advance variable


then in .bcs if variable = 2 reset .dlg file and contimue.


I have not fully tested this idea, and have not implemented it via a mod, but it seemed to me that if we can have an "alternate stateset" for dialogues, where a toggled variable "RE_SheriBawdySong" = 1 means thhat one state jumps to the top and preempts all other dialogue states until it is toggled off, we should be able to do the same using the scripts and dialogue files assigned.

Link to comment

I'm going to wait until I'm at home, relaxing over a glass of wine, to see if I can understand any of what you just said.


And then I'm going to go look at the Jaheira/Zeke interactions to see if it helps when I look at an example.

Link to comment

E_B can be done just as smoothly as interjects--after all, the interject commands are simply shortcuts for the more common E_B code. There's simply no way around different mods trying to redirect the same states in different directions. This is not a problem inherent to using E_B.


For something like Kulyok's example above, this is not only sensible but desirable. Bodhi can not kidnap more than one romance interest, so you do indeed want to exclude the existing dialogue branches.

Link to comment

There are two different cases of EXTEND_BOTTOM.


The first case is EXTEND_BOTTOM in the state with replies, like in my WARSAGE example. This is very simple - a reply gets added.


If the player follows this reply, he either

- follows a modder-created branch, exits and is able to initiate this dialogue again and return to this state again

- follows a modder-created branch and gets COPY_TRANS into the same state (these are two "polite metods" of interjecting)

- follows a modder-created branch and gets to the same place where it'd get if the player was using a Bioware reply(for example, if the mod adds replies just for the sake of it - can be dangerous, but mostly harmless);

- follows a modder-created branch and NEVER returns to the same state again (not nice, not polite, don't do it unless you necessarily have to).



Now, the second EXTEND_BOTTOM, into the state that has no replies. Bodhi's abduction is just such a state.


If you do this EXTEND_BOTTOM, you will simply transition the dialogue to your branch, with no alternatives. However(big however), if some other modder EXTENDS_BOTTOM, and you install his mod after yours, his EXTEND_BOTTOM will trigger, not yours(depending on conditions, of course). If he used a "polite" method, and COPY_TRANS'ed back, you're all right. Otherwise, you're screwed.


For something like Kulyok's example above, this is not only sensible but desirable. Bodhi can not kidnap more than one romance interest, so you do indeed want to exclude the existing dialogue branches.


If you look at Sola's code, you see that she can and does. If you look at Xan's code, you see that it is multiple romance-friendly, though, of course, the mod is initially designed to give the player a unique romance, not a harem.


I would recommend to EXTEND_BOTTOM BODHIAMB X,

but then to COPY_TRANS BODHIAMB X, so that other possible reactions/interjections(heck, she might kidnap Imoen's romance interest from mod ABCD, from what we know!) get through.

Link to comment
I need to go revisit COPY_TRANS...

You're already using it, you just don't realize it. The following two blocks of code will do exactly* the same thing:


 == BAR IF ~See(Player1)~ THEN ~Look, I'm interjecting!~ 


 IF ~~ THEN BEGIN CDInterject1 SAY ~Look, I'm interjecting!~ 

 IF ~See(Player1)~ THEN EXTERN BAR CDInterject1


You can see why I_C_T is preferred. ;) INTERJECT is basically the same except with a GOTO/EXTERN as the reply option instead of the COPY_TRANS.


Ah, you youngsters. Never had to learn the hard way of dialogue coding. (Now JC can show up and call me a youngster for coming into modding after CHAINs. ;) )


* Well, OK, I_C_T actually adds a global variable named CDInterject1 in the first case and increments it to ensure your interjection doesn't happen more than once. You can usually skip this for manual E_Bs since most occur in one-time-only states.

Link to comment

Now I understand! It wasn't EXTEND_BOTTOM that was giving me trouble, it was COPY_TRANS.


The problem was that I was thinking of a state as a discrete entity, when actually, it is composed of two distinct parts, the state and the transition(s). TRANS doesn't actually stand for "across," as I had previously thought, but "transition."


I could figure out what just extending the bottom of a state did, whether using EXTEND_BOTTOM or INTERJECT, but the second part, COPY_TRANS, the modder-friendly part, was completely eluding me.


Let me test my newfound understand by explaining it back.


In the following hypothetical example, the "state" is the part the aunt says, and the transitions are the PC responses, or, more precisely, the EXIT, GOTO, or EXTERN following the PC responses.

IF ~IsGabber(Player1)~ THEN BEGIN 0
SAY ~Would you like some pie?~
IF ~~ THEN REPLY ~Yes, please.~ THEN DO ~GiveItemCreate("pie",Player1,0,0,0)~ GOTO 1
IF ~~ THEN REPLY ~No, thank you.~ THEN EXIT

SAY ~There you go. Enjoy!~


If I wanted to add a transition, where the PC could ask what kind of pie, but still return to the original state, while allowing other mods to do whatever they wanted to do to the aunt's dialogue, I would use an EXTEND_BOTTOM to add a PC response and transition, and then *copy the transitions* from the previous state to make sure that the structure of the original dialogue was preserved.

IF ~~ THEN REPLY ~Ooh, what kind of pie?~ THEN GOTO WhatKind


SAY ~Apple. Want some?~


On the screen, it would look like:

Aunt: Would you like some pie?

1: Ooh, what kind of pie?

2: Yes, please.

3: No, thank you.


And, if the player chose option 1, the next screen would look like:

Aunt: Apple. Want some?

1: Yes, please.

2: No, thank you.



Link to comment


This topic is now archived and is closed to further replies.

  • Create New...