Jump to content

Camera rotation bug, can't move where I look


Recommended Posts

Posted (edited)

I'm making an ability for player, in the form of a horse, carry an NPC to a desired location, while the player controls the direction of travel. I managed to get the NPC to mount the player, figured out how to properly use the .dismount method for NPCs so they actually dismount, and even fixed the “player stuck in place” issue where the character couldn’t move at all. There’s just one problem left, the camera doesn’t rotate in the direction the player is moving, meaning you go wherever you’re looking. The player’s character moves forward, but if a weapon or fists are drawn, the camera only moves vertically. Technically, I can move left and right, but there’s no precise left or right movement: the player starts walking in a circle to go left or right. If I press the “back” key, the player also moves in a circle, facing forward in the direction of travel.

Using a workbench or some chair doesn't help, this is not "stuck in third person" bug.

I can't mount a horse in this state as well.

Camera doesn't rotate in third person if i am moving, if i am on place it rotates. If in first person view, I can't look horizontally, only vertically.

 

It's really frustrating to have this issue, I feel being so close to fun and skyrim just slaps me in face with its own dick


Is there a workaround to solve this problem? The camera/controls freeze when an NPC dismounts the player or when the player is in the air during a specific “falling off a horse” animation.

Edited by OverseerPrimeXF
Posted

Consider looking into how SexLab resets various actors and races after forcing them to behave in a scene. There's some voodoo that needs to be done. Maybe it'll give you a hint to nudge the camera back to behaving itself.

Posted
12 minutes ago, traison said:

Consider looking into how SexLab resets various actors and races after forcing them to behave in a scene. There's some voodoo that needs to be done. Maybe it'll give you a hint to nudge the camera back to behaving itself.

i ran sl scene in that state and it didn't change anything, although it helped with "player can't move at all" thing. 

Posted (edited)
4 hours ago, OverseerPrimeXF said:

i ran sl scene in that state and it didn't change anything, although it helped with "player can't move at all" thing. 

 

Look a the source code instead. Start with sslActorAlias.SendDefaultAnimEvent. Consider searching through all of SL's scripts for "SendAnimationEvent" - there's all kinds of reset mechanisms strewn across the scripts.

 

Edit: I should maybe clarify that I do not actually think this will work, but on the other hand I have nothing else either and this is where I'd start myself. It seems to me you're doing something the game engine was not designed to do so for all I know you've managed to squeeze it into a state where you'd need a bytecode patch to get out again. But if we assume we're not that desperate yet, the behaviour graph is what I'd try poking; hence the reference to SL.

Edited by traison
Posted (edited)
16 hours ago, traison said:

 

Look a the source code instead. Start with sslActorAlias.SendDefaultAnimEvent. Consider searching through all of SL's scripts for "SendAnimationEvent" - there's all kinds of reset mechanisms strewn across the scripts.

 

Edit: I should maybe clarify that I do not actually think this will work, but on the other hand I have nothing else either and this is where I'd start myself. It seems to me you're doing something the game engine was not designed to do so for all I know you've managed to squeeze it into a state where you'd need a bytecode patch to get out again. But if we assume we're not that desperate yet, the behaviour graph is what I'd try poking; hence the reference to SL.

many of animation events from SendDefaultAnimEvent return "graph cant process it"

Also this state appears if i try to jump in horse mode while npc rides the player. 

maybe it's a graph problem, yet i didn't find the right sequence of events to put my player character into normal state

As i said earlier, sexlab scene does not fix this, so all fixes it applies to the player and npc are not applicable. I suppose there might be some specific horse "normal state", which i didnt find yet.

 

as for "what game engine was not designed to do" - it's our duty to squeeze it above and beyond.

Edited by OverseerPrimeXF
Posted
22 minutes ago, OverseerPrimeXF said:

...as for "what game engine was not designed to do" - it's our duty to squeeze it above and beyond.

 

I like the way you think. 👍

 

Something similar to what you describe here happens when you accidentaly press the Activate key while a SL scene is being set up. Like for instance when someone sneaks up on you while you're busy stealing Belethor's wares. The fix (or workaround depending on how you see it) is to block player activation in SL's DisablePlayerControls call. I never looked into why this is, I mean why the camera would break. It could make sense to me if the vanilla game had something like a pick up or loot animation but it doesn't. My best guess could be that maybe the vanilla game was meant to have one, or Bethesda left room for a loot animation to exist; or maybe Morrowind/Oblivion had one and we're seeing the leftovers in Skyrim.

 

If it just so happens that you're also using the Activate key anywhere while doing your horse stuff then switch to using the equivalent Papyrus function instead. I use this myself to enable dialogue during a SL scene. I listen for a custom keypress and pop up a list of all actors in a scene, then:

talkTo.Activate(player)

 

