Jump to content

Detecting when the player Exit Vertibird


Recommended Posts

I want to detect when the player is in a vertibird. The first part is simple with the command "OnPlayerEnterVertibird". But there no "OnPlayerExitVertibird" function.

 

So I guess I need to start a timer to check if the player is out of the vertibird, but I don't know what to check for.

 

Any ideas?

 

 

 

Link to comment
Share on other sites

I want to detect when the player is in a vertibird. The first part is simple with the command "OnPlayerEnterVertibird". But there no "OnPlayerExitVertibird" function.

 

So I guess I need to start a timer to check if the player is out of the vertibird, but I don't know what to check for.

 

Any ideas?

 

 

 

"playerRef.IsOnMount()==false" will do i guess.

I was also interested in an "exit Vertibird/OnDismount" event but i couldn't find any.

Edited by lee3310
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.

Link to comment
Share on other sites

Thank you both. I Checked the VertibirdTurrentScript.ExitTurret script and I came up with something that seems to work:

 

;---------------
Event Actor.OnPlayerEnterVertibird(Actor PlayerRef, ObjectReference akVertibird)
Debug.Notification( "Vertibird entered by the player")
RegisterForRemoteEvent(PlayerRef, "OnItemUnequipped")
EndEvent
;---------------
Event Actor.OnItemUnequipped(Actor PlayerRef, Form akBaseObject, ObjectReference akReference)
If akBaseObject.GetName() == "Minigun"
Debug.Notification("Player just Exited the Vertibird! ")
UnregisterForRemoteEvent(PlayerRef, "OnItemUnequipped")
EndIf
EndEvent
;---------------
Event OnQuestInit()
RegisterForRemoteEvent(PlayerRef, "OnPlayerEnterVertibird")
EndEvent
;---------------
Thanks!
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.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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