Jump to content

Adding an optional answer post a dialog exit


deratiseur

Recommended Posts

Please, for my new mod, i've tried to find an answer in the tp2 of over mods, but i didn't find a way to solve my problem.

 

i want to add an entry to a the vaelasa dialog, like this :

 

vanilla dialog :

 

IF ~~ THEN BEGIN 8
SAY #37429
IF ~~ THEN DO ~SetGlobal("frLeaveDryads","ar1200",1)
EraseJournalEntry(34092)
EraseJournalEntry(34093)
EscapeArea()~ SOLVED_JOURNAL #47779 EXIT
END

 

Dialog I need :

 

IF ~~ THEN BEGIN 8
SAY #37429
IF ~!Global("questTragar","LOCALS",1)~ THEN DO ~SetGlobal("frLeaveDryads","ar1200",1)
EraseJournalEntry(34092)
EraseJournalEntry(34093)
EscapeArea()~ SOLVED_JOURNAL #47779 EXIT
IF ~Global("questTragar","LOCALS",1)~ THEN REPLY @23 DO ~SetGlobal("frLeaveDryads","ar1200",1)
EraseJournalEntry(34092)
EraseJournalEntry(34093)
EscapeArea()~ SOLVED_JOURNAL #47779 GOTO PoudredeFée

END

Link to comment

What do you want that dialogue to look like to the player? Is @23 a new reply option for the PC? Who says whatever line is at PoudredeFée?

 

Vaelasa says at 8:

 

~Thank you, <CHARNAME>. The forest welcomes you. There has been evil near here and I pray for your safety as you travel. Good bye!~

 

What do you want to happen next?

Link to comment

I want to add the question : "wait !! Please, i'm looking for faerie powder, Can you ask for your forest sisters's ?"

And Vaelas say "wait a minute", the screen fade black, and she return to give the faerie powder to charname.

 

The faerie powder is a component the player have to find for a quest.

 

note : sorry if my text isn't so clear; i mod in french, .

Link to comment

In that case...

 

The common way to add an extra dialogue option is with EXTEND_BOTTOM. However, you can only do that when there are other player-choosable transitions. So, you can try this instead:

 

 

INTERJECT ~VAELASA~ 0 MyInterjectGlobal
== ~VAELASA~ IF ~Global("MyQuestVariable","GLOBAL",1)~ THEN ~The trees call...~
END

++ ~Wait!! Please, I'm looking for faerie powder. Can you ask for your forest sisters'?~ + PoudredeFée

++ ~Goodbye, fair lady.~ + AlternateExit

 

CHAIN IF ~~ THEN ~VAELASA~ PoudredeFée

~We would not normally share such a thing, but...~

DO ~FadeToColor([20.0],0)
Wait(2)
FadeFromColor([20.0],0)
GivePartyItem("MyQuestItem")
IncrementGlobal("MyQuestVariable","GLOBAL",1)~
END
IF ~~ + AlternateExit

 

CHAIN IF ~~ THEN ~VAELASA~ AlternateExit

~Goodbye, god-child.~

END

COPY_TRANS ~VAELASA~ 8

 

Some Notes:

 

1. It's best to use a unique modder prefix for any variables or new items that you use.

 

2. Unless Vaelasa is the only creature that sets and reads "questTragar" then it needs to be a GLOBAL.

 

3. I used COPY_TRANS to finish out the dialogue as close to the original game as possible. This is friendly to other mods.

 

4. "MyInterjectGlobal" needs to be unique, preferably with your modder prefix in front.

 