Posted (edited)
2 hours ago, traison said:

If it just so happens that you're also using the Activate key anywhere while doing your horse stuff then switch to using the equivalent Papyrus function instead. I use this myself to enable dialogue during a SL scene. I listen for a custom keypress and pop up a list of all actors in a scene, then:

talkTo.Activate(player)

 

What i am doing is:
having sick ideas
Fill actor alias with some actor, and add package "activate" to them with the player character as target. Player, being in HorseRace, can be ridden by npc after it "activates" the player, just like you will do to ride a horse - activate it. And if that npc just sits on the player, player can just move like normal and everything works, looks exactly like if player was riding a horse. Problems staring then I tell the riding npc to dismount the player (by dialog and onupdate, i register an update for a second after dialog is finished and in OnUpdate event in the associated quest npcREF.dismount() is called on the npc reference. And npc actually dismounts, but something happens that moment so even returnToDefault event cannot be processed by the graph (before that it gets processed without any problem). It happens if i jump with an npc sitting on the player as well. 

basically something breaks in that moment
I use open animation replacer to track all events now, to see what is happening, animation event log tells that "GraphDeleting" event called when race changes, whatever it does, but nothing changes for camera.
 

so i am still looking into it

edit: i forgot to mention that i have to use "TCL" on actor who mounts the player, because otherwise it causes player to fly around vigorously due to colliding with the rider, i dont know if it can somehow affect my problem.

edit 2: actually, i have to activate the rider, so maybe that can be my problem as well, but jump from player breaks camera and movement, so there may be more problems, looking into it

Edited by OverseerPrimeXF
Posted (edited)
53 minutes ago, traison said:

What does this function do, and if it does what I think it does, can you make the horse move by player input?

https://ck.uesp.net/wiki/SetCameraTarget_-_Game

this places camera exactly where you will expect it to be when you are controlling an actor. Yes, i can make the horse move, i places temporal horse and while camera was behind it i used TC on it and was able to move it. a few buts, however - it will move exactly like when npc dismounts the player, no ability to control where to move with mouse input. (that's how you can see yourself what i am talking about in this issue i have when i can't control the player with my mouse)

No first person, but it is all right. Player character keeps running in background reflecting input on the horse i control. 
although it can be used as temporal solution to the "stuck camera input for player, if it will not player character suffer from this but some temporal horse which will be disabled.

Technically i can replace player with that spawned horse, but limitations of controls are the same.

I also noticed that after an NPC dismounts the player-horse, player automatically walk somewhere at some horse position in the location i am currently (tested in winterhold and the player moved somewhere and stayed at position). In Riverwood for example, player was just staying at it's place after npc dismounted, and this is the issue i deal with by toggle player controls thing or something. TC command on player when it walks itself also toggles controls in game, but camera input is unavailable, and in first person i cant move cames left right, only vertically (the issue i started this topic)

Makes me think that it is not the graph problem at all - maybe it's some ai issues, where dismounted horse is driven by the game automatically.

Edited by OverseerPrimeXF
Posted

also i found a fun thing with all of this horse thing - 

    ActorBase Property LvlHorse auto

    Actor placed_horse = PlayerREF.PlaceActorAtMe(LvlHorse, 1)
    Utility.wait(0.5)
    game.SetCameraTarget(placed_horse)
    placed_horse.activate(PlayerREF)

and watch the player character flies freely in the air. 

Posted

all right, i made a temporal workaround with spawned horse and some consoleutil command executions on player+spawned horse. It feels fake as hell, least it does not break the player. I still have no mouse control for direction of movement, and the horse i control can't spint. So if there's any workaround for fixing controls on native player-horse, i am still looking for them.

Posted

I might have been able to replicate the problem, but I have no new ideas so I guess reporting that was pointless. I'm curious though, when the glitch with the camera happens, can the player character walk through the ground and float in the air?

Posted (edited)
40 minutes ago, traison said:

I might have been able to replicate the problem, but I have no new ideas so I guess reporting that was pointless. I'm curious though, when the glitch with the camera happens, can the player character walk through the ground and float in the air?

no, it walks on the ground and has no tcl capabilities. the only thing is the fact that i can't move camera while i'm moving, and character can't play the backward walking animation, it just spins in place. no moving of the camera in first person too, and i think that's all what happens. like when you are riding a horse, but without moving the camera to turn, only A and D are working to turn.

 

there's getcamerastate which can return current state of the camera, i didn't try what it shows in bugged mode. I wonder if i can force state with some commonlib method if that's the case, like with something like

void camera_setter(RE::StaticFunctionTag*) {
    auto* camera = RE::PlayerCamera::GetSingleton();
    camera->SetState(camera->cameraStates[RE::CameraState::kMount].get());
}

and see what happens. i'll test it a bit later

Edited by OverseerPrimeXF

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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