Author Topic: Simulating BG1 dialogue behaviour in BG2 (when an NPC has no valid dialogue)  (Read 4472 times)

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
So here's the lowdown, as I'm sure pretty much everyone with BG1 and BG2 knows.  In BG1, if you spoke to a person who had no valid states, his circle would simply glow white and he'd say a random line, as if you'd right-clicked him.  In BG2, an ugly "this person has nothing to say to you" message pops up.

Can anyone think of a decent way of detecting when a creature has been clicked?  I figured the appropriate action would be VerbalConstant(Myself,26 through 31), but the trigger to cause this eludes me.

So far Clicked([ANYONE]) doesn't work.
Earn Money Sleeping.

Offline Echon

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 1941
  • Gender: Male
    • The Fields of the Dead
There does not appear to be such a trigger.

-Echon

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Well, yeah.  ;)  I was asking if anyone could think of a reasonably workable way of getting it to work... somehow.  Globals, EFFs, WHILE loops.  I dunno!  Something!  Heheh.
Earn Money Sleeping.

Offline Echon

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 1941
  • Gender: Male
    • The Fields of the Dead
* And I cannot think of any possible workaround either. :)

-Echon

Offline Andyr

  • Dance Commander
  • PPG
  • Planewalker
  • *****
  • Posts: 3178
  • Gender: Male
    • The Gibberlings Three IE mod community
Well, yeah.  ;)  ... WHILE loops....

You have been contaminated! Flee to G3, infidel!

For a workaround, how about using the strings from their sounds to make them a new dialogue? So they would have something to say, which would be random claptrap from the lines you used to click on them to hear.
"We are the Gibberlings Three, as merry a band as you ever did see..." - Home of IE mods

<jcompton> Suggested plugs include "Click here so Compton doesn't ban me. http://www.pocketplane.net/ub"

I am unfortunately not often about these days so the best way to get hold of me is via email.

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
That's what I was thinking, yeah.  Sort of sucks that the dialogue window has to open, but oh well.
Earn Money Sleeping.

Offline Andyr

  • Dance Commander
  • PPG
  • Planewalker
  • *****
  • Posts: 3178
  • Gender: Male
    • The Gibberlings Three IE mod community
Roughly how many different creatures in Tutu are there who'd need dialogue like this?
"We are the Gibberlings Three, as merry a band as you ever did see..." - Home of IE mods

<jcompton> Suggested plugs include "Click here so Compton doesn't ban me. http://www.pocketplane.net/ub"

I am unfortunately not often about these days so the best way to get hold of me is via email.

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Have no clue.  Will need to make a list.
Earn Money Sleeping.

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Okay, here's what I have for code so far.

In the .tp2
Code: [Select]
COMPILE ~tutufix/commoner lines/commonlines.d~

COPY_EXISTING ~_0_ftowb.cre~ ~override~
READ_LONG 0x10c "selected"

COPY_EXISTING ~_ftowbe.dlg~ ~override~
REPLACE 999999 "%selected%"

In commonlines.d
Code: [Select]
APPEND _FTOWBE
 IF WEIGHT #9999 "True()" laststate
  SAY #999999
  IF "" THEN EXIT
 END
END

Now, I figure the variable "selected" isn't carrying over through to the next C_E patch.  But I think I just came up with an idea to get around that, so I'll go test it before continuing here.
Earn Money Sleeping.

Offline SimDing0™

  • Back In Black
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3496
  • Gender: Male
  • Word Enhancer
I'm not sure this is really an optimal solution. I can't think of BG1 examples, but in BG2, I think it'd be a great shame if every Shadow Thief spat out "No-one crosses the Shadow Thieves and lives!" when you clicked them. In a sense, I guess what I'm saying is that the voiced lines are generally more abstract than the dialogue text. Although maybe that's not the case in BG1. Hmm.

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
I think a good example is Farmer Brun.  When you've completed his quest and everything, he has no dialogue states that're valid, but his select_common1 sound is "'t will be hard goin' without my son."
Earn Money Sleeping.

Offline SimDing0™

  • Back In Black
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3496
  • Gender: Male
  • Word Enhancer
Oh, right. Okay. Carry on.

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Okay, so far I've worked out a while loop that will read a .cre and patch a .dlg.  Haven't worked out how to replace strref 999999 with "%selected%" yet, though.

COMPILE ~tutufix/commoner lines/commonlines.d~

COPY_EXISTING ~_0_ftowb.cre~ ~override~
              ~_ftowbe.dlg~ ~override~
