Jump to content

[LE] How to determine how high the character is falling from?


azazellz

Recommended Posts

I have to admit I didn't read the directions, so I know if it will help.

As I can say, game do not have special AnimEvents for "walk of a cliff".

But if you fall from high enough attitude, standart AE will fire (JumpDown and JumpLandEnd).

In this mod scripts tracking animation state of the player (GetAnimationVariableBool("bInJumpState")) each 0.1 second for starting Z coordinate (moment when player enters into bInJumpState).

I do not think this is a good idea.

Edited by azazellz
Link to comment
Share on other sites

Ok, after some testing with AnimCatcher I found that "JumpLandEnd" and "JumpDown" is used together (JumpLandEnd usually goes first), and "JumpFall" and "JumpFallDirectional" don't used together, used only one of them.

So, I think, it is safe enough to remove part of AE from script.

Event OnEffectStart(Actor akTarget, Actor akCaster)
    registerForAnimationEvent(akTarget, "JumpFallDirectional")
    registerForAnimationEvent(akTarget, "JumpFall")
    registerForAnimationEvent(akTarget, "JumpLandEnd")
endEvent

Event OnAnimationEvent(ObjectReference akSource, string EventName)
    If (eventName == "JumpFallDirectional") || (eventName == "JumpFall")
        afJumpFall1 = akSource.GetPositionZ()
        debug.MessageBox("# 1\nResult1 " + afJumpFall1)
    ElseIf (eventName == "JumpLandEnd")
        Float afJumpFall2 = akSource.GetPositionZ()
        debug.MessageBox("# 2\nRResult1 " + afJumpFall1 + "\nResult2 " + afJumpFall2)
        Float afJumpFall3 = afJumpFall1 - math.abs(afJumpFall2)
        Float afJumpFallAbs = math.abs(afJumpFall3)
        debug.MessageBox("# 3\nRResult1 " + afJumpFall1 + "\nResult2 " + afJumpFall2 + "\nResult3 " + afJumpFall3 + "\nResult4 " + afJumpFallAbs)
        afJumpFall1 = 0
    EndIf
EndEvent
Link to comment
Share on other sites

  • Recently Browsing   0 members

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