Author Topic: Interjection Help  (Read 14149 times)

0 Members and 1 Guest are viewing this topic.

Offline Lord-Jyssev

  • Modders
  • Level 1
  • *****
  • Posts: 102
  • Karma: +4/-0
  • Gender: Male
    • View Profile
Interjection Help
« on: August 03, 2009, 02:44:01 AM »
Okay! I'm a bit confused on how to do a bit more advanced interjections. I want two new characters (one being in the party) to banter a little back and forth before eventually going onto the point.

So, let's say Bob just joined the group and I go to Jack's house because Bob told me to. If Bob wasn't in the group, Jack wouldn't have much to say, so something like..

Quote
IF ~!InParty("Bob")~ THEN BEGIN NoBob
SAY ~You're a jerk, where's Bob?~
END

When I do talk to Jack with Bob, I would like it to go something like..

Quote
Jack: Hey, Bob how're you doing, buddy?
Bob: Not bad.
Bob: Nice weather, isn't it?
Bioware NPC: Looks like killing weather.
Jack: Sure is.

Jack: Oh, here's a free longsword. (Give longsword)

END

I feel if I can get the red internal structure of the banter down, I should be able to understand how to do it. Again, I'm trying to create two new NPCs to interject each other.

Also, for my NPC, Bob, would this interjection go in his BobJ file?

Offline Ardanis

  • Newbie
  • *
  • Posts: 77
  • Karma: +12/-2
  • Gender: Male
    • View Profile
    • Email
Re: Interjection Help
« Reply #1 on: August 03, 2009, 10:19:51 AM »
IF ~!InParty("Bob")~ THEN BEGIN NoBob
SAY ~You're a jerk, where's Bob?~
++ ~~ + EXIT
END

CHAIN IF ~InParty("Bob")~ THEN JackD BobIsHere
~Hey, Bob how're you doing, buddy?~
== BobD ~Not bad.~
= ~Nice weather, isn't it?~
== BiowareD IF ~InParty(BiowareNPC)~ THEN ~Looks like killing weather.~
== JackD ~Sure is.~
= ~Oh, here's a free longsword.~ DO ~GiveItemCreate("jacksw",Player1,1,1,1)
EXIT


Offline Lord-Jyssev

  • Modders
  • Level 1
  • *****
  • Posts: 102
  • Karma: +4/-0
  • Gender: Male
    • View Profile
Re: Interjection Help
« Reply #2 on: August 03, 2009, 10:52:00 AM »
Okay, thanks! So with that, what would I put for Jack's dialogue file? Anything? Should I just have it compile the first conversation first, before it compiles BobJ?

Offline Sasha Al'Therin

  • Newbie
  • *
  • Posts: 21
  • Karma: +2/-0
    • View Profile
Re: Interjection Help
« Reply #3 on: August 03, 2009, 04:38:27 PM »
There are several ways you could probably do this.  But both the "BobD" and "JackD" files need to exist before the CHAIN will work.

Your .tp2 code could look like:
Code: [Select]
COMPILE ~mymod\dlg\BobD.d~
COMPILE ~mymod\dlg\JackD.d~
COMPILE ~mymod\dlg\CHAIN.d~
The contents of BobD would be whatever you currently have up to this point.

The contents of JackD would be as follows:
Code: [Select]
//----Start Jack's dialog
BEGIN JackD //tells weidu that I want to create a dialog file called "JackD"
//Jack's first state
IF ~!InParty("Bob")~ THEN BEGIN NoBob
SAY ~You're a jerk, where's Bob?~
++ ~~ + EXIT
END

The contents of CHAIN.d would be as follows:
Code: [Select]
//----Start Jack and Bob banter
CHAIN IF ~InParty("Bob")~ THEN JackD BobIsHere
~Hey, Bob how're you doing, buddy?~
== BobD ~Not bad.~
= ~Nice weather, isn't it?~
== BiowareD IF ~InParty(BiowareNPC)~ THEN ~Looks like killing weather.~
== JackD ~Sure is.~
= ~Oh, here's a free longsword.~ DO ~GiveItemCreate("jacksw",Player1,1,1,1)
EXIT

This setup would allow you to use the CHAIN.d for future banters and such that might take place between Bob and other characters (provided of course that the dialog files for all characters involved exist prior to compiling CHAIN.d)...

Offline Lord-Jyssev

  • Modders
  • Level 1
  • *****
  • Posts: 102
  • Karma: +4/-0
  • Gender: Male
    • View Profile
Re: Interjection Help
« Reply #4 on: August 04, 2009, 08:33:46 AM »
Ah, okay. This look quite a bit clearer! Okay, one last thing.. My personal modding prefix is "L!", however when I put this in the BEGIN header as, say, BEGIN L!JACKD, weidu is unable to compile it. Is it possible for the BEGIN header to have a different name than the file's name? I can't see a way to get around this while still using my prefix..

Offline Ardanis

  • Newbie
  • *
  • Posts: 77
  • Karma: +12/-2
  • Gender: Male
    • View Profile
    • Email
