Pocket Plane Group
Miscellany, Inc. => Infinity Engine Modding Q&A => Topic started by: Ghreyfain on January 09, 2005, 09:24:50 PM
-
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.
-
There does not appear to be such a trigger.
-Echon
-
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.
-
* And I cannot think of any possible workaround either. :)
-Echon
-
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.
-
That's what I was thinking, yeah. Sort of sucks that the dialogue window has to open, but oh well.
-
Roughly how many different creatures in Tutu are there who'd need dialogue like this?
-
Have no clue. Will need to make a list.
-
Okay, here's what I have for code so far.
In the .tp2
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
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.
-
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.
-
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."
-
Oh, right. Okay. Carry on.
-
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
-
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.
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
-
Never mind, all fixed. :)
-
Okay, it all works now. WHILE loops are GOD.
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
-
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").
-
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.
-
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.
-
What do you know about getting charmed critters to talk? ;)
-
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.
-
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 = 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
-
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.
-
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?
-
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.
-
Generally if you send Wes the synonyms you want, formatted for those files, and say, "Yo, please put these in file blah.ml for the next version", he does so.