Akuma Posted September 9, 2019 Share Posted September 9, 2019 (edited) Hi, I'm trying to limit a lesser power from activating if you are falling. I was able to stop the power from working by adding "Target Conditions" to the "Magic Effect" so that it wouldn't work underwater, when on a mount, in combat, etc I tried the (speed, movement, etc) variables on the player character but nothing seems to verify if you are on the ground or falling. There are other very well defined variables such as: IsRidingMount IsSwimming IsInCombat But as far as I know there is no variable to check if you are grounded. So, my question is: Is there a way to add a condition so that the power fails unless you are on the ground? (Jumping, falling, etc) Thanks in advance. In case you are wondering the "Fix" is for this mod: https://www.nexusmods.com/skyrim/mods/95551 Edited September 14, 2019 by Akuma Link to comment Share on other sites More sharing options...
Evangela Posted September 10, 2019 Share Posted September 10, 2019 (edited) You need to be 600 units in the air in order to take damage, that's one way to detect falling, but it is afterwards, unfortunately, I don't know how you can take that information and determine if someone is falling or not. You want to prevent the power while falling and that seems really difficult.. you'd have to get the jump position and track whether it losses about 600 units ~_~. I think the game checks for jumping and then subtracts the original z with the z you have in the air. What you need is to track the falling animation, this is the best way I can think of, and the animation to register is "JumpFall" for tracking when the player begins to fall, and "JumpDown" to track when the player gets on the ground. Edited September 10, 2019 by Rasikko Link to comment Share on other sites More sharing options...
hereami Posted September 10, 2019 Share Posted September 10, 2019 (edited) Anim detection looks good.May try Condition GetGraphVariableFloat(VelocityZ)<0 (the lower, the higher the falling speed) also, seems to work for ragdoll (e.g. if PushedAway). Not sure why, but GetVelocity(Z) condition isn't used instead (in vanilla Fallout 4 at least), and i didn't try it. Also may search inside Idle Animations trees for "Land" or "ActionLand" to get Skyrim examples, suppose, there should be something similar. Additional - GetGraphVariableInt(bInJumpState/isJumping)==1 . Edited September 10, 2019 by hereami Link to comment Share on other sites More sharing options...
Evangela Posted September 11, 2019 Share Posted September 11, 2019 I so wanna test this out now. Link to comment Share on other sites More sharing options...
Evangela Posted September 12, 2019 Share Posted September 12, 2019 (edited) Alright after some tests, I can tell you that the animation events are unreliable and the ones that would be are not considered valid by OnAnimationEvent. JumpFall doesn't happen during falling. JumpFall happens when you do simple default jumps. Jumping from high places puts you into a different sequence of animation events, and JumpUp will happen if the player jumps from a cliff, but between that and JumpDown, there is no JumpFall. You're stuck with trying to determine the time between JumpUp and JumpDown. AnimObjectUnequip happens during the fall, and that's invalid, as is DisableBumber(when a weapon is equipped). Edited September 12, 2019 by Rasikko Link to comment Share on other sites More sharing options...
hereami Posted September 13, 2019 Share Posted September 13, 2019 (edited) bInJumpState and isJumping do work and appear to detect drawn animation, but not exact airborne state - means that if you happen to perform walking/running animation at the peak of the jump - they go off (e.g. in SlowTime). Also work, if to step down from a building - falling anim starts and condition is triggered.bInJumpState is only valid in 3rd person, isJumping is only valid in 1st person. GetVelocity() and VelocityZ var work for Player, appear quite specific, they are inversions of each other (for jumping up GetVelocity(Z) returns >0, while VelocityZ is <0), and do not have a reliable zero state - will go on, while moving straight. GetVelocity(Z) looks more predictable though and could be used with threshold values, maybe 50-100. Both func and var are used in game actually, but in different context. Edited September 13, 2019 by hereami Link to comment Share on other sites More sharing options...
Nathan55 Posted September 13, 2019 Share Posted September 13, 2019 (edited) Can you check to see if you're interacting with the navmesh? Edit:Not really sure if this will help, but.https://www.creationkit.com/index.php?title=OnCombatStateChanged_-_Actor If you read the notes on that page, it states: Combat state changes can only be detected by an Actor that is on the ground in contact with a navmesh. State changes cannot be detected on dragons while still in flight. Edited September 13, 2019 by Nathan55 Link to comment Share on other sites More sharing options...
Evangela Posted September 13, 2019 Share Posted September 13, 2019 (edited) bInJumpState and isJumping do work and appear to detect drawn animation, but not exact airborne state - means that if you happen to perform walking/running animation at the peak of the jump - they go off (e.g. in SlowTime). Also work, if to step down from a building - falling anim starts and condition is triggered.bInJumpState is only valid in 3rd person, isJumping is only valid in 1st person. GetVelocity() and VelocityZ var work for Player, appear quite specific, they are inversions of each other (for jumping up GetVelocity(Z) returns >0, while VelocityZ is <0), and do not have a reliable zero state - will go on, while moving straight. GetVelocity(Z) looks more predictable though and could be used with threshold values, maybe 50-100. Both func and var are used in game actually, but in different context.Hmm, VelocityZ might be doing something a tad different then? Your z height is constantly changing in the game anyway because of uneven terrain, etc. I'll use GetVelocityZ and see if there is maximum velocity while in the air :P Edited September 13, 2019 by Rasikko Link to comment Share on other sites More sharing options...
hereami Posted September 13, 2019 Share Posted September 13, 2019 Hmm, VelocityZ might be doing something a tad different then?In Fallout VelocityZ is used in ActionLand, which happens on ground impact?, and still is tested to be lower than a negative number, although during fall-down phase it has a positive value, so it may fix some peak value then, when direction sign changes. It may explain, why the value is always negative, while walking. I only have visual binary test for >0 or <0, could be interesting to see a graph for entire jumping cycle. And for GetVelocity(Z) - no idea, why it turns negative, while running up the hill. Link to comment Share on other sites More sharing options...
Akuma Posted September 14, 2019 Author Share Posted September 14, 2019 First of all, thanks to everyone that posted for your feedback, apparently this was a problem with not an obvious solution... The following things that I tried only stopped the power from working: Setting the "GetVelocity" function for the "Z" axisto make it check if the velocity was equal to zero "== 0" (the player not moving up or down)but it seems that the game thinks you are moving even when you are standing still or fails to register that. I also checked for higher than zero "> 0" (as the player falling should increase the velocity of it's "Z" axis)but no, it doesn't check that or simply takes it like your velocity always changes. The worst part is that the game definitely has a way to verify if you are on the ground or not, as it prevents fromfast traveling and other actions. At this point I may have to force an animation on the power turning it into a spell that you can only performwhen grounded like a "Ritual Spell" to ensure you can never use the power in mid air. I'll keep trying to solve this, If you find something that works please let me know. Link to comment Share on other sites More sharing options...
Recommended Posts