Stealth, Convos, and Hostility
horredtheplague
Member, Developer Posts: 186
This is an original bug that has carried over into BGEE. It's documented in IEDSP that both Convos and Hide in Shadows can cause trouble with the CombatCounter() check. This unfortunately carries over into other parts of a script, and causes problems. I've tracked it down after personal observation, testing and reports on my party scripts. It only seems to manifest when both stealth and convos are involved.
What's the problem? When a party member engages in a convo, and a different member is stealthed, is when it happens. Conversation ends, and if the stealthed player is near anybody (not nec the Interactor), they'll move in for a backstab and attack. Doesn't happen 'every time', but quite often enough to pinpoint it as responsible. It only happens with a backstabber, stealthed. I have less restrictive code on normal attacks, yet they don't fire.
The workaround is to only attack "enemies" like the default Thief Aggressive script does. This really should not be necessary, however. There are cases where a blue-circled NPC will initiate combat and remain Blue, e.g. Switching to Enemy() is not pre-conditional for attacking. Nor does attacking automatically make one an "Enemy" in scripting terms.
Granted, the above are semi-obscure cases. But more prominent side effects of this are as noted in IEDSP. Any/all CombatCounter() checks are thrown out of kilter by convos and stealth. Without testing, I'd assume this carries over into ActuallyInCombat() but that's rarely used in vanilla scripting. Only used three times in BGEE according to NI, but 313 hits for "CombatCounter" in BG2:ToB vanilla. That's fairly common. Mostly used in party member scripts, but a few cases where enemies and potential enemies use it. Might be worth it for Beamdog to investigate, for the sake of future sanity checks?
What's the problem? When a party member engages in a convo, and a different member is stealthed, is when it happens. Conversation ends, and if the stealthed player is near anybody (not nec the Interactor), they'll move in for a backstab and attack. Doesn't happen 'every time', but quite often enough to pinpoint it as responsible. It only happens with a backstabber, stealthed. I have less restrictive code on normal attacks, yet they don't fire.
The workaround is to only attack "enemies" like the default Thief Aggressive script does. This really should not be necessary, however. There are cases where a blue-circled NPC will initiate combat and remain Blue, e.g. Switching to Enemy() is not pre-conditional for attacking. Nor does attacking automatically make one an "Enemy" in scripting terms.
Granted, the above are semi-obscure cases. But more prominent side effects of this are as noted in IEDSP. Any/all CombatCounter() checks are thrown out of kilter by convos and stealth. Without testing, I'd assume this carries over into ActuallyInCombat() but that's rarely used in vanilla scripting. Only used three times in BGEE according to NI, but 313 hits for "CombatCounter" in BG2:ToB vanilla. That's fairly common. Mostly used in party member scripts, but a few cases where enemies and potential enemies use it. Might be worth it for Beamdog to investigate, for the sake of future sanity checks?
1
Comments