Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

New Premium Module: Tyrants of the Moonsea! Read More
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

Need some help with interjections in BG2EE dialogs

Wizer13Wizer13 Member Posts: 63
Hi, I looked at various ways to code interjections, but I do not seem to understand the gist of it. Using Notepad++ and weidu highlighters, it underlines the "==" when I reference to which dialog, then parsing errors, etc.

Here's the situation: Buliard (PPBBul) - My prefix is PP on Blackwyrm forum- will interject one line in Morda's dialog (PPMorda).

Here's what I wrote:

IF ~~ THEN BEGIN Relics
SAY ~Ugwaerel can access it because of her pinky. It's a relic of Vec...(Buliard tries to shut her down, but came too late).~
INTERJECT_COPY_TRANS PPBul.d @171 PPChain1
== PPBul
IF ~!StateCheck("PPMord",CD_STATE_NOTVALID)~ THEN
~(He spits) Nobody can have those unless they are initiated! So don't even think about it!~
END

That would help me a lot to understand the rest. Thank you for your time!

Comments

  • PaulaMigratePaulaMigrate Member Posts: 1,201
    Is all of that your own dialog? In this case write it using CHAIN.

    If the Morda text already exists you need to
    INTERJECT_COPY_TRANS Morda 11 PPChain1 //Where Morda is that dialog name and 11 is the state you target.

  • Wizer13Wizer13 Member Posts: 63
    Hi again Paula, thanks again for your patience!

    I tried the line of code, exchanging some infos- It's the opposite, It's a line of PPBul.d (Buliard) I try to interject in PPMord.d(Morda):

    INTERJECT_COPY_TRANS PPBul.d @178 PPChain1//== Buliard : (He spits) Nobody can have those unless they are initiated! So don't even think about it!

    But somehow, it tells me Parsing error.

    I also tried to use CHAIN, with similar results. Here's one I tried. If I could see my errors, that would Help me A LOT to understand the rest. I don't understand why it underlines == and my identifiers (PPJus and PPDevo), like is is parsing errors or something.



    CHAIN
    IF ~SetGlobal("DEV_TEST","LOCALS",0)
    Global("PPDevoExists","ARCC14",1)
    See("PC")
    !StateCheck("PC",STATE_SLEEPING)~ THEN PPDevo Testimonychain
    ~Thank you, your Highness! I did saw those miscreants! I've asjked humbly if they served our Great Lord Vecna, to which they replied: " You'll burn in the Nine Hells for adoring a false god!". They then proceeded to tear my holy symbol from my neckand spit on it!~
    DO ~SetGlobal("DEV_TEST","LOCALS",1)~
    == PPJus
    ~Oh!!! The outrage! What did you do, next? Please, be precise.~
    == PPDevo
    ~(He begins to cry) I admit, tho my shame, I couldn't stop this sacrilege! Those heretics were too powerful to overcom, even for my bodyguards!~
    == PPJus
    ~Members of the jury, please note the violence the accused used on a humble priest of our Mighty Lord. Do continue. What happened, next?~
    == PPDevo
    ~I ran away. I had to warn the authorities of the danger they faced! My guards sacrificed themselves valliantly to cover my retreat...~
    == PPJus
    ~Their names shall be recorded in the Halls of Honor.~
    == PPDevo
    ~I demand Justice! To the pyre with those faithless!!!~
    == PPJus
    ~Justice shall be done, today, rest assured. Thank you for your courage, brother.~
    == PPDevo
    ~(As he quits, the devout smiles wickedly back at you, sealing your doom.)~
    EXIT

    Thanks for your time!

  • PaulaMigratePaulaMigrate Member Posts: 1,201
    In the CHAIN, remove the spaces between == and dialogue name e.g. ==Pdevo

    the other one

    INTERJECT_COPY_TRANS PPMord 178 PPChain1 // If PPmord is the dialog you target and state 178 is where you want to interject - PPChain1 is your interjection but also a name of the Global that will be set once the interjection was performed (you will have a Global("PPChain1","Global",1).
    ==PPBull IF~InParty("PPBull") ~THEN~ (He spits) Nobody can have those unless they are initiated! So don't even think about it!~
    END

    Wizer13
  • jasteyjastey Member Posts: 1,507
    Your CHAIN looks alright enough (details show when you try to compile it, but from what I see it looks alright coding wise). What exactly is your problem? If it is only the highlighters in Notepad++ I wouldn't go by them. What WeiDU tells you upon installation is what counts. (And it's no wonder it underlines your dialogue names, because it doesn't know them. Not sure why it also underlines the doubled ==, but they are needed for CHAIN.)

    @PaulaMigrate The space doesn't change anything, I always put a space in because I thhink it's better to read.

    Wizer13
  • PaulaMigratePaulaMigrate Member Posts: 1,201
    jastey said:

    Your CHAIN looks alright enough (details show when you try to compile it, but from what I see it looks alright coding wise). What exactly is your problem? If it is only the highlighters in Notepad++ I wouldn't go by them. What WeiDU tells you upon installation is what counts. (And it's no wonder it underlines your dialogue names, because it doesn't know them. Not sure why it also underlines the doubled ==, but they are needed for CHAIN.)

    @PaulaMigrate The space doesn't change anything, I always put a space in because I thhink it's better to read.

    It was the only thing in CHAIN that I could identify as different to how I would do it, but if you say that space does not matter, it's probably right. It makes no difference anywhere else, so why should it here. If there's no compile error, there is nothing to analyse here.

  • Wizer13Wizer13 Member Posts: 63
    Just to get this straight.

    PPBul isn't in the party, so will it work if I just place a

    !StateCheck("PPBull",CD_STATE_NOTVALID) as a condition?

    In an interjection, I have to reference the line from which dialog? The one where it will came from, or the line where I want it to happen? Sorry if I appear clueless, but that's bugging me.

    Paula, you said : INTERJECT_COPY_TRANS PPMord 178 PPChain1

    So if in my dialog that line appears at line 96 in PPMord, I should write:

    INTERJECT_COPY_TRANS PPMord 96 PPChain1

    Or, do I reference the line from PPBul:

    INTERJECT_COPY_TRANS PPBul @178 PPChain1

    Afterwards, I add a DO Global("PPChain1","Global",1) To make sure it just appears one time.

    Thank you both for your time!

  • jasteyjastey Member Posts: 1,507
    Wizer13 said:

    Just to get this straight.

    PPBul isn't in the party, so will it work if I just place a

    !StateCheck("PPBull",CD_STATE_NOTVALID) as a condition?

    And add something like InMyArea("") or Detect("") to make sure the character is actually there.
    Wizer13 said:

    Just to get this straight.
    In an interjection, I have to reference the line from which dialog? The one where it will came from, or the line where I want it to happen? Sorry if I appear clueless, but that's bugging me.

    Both:

    INTERJECT_COPY_TRANS ~the dlg your character is supposed to interject into~ ~the dialogue state~ ~your interjection variable~
    == ~your characters dlg~ IF ~conditions, e.g. the mentioned CD_STATE_NOTVALID and Detect~ THEN ~blabla~ DO ~actions your character performs~
    EXIT
    Wizer13 said:


    Paula, you said : INTERJECT_COPY_TRANS PPMord 178 PPChain1

    So if in my dialog that line appears at line 96 in PPMord, I should write:

    INTERJECT_COPY_TRANS PPMord 96 PPChain1

    Yes.
    Wizer13 said:


    Or, do I reference the line from PPBul:

    INTERJECT_COPY_TRANS PPBul @178 PPChain1

    No.
    Wizer13 said:


    Afterwards, I add a DO Global("PPChain1","Global",1) To make sure it just appears one time.

    The "PPChain1" in your example above *is* the interjection variable. Have a look into the weidu readme to see how I_C_T looks if it is compiled.

  • Wizer13Wizer13 Member Posts: 63
    Okay... I must really suck at coding, it seems... Here's the results:

    In PPMord.dlg, I typed this:

    IF ~~ THEN BEGIN Relics
    SAY ~Ugwaerel can access it because of her pinky. It's a relic of Vec...(Buliard tries to shut her down, but came too late).~
    INTERJECT_COPY_TRANS ~PPMord~ ~96~ ~Relics~
    == ~PPBul~ IF ~!StateCheck("PPBull",CD_STATE_NOTVALID) Detect("PPBul")~ THEN ~(He spits) Nobody can have those unless they are initiated! So don't even think about it!~
    EXIT
    IF ~CheckStatGT("PC",15,CHR)~ THEN REPLY ~Of course. But then, Iuz as already won... Desperate times; desperate mesures.~ GOTO Damn
    IF ~~ THEN REPLY ~Initiate us, then. I'm ready to join Vecna's cause~ GOTO Ug
    IF ~~ THEN REPLY ~If you know a way to get those, tell me now. No time to waste!~ GOTO Secret
    IF ~Global("QUEST_COMP","GLOBAL",1)~ THEN REPLY ~I've heard the Maleficarum Compendium can open the way. Would that be and adequate option?~ GOTO Arch
    IF ~CheckStatGT("PC",15,INT)~ THEN REPLY ~Isn't the Maleficarum Compendium able to open the way? It is an artefact of the cult.~ GOTO Arch
    END

    In my PPBul.dlg, I typed this:

    INTERJECT_COPY_TRANS ~PPMord~ ~96~ ~Relics~
    == ~PPBul~ IF ~!StateCheck("PPBul",CD_STATE_NOTVALID) Detect("PPBul")~ THEN ~(He spits) Nobody can have those unless they are initiated! So don't even think about it!~
    END

    When I compile, it gives me this:

    ERROR locating resource for 'CHAIN3'
    Resource [PPMORD.DLG] not found in KEY file:
    [./chitin.key]
    ERROR: preprocessing APPEND_EARLY [PPNPC/Dialog/PPBul.d]: Failure("resource [PPMORD.DLG] not found for 'CHAIN3'")
    Stopping installation because of error.

    ERROR Installing [PPNPC Tutorial for BGEE], rolling back to previous state
    Will uninstall 1 files for [SETUP-PPNPC.TP2] component 0.
    Uninstalled 1 files for [SETUP-PPNPC.TP2] component 0.
    ERROR: Failure("resource [PPMORD.DLG] not found for 'CHAIN3'")
    PLEASE email the file SETUP-PPNPC.DEBUG to Wizer13
    Using Language [American English]

    Surely something I don't understand.

  • Wizer13Wizer13 Member Posts: 63
    It's okay! I finally understood it! :D

  • jasteyjastey Member Posts: 1,507
    edited August 2017
    Writing the I_C_T into your own dialogue state like this doesn't work, but I take it you solved it?
    (I_C_T into your own dialogue state inside the same .d-file does work, just not putting it inside the dialogue state iteself.)

    Wizer13
  • PaulaMigratePaulaMigrate Member Posts: 1,201
    edited August 2017
    If you want this to be the final conversation, this is the code

    In PPMord.dlg, I typed this:

    Provided both dialogues exist, i.e. somewhere you have BEGIN PPMord and BEGIN PPBul

    CHAIN
    IF ~~ THEN BEGIN PPMord Relics
    ~Ugwaerel can access it because of her pinky. It's a relic of Vec...(Buliard tries to shut her down, but came too late).~
    == ~PPBul~ IF ~!StateCheck("PPBull",CD_STATE_NOTVALID) Detect("PPBul")~ THEN ~(He spits) Nobody can have those unless they are initiated! So don't even think about it!~
    END
    IF ~CheckStatGT("PC",15,CHR)~ THEN REPLY ~Of course. But then, Iuz as already won... Desperate times; desperate mesures.~ GOTO Damn
    IF ~~ THEN REPLY ~Initiate us, then. I'm ready to join Vecna's cause~ GOTO Ug
    IF ~~ THEN REPLY ~If you know a way to get those, tell me now. No time to waste!~ GOTO Secret
    IF ~Global("QUEST_COMP","GLOBAL",1)~ THEN REPLY ~I've heard the Maleficarum Compendium can open the way. Would that be and adequate option?~ GOTO Arch
    IF ~CheckStatGT("PC",15,INT)~ THEN REPLY ~Isn't the Maleficarum Compendium able to open the way? It is an artefact of the cult.~ GOTO Arch

    There is no need whatsoever for an interjection here.

    Wizer13
  • Wizer13Wizer13 Member Posts: 63
    What I just don't understand if CHAIN works like INTERJECTION_COPY_TRANS, is the difference between both. From what I've seen, though, CHAIN enable to put multiples SAYS from various characters that are in the area or in your party, or can we also do this with INTERJECT?

    When is an INTERJECT or CHAIN useful?

  • PaulaMigratePaulaMigrate Member Posts: 1,201
    Wizer13 said:

    What I just don't understand if CHAIN works like INTERJECTION_COPY_TRANS, is the difference between both. From what I've seen, though, CHAIN enable to put multiples SAYS from various characters that are in the area or in your party, or can we also do this with INTERJECT?

    When is an INTERJECT or CHAIN useful?

    If you write the whole dialogue with all the involved actors yourself, use CHAIN. It works like shorthand for moving the dialogue back and forth .
    If you want to insert your lines into an existing dialogue (e.g. a vanilla game talk) you use I_C_T, to preserve the original dialogue and all its triggers. Your line only fires, if your NPC is present, otherwise the talk triggers just as well without it.

    Wizer13
Sign In or Register to comment.