READ_LONG 0x0 "filetype"
SET "patched" = 1
WHILE ("%patched%" = 1)
 BEGIN
  SET "patched" = 2
  PATCH_IF ("%filetype%" = 0x20455243) // .cre file
   BEGIN
    WRITE_BYTE 0x18 1 // This is just to check if the .cre file gets patched/READ_LONGed
    READ_LONG 0x10c "selected"
   END
  PATCH_IF ("%filetype%" = 0x20474c44) // .dlg file
   BEGIN
    WRITE_LONG 0x1a4 "%selected%" // This is to check if I can write the "%selected%" variable at all, which I can.
//   REPLACE 999999 "%selected%" // This doesn't work worth a damn.
   END
 END
Earn Money Sleeping.

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Okay.  I've tried adding a bit that will read the first byte of every state to check if it's string 999999, then replace that with "%selected%".  Unfortunately, I get a parse error when trying to run setup.exe.

Code: [Select]
COMPILE ~tutufix/commoner lines/commonlines.d~

COPY_EXISTING ~_0_ftowb.cre~ ~override~
              ~_ftowbe.dlg~ ~override~
READ_LONG 0x0 "filetype"
SET "patched" = 1
WHILE ("%patched%" = 1)
 BEGIN
  SET "patched" = 2
  PATCH_IF ("%filetype%" = 0x20455243) // .cre file
   BEGIN
    WRITE_BYTE 0x18 1
    READ_LONG 0x10c "selected"
   END
  PATCH_IF ("%filetype%" = 0x20474c44) // .dlg file
   BEGIN
    READ_LONG 0x8 "num_states"
    READ_LONG 0xc "off_states"
//    PATCH_IF ("%num_states%" > 0)
     WHILE ("%num_states%" > 0)
      BEGIN
       READ_LONG (("%num_states%" * 0x10) + "%off_states%") "string"
       SET ("%num_states%" - 1)                                         <--- parse error is at the "(" here
       PATCH_IF ("%string%" = 0x000f423f)
        WRITE_LONG (("%num_states%" * 0x10) + "%off_states%")) "%selected%"
      END
   END
 END
« Last Edit: January 10, 2005, 01:52:46 PM by Ghreyfain »
Earn Money Sleeping.

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Never mind, all fixed. :)
Earn Money Sleeping.

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Okay, it all works now.  WHILE loops are GOD.

Code: [Select]
COPY_EXISTING ~_0_ftowb.cre~ ~override~
              ~_ftowbe.dlg~ ~override~
READ_LONG 0x0 "filetype"
SET "patched" = 1
WHILE ("%patched%" = 1)
 BEGIN
  SET "patched" = 2
  PATCH_IF ("%filetype%" = 0x20455243) // .cre file
   BEGIN
    WRITE_BYTE 0x18 1
    READ_LONG 0x10c "selected"
   END
  PATCH_IF ("%filetype%" = 0x20474c44) // .dlg file
   BEGIN
    READ_LONG 0x8 "num_states"
    READ_LONG 0xc "off_states"
//    PATCH_IF ("%num_states%" > 0)
     WHILE ("%num_states%" > 0)
      BEGIN
       READ_LONG (("%num_states%" * 0x10) + "%off_states%") "string"
       SET "%num_states%" = ("%num_states%" - 1)
       PATCH_IF ("%string%" = 0x000f423f)
        BEGIN
         WRITE_LONG (("%num_states%" * 0x10) + "%off_states%" + 0x10) "%selected%"
        END
      END
   END
 END
Earn Money Sleeping.

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Make sure you check out the CRE sound slots at 0x0198 and 0x019c (labeled DIALOG_DEFAULT and DIALOG_HOSTILE in NI). These control the creature's "no valid states" dialogue (this is the reason that Arthur, in the Graveyard District, gives a "You visit again..." speech instead of "has nothing to say to you").

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Make sure you check out the CRE sound slots at 0x0198 and 0x019c (labeled DIALOG_DEFAULT and DIALOG_HOSTILE in NI). These control the creature's "no valid states" dialogue (this is the reason that Arthur, in the Graveyard District, gives a "You visit again..." speech instead of "has nothing to say to you").

Aha, excellent!  Although it still displays the "X has nothing to say to you" message, the string is done, too.  One thing to note is that this only appears to work if the character has a .dlg file assigned.  I took away the dialogue from _0_ftowbe.cre, set her DIALOG_DEFAULT and _HOSTILE to her select common string, and it didn't work.  This means we may need to assign dummy .dlg file to, say, horses and stuff.

