[(BG2) Bug] IfValidForPartyDialogue flakiness
Since @AndreaColombo is posting @devSin's laundry list of trigger/action fixes, I'd add one of my own: IfValidForPartyDialogue. The trigger seems to randomly fail, seemingly due to line-of-sight issues.
The classic issue most people experience with it is Irenicus' reveal at Spellhold, when he fails to recognize Yoshimo in the party due to IVFPD failing.
Sorry I can't be more specific, as there doesn't seem to be a consistent way to replicate this. A lot of modders just avoid the trigger by using InParty+InMyArea instead.
The classic issue most people experience with it is Irenicus' reveal at Spellhold, when he fails to recognize Yoshimo in the party due to IVFPD failing.
Sorry I can't be more specific, as there doesn't seem to be a consistent way to replicate this. A lot of modders just avoid the trigger by using InParty+InMyArea instead.
Post edited by Tanthalas on
2
Comments
check that the target sprite exists
check that it's not dead
checks for target distance (squared) is less than visual range (squared)
checks for line of sight
checks that the target is in the same area
checks that the target is not sleeping
checks that the sprite is a party member
checks that the target is not the last person you talked to
other than fixing up the mess made of the logic a bit, the fix would perhaps be to remove the line of sight (as this is probably triggered by a see call anyway(?)) ?
Checking against the custom CD_STATE_NOTVALID* instead of STATE_SLEEPING that @cmorgan references might be an improvement, but may be beyond the scope of a fix. It's really only going to affect original BG/BG2 IVFPD dialogue, because modders will probably write multi-purpose code for BGEE/BG1/Tutu/BGT and won't be able to rely on fixed IVFPD behavior.
* CD_STATE_NOTVALID (0x80101FEF) was something added to state.ids to create a quick way to StateCheck() for dialogues--it returns true if any of these are present: STATE_CONFUSED, STATE_FEEBLEMINDED, STATE_SILENCED, STATE_HELPLESS, STATE_STUNNED, STATE_PANIC, STATE_BERSERK, STATE_SLEEPING, and the various dead states.
Or going by the forum conventions, LoS is B, state check improvements a D.
I'd prefer it more realistic and with both LoS and Inviso status taken into account, but I'm really not used to party banter anyway, so I'll defer to @CamDawg on it. If it means that it never happens while soloing, but if there's a party and Player1 starts talking and Player2 is inviso, and suddenly Player2 is in the conversation, that seems... ok... odd, but ok...
Personally, I let invisible/hidden characters talk. If it were me, and we were all walking in the dark and someone asked me a qwuestion, I'd answer. Unless Smaug was sleeping 10 feet away...
I was going to try to add that script to a couple Mulahey copies, make him look for Imoen and then have Imoen be invisible... but, yeah, maybe better for @cmorgan to put together if he's got the time.
Yeah, I have no idea how to test it either.
And I'm not sure if that's not just a in-party banter anyway.
Like Imoen is behind a wall.
@Cuv, could you repeat the test but with people behind a wall of something like that?
But I think the fix is for characters to still be detected even if they're behind walls, in which case you proved that its working.
Created this script: Then I created a CRE with that script... a flind. I like flinds... And I used my Improved Inviso Ring.
I CLUAd in Coran behind a wall out of sight but didn't recruit him.
Then I CLUAd in the flind where he wouldn't see Coran.
Then I picked up a ring on the ground so I'd be seen by the Flind. He said something mean and nasty and wicked.
So I went back to fully ImpInviso again and went around back to talk to Coran and get him in the party.
Then I went back round the corner to that mean flind and picked up the ring again. He could smell Coran was in my party now... and tried to make polite conversation. :-)
NOTES:
Now... was LoS the only thing that was changed here? @Avenger_teambg suggested getting rid of the LastTalkedToBy, but I'm not sure if @SethDavis removed anything but LoS.
The original programmer should have provided an options bitfield in which the scriptor could select what they want to check. Then the responsibility would have been transferred from programmer to scriptor