AnimeOtaku102 Posted June 15, 2013 Share Posted June 15, 2013 I know there's already SkyRealism - Crafting Kits, but I want to try something slightly different and make a crafting kit that's a miscellaneous object instead of a pseudo-armor piece. I already have a rough working version, but like aforementioned mod using the item while seated or mounted creates unexpected behavior (especially while mounted), so I want to toss in a few conditional statements to prevent it from being used under certain circumstances. What I have so far is: Scriptname ArmorModdingKitScript extends ObjectReference MiscObject Property ArmorModdingKit AutoObjectReference Property ArmorModdingKitREF AutoEvent OnEquipped(Actor akActor) If (akActor == Game.GetPlayer()) If (akActor.IsInCombat()) ;If Player is in combat debug.messagebox("Now doesn't seem like the best time for that...") ElseIf (akActor.IsSneaking()) ;If Player is sneaking debug.messagebox("That would draw too much attention to you.") ElseIf (akActor.IsSwimming()) ;If Player is swimming debug.messagebox("Unfortunately you don't have a degree in underwater basket weaving.") ElseIf (akActor.IsOnMount()) ;If Player is mounted debug.messagebox("The horse's head makes for a poor workbench, best dismount first...") ElseIf (akActor.GetSitState() == 3) ;If Player is seated debug.messagebox("True Nords don't work while resting on their laurels! Get up first!") Else Game.DisablePlayerControls(false, false, false, false, false, true, false) ;Close the inventory window by disabling controls utility.wait(0.1) Game.EnablePlayerControls(false, false, false, false, false, true, false) ;Enable controls ArmorModdingKitREF.Activate(Game.GetPlayer()) ;Call the crafting station EndIf EndIf EndEvent Tested the above code and everything appears to work just fine, but I was wondering if anyone knows of a function to detect when the player is falling? I already tried IsFlying(), but unfortunately that wasn't it. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted June 15, 2013 Share Posted June 15, 2013 I don't know if there is a way to check if the player is falling. Perhaps some common sense on the player's part should be expected? Link to comment Share on other sites More sharing options...
AnimeOtaku102 Posted June 15, 2013 Author Share Posted June 15, 2013 I don't know if there is a way to check if the player is falling. Perhaps some common sense on the player's part should be expected? Well, it wouldn't break anything if they use the crafting station in freefall, they'll wind up landing anyway, I was just being obsessive about conditions. Also would have been an opportunity to put in another silly message, something along the lines of "Try as you might, you cannot invent and craft a parachute mid-fall." Link to comment Share on other sites More sharing options...
steve40 Posted June 16, 2013 Share Posted June 16, 2013 Would falling count as being in the jump state? Maybe check if they are jumping: If GetAnimationVariableBool("bInJumpState") == true Dunno if this check will work though. Link to comment Share on other sites More sharing options...
AnimeOtaku102 Posted June 17, 2013 Author Share Posted June 17, 2013 Hm, gave that a shot but didn't work, likely because it's an object reference script rather than an actor script... which is odd, given I can't imagine what jumps other than actors. Link to comment Share on other sites More sharing options...
steve40 Posted June 17, 2013 Share Posted June 17, 2013 If akActor.GetAnimationVariableBool("bInJumpState") == true Link to comment Share on other sites More sharing options...
AnimeOtaku102 Posted June 18, 2013 Author Share Posted June 18, 2013 If akActor.GetAnimationVariableBool("bInJumpState") == true Oh hey, that works! I did consider that the first time I tried, but I just assumed the complier would cough back an error since I was passing it an actor instead of an object. Thanks for the help! Link to comment Share on other sites More sharing options...
Recommended Posts