Thanks a bunch.  Tutu will become that much more like BG1 now.
Earn Money Sleeping.

Offline SimDing0™

  • Back In Black
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3496
  • Gender: Male
  • Word Enhancer
Make sure you check out the CRE sound slots at 0x0198 and 0x019c (labeled DIALOG_DEFAULT and DIALOG_HOSTILE in NI). These control the creature's "no valid states" dialogue (this is the reason that Arthur, in the Graveyard District, gives a "You visit again..." speech instead of "has nothing to say to you").
You are the best person ever.

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
What do you know about getting charmed critters to talk? ;)
Earn Money Sleeping.

Offline Andyr

  • Dance Commander
  • PPG
  • Planewalker
  • *****
  • Posts: 3178
  • Gender: Male
    • The Gibberlings Three IE mod community
Incidentally, saying SAY DIALOG_DEFAULT or SAY DIALOG_HOSTILE (or SAY UNHAPPY_BREAKING_POINT) in a .tp2 when you're making your CRE gives a WeiDU error (it doesn't recognise the terms), so you have to SAY at the appropriate offsets instead. Unless we can ask Wes to add those three in.
"We are the Gibberlings Three, as merry a band as you ever did see..." - Home of IE mods

<jcompton> Suggested plugs include "Click here so Compton doesn't ban me. http://www.pocketplane.net/ub"

I am unfortunately not often about these days so the best way to get hold of me is via email.

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Incidentally, saying SAY DIALOG_DEFAULT or SAY DIALOG_HOSTILE (or SAY UNHAPPY_BREAKING_POINT) in a .tp2 when you're making your CRE gives a WeiDU error (it doesn't recognise the terms), so you have to SAY at the appropriate offsets instead.

SAY DIALOGUE_DEFAULT #0
SAY DIALOGUE_HOSTILE ~Whatever.~

