Git Product home page Git Product logo

Comments (8)

JanCraymer avatar JanCraymer commented on June 12, 2024

Hello OlSom,

I'm not quite sure if I understood the problem already. Is the MAN a mod? If yes, can you link it please, so I can take a look at it? I also don't own the platinum DLC so I cannot test with the machines you named. If you know of any other mods that have the problem, please link them.

My best guess is that the cameras are not defined as indoorCamera which the script is specifically looking for. If you feel comfortable to fiddle with the code, you might alter/remove the if conditions and try if that helps.

from fs22_adjustablecamera.

OlSom avatar OlSom commented on June 12, 2024

image

This is the one I meant, in the forestry category. Might be a bad example since the crane camera an outdoor one. But even with the indoor condition removed, the crane cannot be adjusted. Interestingly, the 3rd person camera will be adjustable too.

I'm not sure if there are base game versions with indoor tracking cameras, but there are plenty of mods, for example this Rottne F20D which adds a second camera in the cab that tracks follows the crane.

So far the 3 machines from the platinum DLC are the only ones I found where a crane tracking camera can be adjusted, but sadly the DLC vehicles XMLs aren't available.

from fs22_adjustablecamera.

OlSom avatar OlSom commented on June 12, 2024

An interesting thing I just noticed, it also doesn't work with the normal interior camera of the Valtra 8750 which seems like it should be like any other interior camera.

from fs22_adjustablecamera.

JanCraymer avatar JanCraymer commented on June 12, 2024

First of all, the Valtra 8750 works for me. Did you try without any other mods just to rule out any mod conflicts?

Then I went through the MAN TGX with the debugger but I did not find anything useful yet. I can see that the variables are updated as they should, but that does not reflect on the camera position which is strange. Maybe there is some special game function that pins the camera to the crane position or so.

I'll keep looking when I got more time. I still think that it might be fixable somehow.

from fs22_adjustablecamera.

OlSom avatar OlSom commented on June 12, 2024

I figured it out!

The reason it doesn't work is the following line in the VehicleCamera:update function:
image

The zoom value is calculated based on the cameras distance to it's parent node:
image

But crane following cameras usually have a parent transform group in the exact same position as the camera, to avoid the camera moving while it's rotating
image

This results in an zoom value that's basically zero
image

Which means the adjustment steps have such a tiny effect that it's not noticeable.

This seems to be a working fix for it but I have only tested on a couple of vehicles so there might be some side effects to it:
image
image

from fs22_adjustablecamera.

OlSom avatar OlSom commented on June 12, 2024

Oh and regarding the other vehicles.
The Valtra 8750 didn't work for me even without other mods, and it's for the same reason as the moving cameras, it's indoor camera is in the same position as it's parent node, so it has a close to zero zoom value. I really don't understand how it could work for you.

The Platinum expansion vehicles I mentioned in my first comment aren't actually an exceptions to this, I just misunderstood how they work. It's not the camera following the crane, but rather the seat, so the camera has a reasonable distance to it's parent node like other normal indoor cameras.

from fs22_adjustablecamera.

JanCraymer avatar JanCraymer commented on June 12, 2024

Great, thank you for investigating, very helpful! :-)

I've added your fix along with some adjustment to the repo. It still needs some cleanup since the current design did not expect multiple cameras to be changed per vehicle. It can get messy if two cameras were changed and then you hit the reset button.

Overall I wish there was a better way to implement the camera movement to make it more consistent but I think that is not possible without overiding the whole VehicleCamera:update() function which I would not really want to do because that could break other mods.

About the Valtra, yes, my bad. I was testing with headtracking enabled which changes the behavior. Without headtracking, same problem.

Another thing with the MAN TGX I noticed is, that the adjustment of the crane camera is inverted. Maybe the camera rotation is the reason for that, I'm not sure yet.

from fs22_adjustablecamera.

OlSom avatar OlSom commented on June 12, 2024

Glad I could help :)

I think resetting multiple cameras isn't an issue, you basically solved it already with the new "changedByAdjustableCameraMod" boolean, you just need to save the original X Y Z and zoom into the camera instead of the spec. Be aware that the origTransX is already used by the game, so something like this:

image

from fs22_adjustablecamera.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.