834159672 Posted January 11, 2023 Share Posted January 11, 2023 (edited) Disclaimer / Preface: I have little to no experience with the CK and started trying out papyrus scripts for the first time a couple days ago. I don't expect this mod to make it to completion, it seems camera stuff in particular can be rather difficult, but at the very least I hope to learn a little more from it. IFPV and other camera mods are not currently up-to-date with Version 659 which I use, hence my looking into this. Placed a button at the start of Helgen's Keep to help test and get into papyrus: Scriptname witness_me extends ObjectReference actor property the_player auto actor property ralof auto ObjectReference property an_object auto Event OnActivate(ObjectReference akActionRef) the_player.SetAnimationVariableBool("IsNPC", true) the_player.SetHeadTracking(true) the_player.SetLookAt(ralof as ObjectReference) ;an_object.KnockAreaEffect(1, 3000) ;game.DisablePlayerControls(1, 1, 1, 1, 1, 1, 1) ;game.SetCameraTarget(ralof) ;ralof.kill() ;Actor the_player = game.GetPlayer();slower alternative to "the_player" with properties gui ;the_player.SetAlpha(0.0) ;ralof.SetHeadTracking(false) EndEvent This code (with the properties set, thought playerRef was a global since everyone uses it, learned that the hard way) makes the player's head look at / headtrack Ralof when in third person. Some commented out functions from testing left in for fun. I found the most useful resources to be the list of functions, complete example scripts, INI commands, some third person and headtracking mods, and lastly the SKSE jumpstart. My approach was to modify the third person camera to be between the eyes of the player character like IFPV. I imagine it was either that or attaching third person animations to the first person camera which would cause even more problems (JOP). The code currently makes the player look at Ralof, but I planned for it to look at wherever the player is looking at in this pseudo first person. I also removed movement dampening through a custom INI file that goes by the same name as the mod, "fControllerBufferDepth=0.01" and"bDampenPlayerControls=0", so that controls are more responsive like in regular first person, I honestly can't play in third person without that. This is where I run into issues however. None of the vanilla or SKSE functions seem to have enough control over the camera, which I suppose explains why .dll files are used and why camera mods break so often with each update. My question is if it is possible to achieve a mod like IFPV without using a .dll. "SetCameraTarget" is an interesting function that attaches the camera to another actor while keeping player controls. "MoveToNode" might be able to move an actor to the head of the player. There are INI functions for camera offsets but it would probably be unreasonable to change those values continuously. Just brainstorming... Edited January 11, 2023 by 834159672 Link to comment Share on other sites More sharing options...
834159672 Posted January 22, 2023 Author Share Posted January 22, 2023 Well, in any case I got the proof of concept working, I have a picture of the nose and body! I can't upload it directly on this forum apparently though, can't upload media and use "image" or "My Media" either, site says "not allowed". I'm sure it's trivial but I don't have the patience to look around for some arbitrary combination of buttons to get a simple image up here lol. It was achieved with the following code: Scriptname witnessMe extends ObjectReference {look at me} actor property the_player auto actor property invisible_npc auto actor property ralof auto ObjectReference property an_object auto Bool a_toggle = false Event OnActivate(ObjectReference akActionRef) if (a_toggle == 0) a_toggle = !a_toggle Utility.SetINIFloat("fOverShoulderPosX:Camera", 0.0000) Utility.SetINIFloat("fOverShoulderPosZ:Camera", 0.0000) Utility.SetINIFloat("fVanityModeMinDist:Camera", 0.0000) Utility.SetINIFloat("fVanityModeMaxDist:Camera", 0.0000) Utility.SetINIFloat("fPitchZoomOutMaxDist:Camera", 0.0000) ;the_player.SetAnimationVariableBool("IsNPC", true) ;the_player.SetHeadTracking(true) ;the_player.SetLookAt(ralof as ObjectReference) Utility.wait(2.0);unsheathe and sheathe for ini fOverShoulderPosX to properly take effect game.SetCameraTarget(invisible_npc) while(1) invisible_npc.MoveToNode(the_player, "NPCEyeBone") endWhile else a_toggle = !a_toggle game.SetCameraTarget(the_player) ;set the camera ini values back to defaults Utility.SetINIFloat("fOverShoulderPosX:Camera", 30.0000) Utility.SetINIFloat("fOverShoulderPosZ:Camera", -10.0000) Utility.SetINIFloat("fVanityModeMinDist:Camera", 155.0000) Utility.SetINIFloat("fVanityModeMaxDist:Camera", 600.0000) Utility.SetINIFloat("fPitchZoomOutMaxDist:Camera", 100.0000) endIf EndEvent An invisible actor with a custom race using a small height and no nif (no hitbox) was used for the invisible_npc auto. This was done because the player would collide with them and could not move forward, and the MoveToNode also gets offset by the actor's height. In the end the camera gets positioned perfectly between the eyes. Nearclip decreased just to show the nose for demonstration. There are two major problems with the mod however:-First is that the camera is a bit too shaky. It should work fine for various animations, but for general gameplay some kind of interpolation would need to take place to smooth out the camera, or smoother animations-Rotating the player (yaw) is difficult. The SetLookAt function works great but has its share of bugs, such as the player continuing to attack in their initial direction when the button was pressed rather than attacking what they are looking at There are a large number of animation variables here in combination with player controls that would probably solve the second problem, but there is not a lot of documentation on them and it's not very enjoyable going through them all to find out what works. I'll probably call it quits for now, this is just for anyone that wants to pursue this further or better understand some of the more niche Papyrus functions. Link to comment Share on other sites More sharing options...
Sphered Posted January 22, 2023 Share Posted January 22, 2023 NiOverride is never mentioned with camera stuff and I have no idea why You can move nodes instead of your ref. Say.... NPC COM or NPC. Thats not the same as moving a ref, camera-wise. Clipping and a lot of annoyances wont happen when you do it this way. These node adjustments have a first person argument so if you try this route be sure to use the applicable arguments Link to comment Share on other sites More sharing options...
834159672 Posted February 4, 2023 Author Share Posted February 4, 2023 (edited) Improved Camera SE was just updated! But not for GOG, time to learn NiOverride then lol. If I understand right, NiOverride is needed because the existing vanilla and SKSE functions cannot move nodes, only reference and move other stuff to them like the "MoveToNode" function used above to move an object? I see the Racemenu "Modder's Package" includes NiOverride. NiOverride.psc has the function "SetNodeDestination" which can then be followed by "UpdateNodeTransform". It sounds like I may be able to use this on the actual camera node, which I think is called "Camera3rd [Cam3]". That node would then move to "NPCEyeBone" rather than moving an entire actor there like before. Alternatively, "NPC COM" could also be used as you say. Now using Mod organizer 2 for this, I'm enabling the "Modder's Package" and launching the Creation Kit from there, with that package as a plugin (PluginTemplate.esp). Gameplay -> Papyrus Script Manager -> NiOverride -> compile is failing however. The error relates to " unknown type armoraddon". This thread talks about a similar issue, might get into SSEScript, idk. Looking into it... Edited February 4, 2023 by 834159672 Link to comment Share on other sites More sharing options...
Sphered Posted February 4, 2023 Share Posted February 4, 2023 Creation club clutter, xedit, and other changes imposed on SE have resulted in me mostly making content on LE. I understand that netimmerse is gone from SE. Possibly merged into NiOverride, IDK just guessing dont have those sources handy atm Point being, changes happened, and for all I know this isnt as viable on SE, but I should think it would be Heres one of my NetImmerse calls. Again, its not SE-friendly with their changes they made, but could help guide for usage ;================================================================= Function AdjustFPSNode(ObjectReference Who,String NodeToAdj,Float PosX = 0.0,Float PosY = 0.0,Float PosZ = 0.0,Float RotY = 0.0,Float RotP = 0.0,Float RotR = 0.0,Float Size = 1.0) Global Bool Proceed = Who as Bool && Who.Is3DLoaded() && Who.HasNode(NodeToAdj) If Proceed Float[] XYZ = New Float[3] Float[] YPR = New Float[3] XYZ[0] = PosX XYZ[1] = PosY XYZ[2] = PosZ YPR[0] = RotP YPR[1] = RotR YPR[2] = RotY NetImmerse.SetNodeLocalRotationEuler(Who,NodeToAdj,YPR,True) NetImmerse.SetNodeLocalPosition(Who,NodeToAdj,XYZ,True) NetImmerse.SetNodeScale(Who,NodeToAdj,Size,True) EndIf EndFunction ;================================================================= Link to comment Share on other sites More sharing options...
greyday01 Posted February 5, 2023 Share Posted February 5, 2023 I hope you get in working. I play in first person and when I approach a counter to buy things I feel as if I'm 10 yrs old and have to stand on tiptoes to see over the counter. I think the vanilla camera is in the middle of my chest or something. Good luck. Link to comment Share on other sites More sharing options...
Sphered Posted February 6, 2023 Share Posted February 6, 2023 I am not needing luck. I am not exploring SSE means of doing what I enjoy in LE. It was me offering you a lead. Take care Link to comment Share on other sites More sharing options...
scorrp10 Posted February 6, 2023 Share Posted February 6, 2023 NetImmerse calls are working quite fine in SSE for whoever wants to use them. NiOverride just has potential to keep thing a lot neater with different mods not messing with each other (as much) But just to mention:I been using this: https://www.nexusmods.com/skyrimspecialedition/mods/14515For quite some time. It is Papyrus only, no dll. Link to comment Share on other sites More sharing options...
834159672 Posted February 8, 2023 Author Share Posted February 8, 2023 (edited) The NiOverride compilation failure (armoraddon reference which is provided by SKSE) turned out to be the result of a typo in the SKSE readme. Step 3 said to put the scripts under "Data\Scripts\Source\" when it should be under "Data\Source\Scripts\" for the anniversary edition. Got NiOverride working, verified by using the "SetNodeDestination" and "UpdateNodeTransform" on the left hand (NPC L Hand [LHnd]) to the eyes (NPCEyeBone). while(1) NiOverride.SetNodeDestination(the_player as ObjectReference, 0, 0, "NPC L Hand [LHnd]", "NPCEyeBone") NiOverride.UpdateNodeTransform(the_player as ObjectReference, 0, 0, "NPC L Hand [LHnd]") ;NiOverride.SetNodeDestination(the_player as ObjectReference, 0, 0, "Camera3rd [Cam3]", "NPCEyeBone") ;NiOverride.UpdateNodeTransform(the_player as ObjectReference, 0, 0, "Camera3rd [Cam3]") endWhile No luck though trying to move any of the camera-related nodes to the eyes, which I found somewhat surprising. Incidentally, the "SetScale" function used in the aforementioned mod also doesn't appear to affect the third person camera position. It would seem the race height in combination with the actor height are the only two intrinsic variables that influence the camera height that I'm aware of. This leaves the two previous options:-An actor at the eye node-INI fOverShoulderPos The former looks great but has it's own fair share of bugs. If the "camera race" has no skeleton, the game crashes if the player tries to sit for example. This might be mitigated by giving the "camera race" a skeleton and moving that skeleton away using NiOverride to avoid unwanted collision per the previous recommendation, I was just hoping to get more out of NiOverride than that. There is also the issue of the player yaw. Camera is also a bit shaky. The latter will have far fewer bugs but the various animation states will need to be accounted for (standing vs sprinting vs weapon-out all influence the head position). There are just too many states that I'm not going to bother with this method. Perhaps influencing the fOverShoulderPos based on the eye node? I'll tinker around with it some more, should be able to get at least something out of this, whether it be the former, latter, or a hybrid approach. Edited February 8, 2023 by 834159672 Link to comment Share on other sites More sharing options...
Sphered Posted February 9, 2023 Share Posted February 9, 2023 Ini settings you do remind me there is one that helps with clipping a good bit [Camera]fActorFadeOutLimit=-100.0 and thats a minus sign meaning negative 100. Zero doesnt seem to make enough difference to matter but negative vals do As for a designated cameraman race that is viable and I did that before. They just need a skin of some kind if I recall. Cameraman can be disabled and imo should remain disabled so they dont get in the way or move around etc. Setting their scale completely changes how SetCameraTarget(Them) will look btw so try something like 0.2 scale, and yes even if disabled it reflects on what you will see As for setting destination I am not sure how that computes for camera use but I would def try that on the actual look nodes. These are on the first person skeleton, not the main one. So play with that too if still having issues x_NPC LookNode [Look]x_NPC Translate [Pos ]x_NPC Rotate [Rot ] Link to comment Share on other sites More sharing options...
Recommended Posts