If you're ever unsure about which named constants are supported, you should always check src/var.ml. For reference, WeiDU v174 =
Code: [Select]
  assoc "AREA_CITY" 0252 ;
  assoc "AREA_DAY" 0260 ;
  assoc "AREA_DUNGEON" 0256 ;
  assoc "AREA_FOREST" 0248 ;
  assoc "AREA_NIGHT" 0264 ;
  assoc "ATTACK1" 0220 ;
  assoc "ATTACK2" 0224 ;
  assoc "ATTACK3" 0228 ;
  assoc "ATTACK4" 0232 ;
  assoc "BATTLE_CRY1" 0200 ;
  assoc "BATTLE_CRY2" 0204 ;
  assoc "BATTLE_CRY3" 0208 ;
  assoc "BATTLE_CRY4" 0212 ;
  assoc "BATTLE_CRY5" 0216 ;
  assoc "BIO"  0x1cc ;
  assoc "BORED" 0196 ;
  assoc "COMPLIMENT1" 0352 ;
  assoc "COMPLIMENT2" 0356 ;
  assoc "COMPLIMENT3" 0360 ;
  assoc "CRITICAL_HIT" 0424 ;
  assoc "CRITICAL_MISS" 0428 ;
  assoc "DAMAGE" 0236 ;
  assoc "DESC"  0x54 ;
  assoc "DIALOGUE_DEFAULT" 0412 ;
  assoc "DIALOGUE_HOSTILE" 0408 ;
  assoc "DYING" 0240 ;
  assoc "EXISTANCE1" 0444 ;
  assoc "EXISTANCE2" 0448 ;
  assoc "EXISTANCE3" 0452 ;
  assoc "EXISTANCE4" 0456 ;
  assoc "EXISTANCE5" 0460 ;
  assoc "HAPPY" 0172 ;
  assoc "HURT" 0244 ;
  assoc "IDENTIFIED_DESC"  0x54 ;
  assoc "INITIAL_MEETING" 0164 ;
  assoc "INSULT" 0340 ;
  assoc "INTERACTION1" 0320 ;
  assoc "INTERACTION2" 0324 ;
  assoc "INTERACTION3" 0328 ;
  assoc "INTERACTION4" 0332 ;
  assoc "INTERACTION5" 0336 ;
  assoc "INVENTORY_FULL" 0436 ;
  assoc "LEADER" 0188 ;
  assoc "MISCELLANEOUS" 0384 ;
  assoc "MORALE" 0168 ;
  assoc "NAME1" 8 ;
  assoc "NAME2" 12 ;
  assoc "PICKED_POCKET" 0440 ;
  assoc "REACT_TO_DIE_GENERAL" 0376 ;
  assoc "REACT_TO_DIE_SPECIFIC" 0380 ;
  assoc "RESPONSE_TO_COMPLIMENT2" 0388 ;
  assoc "RESPONSE_TO_COMPLIMENT3" 0392 ;
  assoc "RESPONSE_TO_INSULT1" 0396 ;
  assoc "RESPONSE_TO_INSULT2" 0400 ;
  assoc "RESPONSE_TO_INSULT3" 0404 ;
  assoc "SELECT_ACTION1" 0292 ;
  assoc "SELECT_ACTION2" 0296 ;
  assoc "SELECT_ACTION3" 0300 ;
  assoc "SELECT_ACTION4" 0304 ;
  assoc "SELECT_ACTION5" 0308 ;
  assoc "SELECT_ACTION6" 0312 ;
  assoc "SELECT_ACTION7" 0316 ;
  assoc "SELECT_COMMON1" 0268 ;
  assoc "SELECT_COMMON2" 0272 ;
  assoc "SELECT_COMMON3" 0276 ;
  assoc "SELECT_COMMON4" 0280 ;
  assoc "SELECT_COMMON5" 0284 ;
  assoc "SELECT_COMMON6" 0288 ;
  assoc "SELECT_RARE1" 0416 ;
  assoc "SELECT_RARE2" 0420 ;
  assoc "SPECIAL1" 0364 ;
  assoc "SPECIAL2" 0368 ;
  assoc "SPECIAL3" 0372 ;
  assoc "TARGET_IMMUNE" 0432 ;
  assoc "TIRED" 0192 ;
  assoc "UNHAPPY_ANNOYED" 0176 ;
  assoc "UNHAPPY_BREAKING" 0184 ;
  assoc "UNHAPPY_SERIOUS" 0180 ;
  assoc "UNIDENTIFIED_DESC" 0080 ;
  assoc "HIDDEN_IN_SHADOWS" 0444 ;
  assoc "SPELL_DISRUPTED" 0448 ;
  assoc "SET_A_TRAP" 0452 ;
  assoc "STORE_NAME" 12 ;
  assoc "SCRIPT_OVERRIDE" 0x248 ;
  assoc "SCRIPT_CLASS" 0x250 ;
  assoc "SCRIPT_RACE" 0x258 ;
  assoc "SCRIPT_GENERAL" 0x260 ;
  assoc "SCRIPT_DEFAULT" 0x268 ;
  assoc "DEATHVAR" 0x280 ;
  assoc "DIALOG" 0x2cc ;
  assoc "AREA_SCRIPT" 0x94 ;
  assoc "SCRIPT_AREA" 0x94 ;
  assoc "PORTRAIT_SMALL" 0x34 ;
  assoc "PORTRAIT_LARGE" 0x3c ;
Longest post EVAR. :P
« Last Edit: February 05, 2005, 08:40:21 PM by devSin »

Offline Andyr

  • Dance Commander
  • PPG
  • Planewalker
  • *****
  • Posts: 3178
  • Gender: Male
    • The Gibberlings Three IE mod community
Oh, hmm. I copy-pasted from NI and it gave me an error because I had DIALOG not DIALOGUE. Still might be nice to ask for both spellings (US and UK) to be supported.
"We are the Gibberlings Three, as merry a band as you ever did see..." - Home of IE mods

<jcompton> Suggested plugs include "Click here so Compton doesn't ban me. http://www.pocketplane.net/ub"

I am unfortunately not often about these days so the best way to get hold of me is via email.

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Oh, hmm. I copy-pasted from NI and it gave me an error because I had DIALOG not DIALOGUE. Still might be nice to ask for both spellings (US and UK) to be supported.

Dialogue is "proper" English (think "monologue," "epilogue," "prologue," etc.). That said, I personally hate it, but what can you do?

Offline Andyr

  • Dance Commander
  • PPG
  • Planewalker
  • *****
  • Posts: 3178
  • Gender: Male
    • The Gibberlings Three IE mod community
Yeh, I know. I'm an Englishman myself. ;) It's good that the scripting actions and so forth accept both spellings, else there'd be many a typo.
"We are the Gibberlings Three, as merry a band as you ever did see..." - Home of IE mods

<jcompton> Suggested plugs include "Click here so Compton doesn't ban me. http://www.pocketplane.net/ub"

I am unfortunately not often about these days so the best way to get hold of me is via email.

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: