Xander9009 Posted November 3, 2013 Share Posted November 3, 2013 There was a thread a long time ago about this here. They started the thread by saying that "GetCombatState()" doesn't work on the player. But I just found it used in the vampire script (the one that turns you into a vampire attached to the disease). I tested it in a different place to notify me if the player is or is not in combat and it appeared to work perfectly. Can anyone confirm that this is the proper way to test for player combat or point out it causes problems in certain situations? Link to comment Share on other sites More sharing options...
AnimeOtaku102 Posted November 4, 2013 Share Posted November 4, 2013 I usually use "akActor.IsInCombat()", which seems to work out well enough. Using GetCombatState() is a bit of a roundabout way since you have to attach it to a magic effect or quest that's referencing the player, but if it works it works, right? Link to comment Share on other sites More sharing options...
EnaiSiaion Posted November 4, 2013 Share Posted November 4, 2013 Hm? GetCombatState as an ability condition works purr-fectly all over Resplendent. Link to comment Share on other sites More sharing options...
Xander9009 Posted November 4, 2013 Author Share Posted November 4, 2013 Ok, thanks. I'll be using GetCombatState() for this one then, since it's actually -supposed- to be on a magic effect. I wonder why it wasn't working for them. Oh well. It's good to know IsInCombat() also works. They said that was also not working. Looks like they were just having bad luck all around. I just wanted to ask because when I googled the question looking for an answer, that was was the only thing I found. Link to comment Share on other sites More sharing options...
AnimeOtaku102 Posted November 5, 2013 Share Posted November 5, 2013 I know that feeling, most of the time rather than asking I just Google a question until I find someone else asking how to get a certain function working and figure it out from there, because a lot of times they'll just go "Oh, got it working, thanks!" or "Nevermind, figured it out" and provide absolutely no detail on what they did. That being said, this is an example of where I use IsInCombat(), it's a script for portable crafting so I prevent the user from using it in situations where forging is unreasonable or causes animation breaks: Scriptname MiscCraftingItemScript extends ObjectReference MiscObject Property MiscCraftingItem Auto ObjectReference Property MiscCraftingItemREF Auto Event OnEquipped(Actor akActor) If (akActor == Game.GetPlayer()) If (akActor.IsInCombat()) debug.notification("You cannot use this item while in combat.") ElseIf (akActor.IsSneaking()) debug.notification("You cannot use this item while sneaking.") ElseIf (akActor.IsSwimming()) debug.notification("You cannot use this item while swimming.") ElseIf (akActor.GetAnimationVariableBool("bInJumpState")) debug.notification("You cannot use this item while falling.") ElseIf (akActor.IsOnMount()) debug.notification("You cannot use this item while mounted.") ElseIf (akActor.GetSitState() == 3) debug.notification("You cannot use this item while sitting.") Else Game.DisablePlayerControls(false, false, false, false, false, true, false) utility.wait(0.1) Game.EnablePlayerControls(false, false, false, false, false, true, false) MiscCraftingItemREF.Activate(akActor) EndIf EndIf EndEvent Link to comment Share on other sites More sharing options...
Recommended Posts