hereami Posted May 24 Share Posted May 24 (edited) Bug is likely not related to player either way? On 5/24/2025 at 8:28 AM, d4em said: (still fun to play with tho, makes you plan ahead) Expand True perhaps. Hm, now i don't really remember if ever tried PL.GetAttacked(). Probably did though.. Edited May 24 by hereami Link to comment Share on other sites More sharing options...
d4em Posted May 24 Author Share Posted May 24 (edited) On 5/24/2025 at 5:57 PM, DieFeM said: Probably it is still bugged, in the CK wiki for Skyrim, there's an actual entry for the condition: https://ck.uesp.net/wiki/GetCombatState There's a Bug entry, at the bottom, it says the following: Expand I wrote a script to check for this: Event OnEffectStart(Actor akTarget, Actor akCaster) if (akCaster.GetCombatState() == 0) ; according to skyrim wiki this is unreliable on first call so add a useless call endIf if (akCaster.GetCombatState() == 1) Debug.Messagebox("Combat state: Combat") endIf if (akCaster.GetCombatState() == 2) Debug.Messagebox("Combat state: Searching") endIf PipboyEnableLayer = InputEnableLayer.Create() if (!akCaster.IsInPowerArmor()) PipboyEnableLayer.EnableJournal(false) PipboyEnableLayer.EnableMenu(false) ;Debug.Messagebox("No pipboy available!") endIf EndEvent I left the script like this during a regular playthrough and only ever got the combat message, even with a double check it fails. akCaster.GetCombatState() == 1 is actually the third time it's called within a very short timeframe because the condition on the magic effect calls it as well. But it's very reliable in detecting whether the player is in caution/combat or not Edited May 24 by d4em Link to comment Share on other sites More sharing options...
DieFeM Posted May 25 Share Posted May 25 (edited) If one of the condition in the magic effect is getcombatstate == 1 it will always fire OnEffectStart at state 1, therefore, and correct me if I'm wrong, there's no chance for the other 2 script conditionals (0 and 2) to ever run, don't you think? I'd try with getcombatstate greater than (>) 0, then it has the chance to fire on 1 and 2. Edited May 25 by DieFeM Link to comment Share on other sites More sharing options...
d4em Posted May 25 Author Share Posted May 25 they're in if blocks, all 3 blocks run and call getcombatstate regardless of which condition passes Link to comment Share on other sites More sharing options...
DieFeM Posted May 25 Share Posted May 25 My bad, when I said run I meant to be evaluated as true, or said with other words: run their respective code. So, if the only condition of the magic effect is getcombatstate == 1, the only if statement of the script that will be ever true is at state 1, that's what I wanted to point out. Therefore it never shows any "Combat state: Searching", not because the condition function nor the script function doesn't work, but because you are not letting states 0 and 2 start the effect, therefore OnEffectStart will only run at state 1. Link to comment Share on other sites More sharing options...
d4em Posted May 25 Author Share Posted May 25 Given the nature of the bug Quote This condition is unreliable the first time it is called after a certain amount of time has passed Expand You would expect a different result here, because in those if statements, it's not being called for the first time. Therefore if it was returning a value of 1 due to this bug, you would expect to see a different result Link to comment Share on other sites More sharing options...
hereami Posted May 28 Share Posted May 28 (edited) Don't you think that Searching state is only meaningful for npc ai process? Seems obvious to interpret as Caution when transposed to player toon, but likely the function code doesn't so. A spell with gcs==2 never fires the effect, while it should according to bug note. Either way curious why Combat (1) precedes Searching (2). And still there is some common variable maintained deep inside the code to change hud indication and inform player that somebody has changed state from Searching to attack player specifically. Some shady graph variable then maybe? Edited May 28 by hereami Link to comment Share on other sites More sharing options...
d4em Posted May 28 Author Share Posted May 28 I took some steps to reverse engineer the HUD but I'm not a HUD person and it gave me a headache. But yeah, theoretically it should be possible to find some variable that way Link to comment Share on other sites More sharing options...
Recommended Posts