Re: Interjection Help
« Reply #5 on: August 04, 2009, 11:57:38 AM »
Quote
Is it possible for the BEGIN header to have a different name than the file's name?
Filename - I assume you mean xxxx.d - can be anything you please, only it's content is what matters. Just as the .tp2 code can be split into many files bearing any kind of names, so can be the .d code. You can put many BEGINs or APPENDs in a single file, then prior to compling first copy all needed .dlg files (empty) to override and then compile one huge .d file. Comfort wise, of course, it usually helps to have banters in one .d, quest lines - in another, etc.

Regarding BEGIN. It creates the .dlg file, so only use it if there's no such file already in existence, least it'll be overwritten and everything therein shall be lost. So if you know that there's no such a file (or it's empty), then use it if you please, otherwise APPEND is your friend.

Personally I prefer to COPY all new .dlgs and only after begin filling them up. This way there's no need to think which one to compile first, since as Sasha pointed out it's not possible to link to non-existing one.
« Last Edit: August 04, 2009, 12:10:12 PM by Ardanis »

Offline Sasha Al'Therin

  • Newbie
  • *
  • Posts: 21
  • Karma: +2/-0
    • View Profile
Re: Interjection Help
« Reply #6 on: August 04, 2009, 12:58:49 PM »
You could try BEGIN ~L!JackD~  The tildas should force weidu to treat the contents as a string. (but I won't make any guarantees you'll need to test it out to see if it'll work...)

Offline Lord-Jyssev

  • Modders
  • Level 1
  • *****
  • Posts: 102
  • Karma: +4/-0
  • Gender: Male
    • View Profile
Re: Interjection Help
« Reply #7 on: August 05, 2009, 01:48:26 PM »
Quote
BEGIN ~JackD~

IF ~!InParty("Bob") Global("L!Bobquest","GLOBAL",0) GlobalLT("L!Jackgavesword","LOCALS",1)~ THEN BEGIN NoBobNoQuest
SAY ~Gee-golly-wiz, I sure wish Bob were here.~
++ ~~ THEN EXIT
END

Why is it that Weidu can't compile this? It has a problem with the instance of "THEN". It appears correct in game, when I have to go and edit the dialogue to put the "THEN" in again. When it's left out, however, the dialogue is flawed. In game, the "END DIALOGUE" button at the bottom of the dialogue screen doesn't even show.

It's also unable to compile this:
Quote
++ ~~ + EXIT
So I had to find an alternate way to compile.. I'm running Weidu 211, if that's relevant.
« Last Edit: August 05, 2009, 01:54:08 PM by Lord-Jyssev »

Offline Solaufein

  • Lord of the Realms
  • Administrator
  • Level 5
  • *****
  • Posts: 5149
  • Karma: +127/-19
  • Gender: Male
  • The night is dark and full of terrors...
    • ICQ Messenger - 251194643
    • Yahoo Instant Messenger - gscott7833
    • View Profile
    • http://teambg.net
Re: Interjection Help
« Reply #8 on: August 05, 2009, 02:46:20 PM »
BEGIN ~JackD~

IF ~!InParty("Bob") Global("L!Bobquest","GLOBAL",0) GlobalLT("L!Jackgavesword","LOCALS",1)~ THEN BEGIN NoBobNoQuest
SAY ~Gee-golly-wiz, I sure wish Bob were here.~
++ ~~
IF ~~ THEN EXIT
END
My mods:
Dark Horizons
The Undying
Nikita
IWD2 store

Co-contributor:
Dark Side of the Sword Coast BG1 Weidu
Aurils Bane
Encounters
Saerileth
Baldur's Gate - Enhanced Edition beta tester
Baldur's Gate 2 - Enhanced Edition beta tester
Icewind Dale - Enhanced Edition beta tester

Offline Lord-Jyssev

  • Modders
  • Level 1
  • *****
  • Posts: 102
  • Karma: +4/-0
  • Gender: Male
    • View Profile
Re: Interjection Help
« Reply #9 on: August 05, 2009, 04:44:08 PM »
BEGIN ~JackD~

IF ~!InParty("Bob") Global("L!Bobquest","GLOBAL",0) GlobalLT("L!Jackgavesword","LOCALS",1)~ THEN BEGIN NoBobNoQuest
SAY ~Gee-golly-wiz, I sure wish Bob were here.~
++ ~~
IF ~~ THEN EXIT
END

Ah, thanks for that Sola. It seems that the red is the thing to put, instead of the yellow. Works like a charm now!

Offline Solaufein

  • Lord of the Realms
  • Administrator
  • Level 5
  • *****
  • Posts: 5149
  • Karma: +127/-19
  • Gender: Male
  • The night is dark and full of terrors...
    • ICQ Messenger - 251194643
    • Yahoo Instant Messenger - gscott7833
    • View Profile
    • http://teambg.net
Re: Interjection Help
« Reply #10 on: August 06, 2009, 03:55:53 PM »
Yeah you don't need ++ ~~ it would just give you a blank dialog option.
My mods:
Dark Horizons
The Undying
Nikita
IWD2 store

Co-contributor:
Dark Side of the Sword Coast BG1 Weidu
Aurils Bane
Encounters
Saerileth
Baldur's Gate - Enhanced Edition beta tester
Baldur's Gate 2 - Enhanced Edition beta tester
Icewind Dale - Enhanced Edition beta tester