Jump to content

GetCombatVisualDetection and PlayerVisualDetection


Recommended Posts

Posted (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 by hereami
Link to comment
Share on other sites

Posted (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 by d4em
Link to comment
Share on other sites

Posted (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 by DieFeM
Link to comment
Share on other sites

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

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

Posted (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 by hereami
Link to comment
Share on other sites

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...