loki79uk / FS22_CabView

Mod for FS22. Please download latest release below.
19 stars 4 forks source link

Not working after new 1.4 update #6

Closed Tubezki closed 2 years ago

Tubezki commented 2 years ago

Not working with new 1.4 patch.

jason0611 commented 2 years ago

Many scripts won't work since patch 1.4. Giants has already announced a hotfix.

loki79uk commented 2 years ago

Hopfully GIANTS will sort it out soon!

image https://discord.com/channels/299449702599098368/416574224912613379/965937574298419201

Tubezki commented 2 years ago

Okay I did not know that! Thanks guys. Just wanted to info here what I found out after patch.

yumi-modding commented 2 years ago

Hello FYI it's also possible to edit the specialization registration code here in the mod to fix the issue. For example, manualAttach mod keeps working after 1.4.0.0 patch due to a different way of addSpecialization call. I started working on these changes for your mod. I can send what I have already as a PR if you're interested. Yumi

jason0611 commented 2 years ago

Thank you, I'm interested in that. I've fixed the registration in HeadlandManagement, too, but it's always good to compare with other solutions. Currently I wait for the hotfix to see if the issue is fixed there, because my solution doesn't work with version 1.3.1 and so I expect it not to work with the hotfix, too.

loki79uk commented 2 years ago

Hello FYI it's also possible to edit the specialization registration code here in the mod to fix the issue. For example, manualAttach mod keeps working after 1.4.0.0 patch due to a different way of addSpecialization call. I started working on these changes for your mod. I can send what I have already as a PR if you're interested. Yumi

That would be great - I'm working on it now, but my brain is scrambled from the day at work. I'm also available on Discord if it is easier for you: Loki_79#2864

yumi-modding commented 2 years ago

Hello @jason0611 This is what i proposed to Loki_79. We discussed on Discord since specialization code need also changes after this. My recommendation would be to try to replicate some code like manualAttach for spec registration and usage that is very close to Giants code style and looks very clean. There is a bit more code but once skeleton is done you can use it in every mod you write.


CabViewREGISTER = {};

gspecializationManager:addSpecialization('cabView', 'CabView', Utils.getFilename('CabView.lua', gcurrentModDirectory), nil);

for typeName, typeEntry in pairs(g_vehicleTypeManager:getTypes()) do

if  SpecializationUtil.hasSpecialization(Drivable,  typeEntry.specializations) and

    SpecializationUtil.hasSpecialization(Motorized, typeEntry.specializations) and

    SpecializationUtil.hasSpecialization(Enterable, typeEntry.specializations) and

    SpecializationUtil.hasSpecialization(Dashboard, typeEntry.specializations) then

        g*vehicleTypeManager:addSpecialization(typeName, g*currentModName .. '.cabView')    

    print("INSTALLED: "..typeName)

end

end
`
jason0611 commented 2 years ago

Thank you very much. Your solution is very like my one. :-) But as it doesn't seem to work with version 1.3.1, I assume it won't work with hotfix 1.4.1, too. So I will wait until tomorrow and see what Giants has fixed.

loki79uk commented 2 years ago

Thank you very much. Your solution is very like my one. :-) But as it doesn't seem to work with version 1.3.1, I assume it won't work with hotfix 1.4.1, too. So I will wait until tomorrow and see what Giants has fixed.

I just tested the new 1.4 versions of both CabView and UniversalAutoload with 1.3.1 and they were both working. What is the error that you get when running the fixed version in 1.3.1?

jason0611 commented 2 years ago

I've found the issue with version 1.3.1, it's just a very little detail:

Before (not working):
g_specializationManager:addSpecialization("HeadlandManagement", "HeadlandManagement", g_currentModDirectory.."headlandManagement.lua", true, nil)

After (working):
g_specializationManager:addSpecialization("HeadlandManagement", "HeadlandManagement", g_currentModDirectory.."headlandManagement.lua", nil)

So all is fine now and my HeadlandManagement is ready for the coming updates. :-) Thank you very much for your support.

loki79uk commented 2 years ago

Mine are still broken after 1.4.1.0... I forget what happened in 1.4, but now there is an error message: Error: Invalid customEnvironment given for SpecializationManager.addSpecialization. Should be a string or nil.

yumi-modding commented 2 years ago

customEnvironment is the arg you pass after the filename

function SpecializationManager:addSpecialization(name, className, filename, customEnvironment)

I guess you should pass nil as other mods do Except if they changed again something here, need to check

loki79uk commented 2 years ago

It looks like they made an error message, but did not apply a fix to replace the bool from old style function call with nil.. I've submitted a new version for testing, but I don't think there is anything else I can do.

jason0611 commented 2 years ago

I've got no errors for HeadlandManagement anymore. At least the server's log is clear, more I can't test before at home after work.

loki79uk commented 2 years ago

Actually it turns out that the old versions do still work, but something weird happened to my keybindings. There is still an error in the log, but after verifying the game files and resetting my keybindings, they are both working again.

loki79uk commented 2 years ago

Original bug resolved. Thanks to everyone that contributed!