mrsiCkstar Posted August 10, 2017 Share Posted August 10, 2017 (edited) Over the past few days I've been looking for a way to be able to pan the camera around when looking at the drone camera feed of the Vertidrones mod. How it works is you select the view camera option in the pip boy, then when you exit the pip boy, the camera follows the drone while it flies. However I'm not able to pan the camera around with the mouse like I can normally when in 3rd person perspective. I can do it if I hold down V, but only sideways movement is possible as moving the mouse back and forwards controls zoom. I'd like to be able to pan the camera around the drone in all directions so that I can look directly down at the terrain below the drone. I figured the way to do this would be to add the normal 3rd person camera controls to the drone, but I need help doing it. Does anyone know how this could be done? Thanks. Edited August 10, 2017 by mrsiCkstar Link to comment Share on other sites More sharing options...
werr92 Posted August 10, 2017 Share Posted August 10, 2017 At some point (in case with the holotape and pipboy it is a holotape script fragment) you wanna have these lines in your script: .... Game.SetCameraTarget(pSomeActor) Game.ForceFirstPerson() Game.ForceThirdPerson() It is important to switch 1st/3d person view in order to get camera attached to a new target, which might be only of Actor type. Link to comment Share on other sites More sharing options...
mrsiCkstar Posted August 10, 2017 Author Share Posted August 10, 2017 (edited) At some point (in case with the holotape and pipboy it is a holotape script fragment) you wanna have these lines in your script: .... Game.SetCameraTarget(pSomeActor) Game.ForceFirstPerson() Game.ForceThirdPerson() It is important to switch 1st/3d person view in order to get camera attached to a new target, which might be only of Actor type. Thanks! I think I've found where in the script this should be done, but some of your code is already in there. Event OnTimer(int aiTimerID) If (aiTimerID == 420) Actor theDrone = drones[controlledIndex] Game.forceThirdPerson() videoImod.apply(1) Game.setCameraTarget(theDrone) myLayer = inputenablelayer.Create() myLayer.disablePlayerControls(False, True, True, False, False, True, True, True, True, True, True) If (!Game.getPlayer().isSneaking()) Game.getPlayer().startSneaking() EndIf videoMessage.show(0, 0, 0, 0, 0, 0, 0, 0, 0) Self.StartTimer(1 as float, 69) ElseIf (aiTimerID == 69) If (!Game.getPlayer().isSneaking()) Game.setCameraTarget(Game.getPlayer()) myLayer.delete() Game.forceFirstPerson() videoImod.remove() controlledIndex = -1 Else Self.StartTimer(0.1, 69) EndIf EndIf EndEventI'm pretty sure this code controls what happens once you view the drone camera feed in the pip boy. I see it switches to 3rd person view and sets the drone as the camera target. It doesn't do the switch from 1st to 3rd person view like you said should be done. Is that the reason why the camera controls don't function? I also see that there's a bit of code that disables player controls, but I'm guessing that's to prevent me from moving my character while I'm looking at the drone camera. Or does that also disable the camera panning? If someone could explain what all is controlled by all the true and false inside myLayer.disablePlayerControls(False, True, True, False, False, True, True, True, True, True, True) I'd be grateful. Then I could start testing things out. PS: I hope I'm not breaking any rules by posting a bit of code from the mod. If so let me know and I'll remove it. Edited August 10, 2017 by mrsiCkstar Link to comment Share on other sites More sharing options...
mrsiCkstar Posted August 10, 2017 Author Share Posted August 10, 2017 Well did some testing and setting everything in myLayer.disablePlayerControls to false indeed just lets me move my character around while I'm looking at the drone camera. Camera panning still didn't work. I also tried the code like you suggested like so: Event OnTimer(int aiTimerID) If (aiTimerID == 420) Actor theDrone = drones[controlledIndex] videoImod.apply(1) Game.setCameraTarget(theDrone) Game.ForceFirstPerson() Game.ForceThirdPerson() But it made no difference. Link to comment Share on other sites More sharing options...
mrsiCkstar Posted August 14, 2017 Author Share Posted August 14, 2017 Bump. Still need help with this. Link to comment Share on other sites More sharing options...
JonathanOstrus Posted August 14, 2017 Share Posted August 14, 2017 I'm pretty sure this code controls what happens once you view the drone camera feed in the pip boy. I see it switches to 3rd person view and sets the drone as the camera target. It doesn't do the switch from 1st to 3rd person view like you said should be done. Is that the reason why the camera controls don't function? I also see that there's a bit of code that disables player controls, but I'm guessing that's to prevent me from moving my character while I'm looking at the drone camera. Or does that also disable the camera panning? If someone could explain what all is controlled by all the true and false inside myLayer.disablePlayerControls(False, True, True, False, False, True, True, True, True, True, True) I'd be grateful. Then I could start testing things out. PS: I hope I'm not breaking any rules by posting a bit of code from the mod. If so let me know and I'll remove it. Looking at the function definition for DisablePlayerControls on the wiki should explain all the parameters for you. https://www.creationkit.com/fallout4/index.php?title=DisablePlayerControls_-_InputEnableLayer Based on the parameters the 4th one which is abLooking is set to false in the code sample above. You can try changing that to true and it should allow you to move the camera view around. Link to comment Share on other sites More sharing options...
mrsiCkstar Posted August 15, 2017 Author Share Posted August 15, 2017 Thanks for the link to the wiki. I'll consult that page a lot from now on. Setting the 4th parameter to true didn't work. According to the wiki, setting it to false should mean that abLooking is not disabled so it should work by default in the mod then. For some reason it doesn't. I tried setting it to true, but no luck. On that page it did say that "Calling DisablePlayerControls with the False flag set for individual parameters will not re-enable controls that are already disabled. Use EnablePlayerControls instead." So I used EnablePlayerControls with the parameter for abLooking set to true. The script compiled fine but when I activated the drone camera, instead of the camera following the drone, it was just the regular 3rd person camera on the player. I recalled the drone and launched another one, and then the drone camera was on the drone, but looking didn't work. I'm really starting to think that the problem is, that even though the camera is attached to the drone, the actor I'm really controlling is still the player character. So looking technically has been working all the time, but when I try to use it, it's trying to look around the player character but the camera is somewhere else. I think maybe the only way to get it working how I want is to make the drone directly controllable. So the player can fly it wherever they want. That would be awesome, but I don't know if that's even possible with the current version of F4SE. Link to comment Share on other sites More sharing options...
Recommended Posts