Jump to content

Register for animaton events, escape clause (and is there any NIOverride Documentation?)


Recommended Posts

Posted

It seems, that the players collision is not changed by crouching/sneaking. I suspect it's the skeleton node "CharacterBumper".

post-1082376-0-54087300-1491263396_thumb.jpg

So, I wanted to do add a little quest and a player alias with a script, to detect when the sneaking begins. Then I'd use NIOverride to shrink the node (and see what happens, I'm not sure, it would help at all).

 

 

 

Scriptname sneakDetector extends ReferenceAlias

Import MiscUtil
import NetImmerse

actor property player auto

Event OnInit()
    player = Game.GetPlayer()
    MiscUtil.PrintConsole("Alias Initialized")
    RegisterForAnimationEvent(player, "tailSneakIdle")
    RegisterForAnimationEvent(player, "tailSneakLocomotion")
    RegisterForAnimationEvent(player, "tailMTIdle")
    RegisterForAnimationEvent(player, "tailMTLocomotion")
EndEvent

Event OnPlayerLoadGame()
    MiscUtil.PrintConsole("Alias GameLoaded")
    RegisterForAnimationEvent(player, "tailSneakIdle")
    RegisterForAnimationEvent(player, "tailSneakLocomotion")
    RegisterForAnimationEvent(player, "tailMTIdle")
    RegisterForAnimationEvent(player, "tailMTLocomotion")
endEvent

Event OnAnimationEvent(ObjectReference akSource, string asEventName)
     if (akSource == player)
         if (asEventName == "tailSneakIdle" || asEventName == "tailSneakLocomotion")
            MiscUtil.PrintConsole("Sneaky!")
               ;if (NetImmerse.getNodeScale(player, "CharacterBumper")>0.5, ?)
               ; NetImmerse.SetNodeScale(player, "CharacterBumper", 0.5, ?)
               ;endif
         endIf
        if (asEventName == "tailMTIdle" || asEventName == "tailMTLocomotion")
            MiscUtil.PrintConsole("Standing upright")
               ;if (NetImmerse.getNodeScale(player, "CharacterBumper")<1.0, ?)
               ; NetImmerse.SetNodeScale(player, "CharacterBumper", 1.0, ?)
               ;endif
           endif
     endIf
endEvent

 

 

 

This led me to notice I'm missing something:

 

1) How to best register for Events? Does "OnInit" work for the "duration" of my quest, or will it be gone on the next reload? Is "OnPlayerLoadGame" better, or will there be such a thing as double registrations (which sounds like save game bloat).

 

2) If I deinstall my mod, which removes the quest, will my registration still fire? If so: Is there a best practice to implement an automatic abort?

 

3) How to use NIOverride "firstperson" parameter? It has no default, and obviously I can only set it to true or false, but I have no clue what it's good for, and how to set it. I also can't find documentation for NIOverride. Any Clues/Links?

post-1082376-0-26386700-1491261131_thumb.jpg

post-1082376-0-70622000-1491261143_thumb.jpg

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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