Jump to content

Detecting when the player Exit Vertibird


Recommended Posts

Thanks RaidersClamoring,

 

But OnPlayerSwimming() is sent when the player start swimming not when it stops swimming, right ?

 

added: How can I detect when the player stop swimming ?

Apologies. There's an animation event called, I think, "SwimStop","swimStop" or SwimmingStop". You can find the correct event name in the animations list in CK. Then you register RegisterForAnimationEvent(Game.GetPlayer(),"SwimStop"), and subsequently handle OnAnimationEvent().

Link to comment
Share on other sites

 

Thanks RaidersClamoring,

 

But OnPlayerSwimming() is sent when the player start swimming not when it stops swimming, right ?

 

added: How can I detect when the player stop swimming ?

Apologies. There's an animation event called, I think, "SwimStop","swimStop" or SwimmingStop". You can find the correct event name in the animations list in CK. Then you register RegisterForAnimationEvent(Game.GetPlayer(),"SwimStop"), and subsequently handle OnAnimationEvent().

 

 

I tried both spelling (SwimStop and SwmmingStop) but the event is not triggering. I also tried to find "SwimStop" in CK but I could only find an Action called "ActionSwimStop". Where should I look to find the animations list in CK ?

 

 

added:

 

I also tried MTState that should trigger when the Swimming sound stops but it's not working. Here is how I did it:

 

;--------------------------------------------------------------------------------------------------------------
Event OnQuestInit()
RegisterForAnimationEvent(PlayerRef,"MTState")
endEvent
;--------------------------------------------------------------------------------------------------------------
Event OnAnimationEvent(ObjectReference akSource, string asEventName)
if (akSource == self) && (asEventName == "MTState")
Debug.Trace("Swimming Stopped!")
endIf
endEvent

;--------------------------------------------------------------------------------------------------------------

 

I also verified that the Registration is really happening with debug.trace on the return registration value and it returned "True".

 

Maybe I'm not doing this right...

 

Added2: I just tried registering for "weaponFire" to try to see if my script is ok and this is working. So I need to find and stop swimming animation event that works.

Edited by F4ll0uta
Link to comment
Share on other sites

 

Always good to check how the base game does stuff.

 

Examine VertibirdTurretScript.ExitTurret which has multiple triggers to handle different conditions in State TurretActive.

 

I just realized that if the player enters the vertibird equipped with a minigun it might trigger the onItemUnequipped event. So I added Utility.Wait(5) before RegisterForRemoteEvent(PlayerRef, "OnItemUnequipped").

 

The script provided by SKK has many other events, i can't test or play lately but i'm sure you can achieve the same result with OnGetUp(), OnExitFurniture() or OnAnimationEvent(idleChairGetUp)... instead of OnItemUnequipped.

 

 

Do I need to install or add something to script to use skk?

Link to comment
Share on other sites

 

 

Always good to check how the base game does stuff.

 

Examine VertibirdTurretScript.ExitTurret which has multiple triggers to handle different conditions in State TurretActive.

 

I just realized that if the player enters the vertibird equipped with a minigun it might trigger the onItemUnequipped event. So I added Utility.Wait(5) before RegisterForRemoteEvent(PlayerRef, "OnItemUnequipped").

 

The script provided by SKK has many other events, i can't test or play lately but i'm sure you can achieve the same result with OnGetUp(), OnExitFurniture() or OnAnimationEvent(idleChairGetUp)... instead of OnItemUnequipped.

 

 

Do I need to install or add something to script to use skk?

 

VertibirdTurretScript is a vanilla script and "SKK50" is the user who mentioned it. I was talking about using one of the events listed in that scrip (that's what i'm planning to do when i get the chance). Those events are also interesting: (HoveringVertibirdScript)

RegisterForAnimationEvent(self, "FlightLanding")
RegisterForAnimationEvent(self, "FlightLanded")
RegisterForAnimationEvent(self, "FlightTakeOff")
Link to comment
Share on other sites

 

 

Thanks RaidersClamoring,

 

But OnPlayerSwimming() is sent when the player start swimming not when it stops swimming, right ?

 

added: How can I detect when the player stop swimming ?

Apologies. There's an animation event called, I think, "SwimStop","swimStop" or SwimmingStop". You can find the correct event name in the animations list in CK. Then you register RegisterForAnimationEvent(Game.GetPlayer(),"SwimStop"), and subsequently handle OnAnimationEvent().

 

 

I tried both spelling (SwimStop and SwmmingStop) but the event is not triggering. I also tried to find "SwimStop" in CK but I could only find an Action called "ActionSwimStop". Where should I look to find the animations list in CK ?

 

 

added:

 

I also tried MTState that should trigger when the Swimming sound stops but it's not working. Here is how I did it:

 

;--------------------------------------------------------------------------------------------------------------
Event OnQuestInit()
RegisterForAnimationEvent(PlayerRef,"MTState")
endEvent
;--------------------------------------------------------------------------------------------------------------
Event OnAnimationEvent(ObjectReference akSource, string asEventName)
if (akSource == self) && (asEventName == "MTState")
Debug.Trace("Swimming Stopped!")
endIf
endEvent

;--------------------------------------------------------------------------------------------------------------

 

I also verified that the Registration is really happening with debug.trace on the return registration value and it returned "True".

 

Maybe I'm not doing this right...

 

Added2: I just tried registering for "weaponFire" to try to see if my script is ok and this is working. So I need to find and stop swimming animation event that works.

 

If you open ActionSwimStop then select 1stPSwimStop e.g, you will find the event in right window "SwimStop"

HmJAhjC.png

Edited by lee3310
Link to comment
Share on other sites

Thanks!

 

I just tried it and "RegisterForAnimationEvent(self, "FlightLanded")" / RegisterForAnimationEvent(self, "FlightTakeOff") is working for me.

 

Now I just need to find why SwimStop doesn't. I'll play with it again and google more on this event.

 

 

 

Thanks a lot for your time.

Link to comment
Share on other sites

Thanks!

 

I just tried it and "RegisterForAnimationEvent(self, "FlightLanded")" / RegisterForAnimationEvent(self, "FlightTakeOff") is working for me.

 

Now I just need to find why SwimStop doesn't. I'll play with it again and google more on this event.

 

 

 

Thanks a lot for your time.

 

I googled the issue and found that the skyrim people had experienced problems with the exact same animation event as well. AnimEvent might not be a way forward in this case. :/

 

So maybe you'll have to poll GetAnimationVariable. If that indeed does work instead. So far I've only found an untested "SwimDirection". Huge blindspot!

Link to comment
Share on other sites

For those interested in using Animation Event, I found this test script registering all OnAnimationEvent and showing the result in a Debug MessageBox.

 

I put it in a new script, commented the AnimationEvent I didn't want and changed the MessageBox to a Notification.

 

this is the link:

 

https://pastebin.com/NCg3SaqX

 

 

And you can see which one are triggering or not.

Edited by F4ll0uta
Link to comment
Share on other sites

That's me :) I extracted them from the animation files with the help of hkxpack.

 

Note that a MessageBox pauses the game, however a notification uses a 2 second queue, so if 5 events happen within 1 second, using a MessageBox you'll be able to know when exactly those events are triggered, but using a Notification you'll get the 5th notification 10 seconds later.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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