F4llfield Posted April 12, 2023 Share Posted April 12, 2023 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 More sharing options...
lee3310 Posted April 12, 2023 Share Posted April 12, 2023 (edited) 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 April 12, 2023 by lee3310 Link to comment Share on other sites More sharing options...
SKKmods Posted April 12, 2023 Share Posted April 12, 2023 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 More sharing options...
F4llfield Posted April 12, 2023 Author Share Posted April 12, 2023 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 More sharing options...
F4llfield Posted April 12, 2023 Author Share Posted April 12, 2023 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"). Link to comment Share on other sites More sharing options...
F4llfield Posted April 12, 2023 Author Share Posted April 12, 2023 In the same idea, How can I detect when the player stop swimming ? Link to comment Share on other sites More sharing options...
RaidersClamoring Posted April 12, 2023 Share Posted April 12, 2023 UI.Get("VertibirdMenu", "root1.ButtonHintBar_mc.visible") ; should be false Link to comment Share on other sites More sharing options...
RaidersClamoring Posted April 12, 2023 Share Posted April 12, 2023 OnPlayerSwimming() Link to comment Share on other sites More sharing options...
F4llfield Posted April 12, 2023 Author Share Posted April 12, 2023 (edited) 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 ? Edited April 13, 2023 by F4ll0uta Link to comment Share on other sites More sharing options...
lee3310 Posted April 13, 2023 Share Posted April 13, 2023 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 More sharing options...
Recommended Posts