5. (This probably won't mean much right now, but it might be useful to you later.) The INTERJECT and CHAIN used chain-text, which is designed to work with multiple dialogue files, but doesn't have to. I stayed inside Vaelasa's file, so I could use "+ statelabel" for my transitions. If I'd been switching between different speakers, it would have to have been "EXTERN ~NEWFILE~ statelabel".

 

**

 

I hope that helps.

Link to comment

Theoretically, your original idea would be feasible by:

/* add the variable check to the original transaction. */
ADD_TRANS_TRIGGER vaelasa 8 ~!Global("questTragar","LOCALS",1)~

/* now add your reply option */
EXTEND_BOTTOM vaelasa 8
IF ~Global("questTragar","LOCALS",1)~ THEN REPLY @23 DO ~SetGlobal("frLeaveDryads","ar1200",1)
EraseJournalEntry(34092)
EraseJournalEntry(34093)
EscapeArea()~ SOLVED_JOURNAL #47779 GOTO PoudredeFée
END

YOu'd have to try in the game, though, how the mixture of transactions / reply options work out. It could work for BGII / BG:EE. I am very sure that for classic BG1, this kind of mixing wouldn't work in the game.

What Thimblerig wrote is more elegant, but [EDIT] both have the risk that a mod installed after yours isn't working any more if it also adds transactions to state 8.

Link to comment

It's this bit that's the problem:

 

/* now add your reply option */
EXTEND_BOTTOM vaelasa 8
IF ~Global("questTragar","LOCALS",1)~ THEN REPLY @23 DO ~SetGlobal("frLeaveDryads","ar1200",1)

 

I've tried using E_B to add a dialogue reply to a state with none before, several different ways. It compiles, the new reply shows up, but choosing it always leads to the original transition.

 

EDIT: I stand corrected! Jastey's method, with adding a new trigger to dummy out the original transitions, works just fine in BG2. Which is good to know. :)

 

(However, that chain of replies still needs to lead back to VAELASA 8 or the same risk of losing later mod alterations stands.)

 

**

I can think of a couple of alternatives that are friendlier to later mods, Deritaseur, depending on whether you want the return of the acorns to be a necessity for your fairy dust quest or not. If you don't think it will spoil things, can you tell us the story?

Link to comment

Curiosity is a bad thing ^^

 

My mod consist of the encounter of a Blue Ogre who say he is a dwarf, polymorfed after the use of a potion of "permanent strengh" sold by a gnome merchant. The merchand propose to make another potion to cure the dwarf, but his commis is missing, so the character have to find the components. This is for the first quest, there are two more (one is rescue the commis). The ogre can be invited as a companion, but for the moment he hasn't banters. And the new shop is....... special :)

I have integred 2 copies of the faerie dust, and the comment is "this precious component can be used for many magical manipulations", so yes, maybe it can be inclused in another mods.

Link to comment

(However, that chain of replies still needs to lead back to VAELASA 8 or the same risk of losing later mod alterations stands.)

(Facepalm) Of course, that is correct, my babbling about better compatibility for the one method is nonsense, indeed (it all opens a new dialogue path away from the original state, so yes, please include the COPY_TRANS to close it in the end - which will at least make it compatible with mods installed before yours.)

Link to comment

 

 

My mod consist of the encounter of a Blue Ogre who say he is a dwarf, polymorfed after the use of a potion of "permanent strengh" sold by a gnome merchant. The merchand propose to make another potion to cure the dwarf, but his commis is missing, so the character have to find the components. This is for the first quest, there are two more (one is rescue the commis). The ogre can be invited as a companion, but for the moment he hasn't banters. And the new shop is....... special :)

 

That does sound fun :)

 

Do you need to make returning the acorns a prerequisite for getting the fairy powder? Because Vaelasa's initial dialogue states repeat, so you could do:

 

EXTEND_BOTTOM ~VAELASA~ 0 1

+ ~!PartyHasItem("misc4n")~ + ~I regret disturbing your revels, but may I ask you for some faerie powder? Please?~ + PoudredeFée

+ ~PartyHasItem("misc4n")~ + ~I bring something from your sisters, but first, may I ask you for some faerie powder? Please?~ + PoudredeFée

Link to comment

For now, my mod use the code of Jastey, because its what i have expected, AND because i haven't undestoud anything about he CHAIN command :-/

I really try to understand the chain command for the compatibilty with overs mods, but this code not suit the tutorials i have read :-/

Link to comment

Archived

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

×
×
  • Create New...