veger / TLBE

TLBE - Time Lapse Base Edition
MIT License
9 stars 6 forks source link

Error While Changing Camera Settings #55

Open dundalkian opened 10 months ago

dundalkian commented 10 months ago

I get the following error pointing to a nil value on transitionSpeedGain when changing almost any setting on the Camera tab. When I try to change Transition Speed Gain itself, it will point to a nil transitionPeriod. If I try to recalculate camera settings, it points to a nil transitionTicks.

All of these fields have values, and there doesn't appear to be anything obvious on the GUI to reset or otherwise the internal state of these values. I know that I started this save on a previous versions of TLBE, and the settings got migrated for the 1.5.0 update, not sure if that could be the culprit?

The mod Time Lapse Base Edition (1.5.0) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event TLBE::on_gui_text_changed (ID 2)
__TLBE__/scripts/camera.lua:103: attempt to perform arithmetic on field 'transitionSpeedGain' (a nil value)
stack traceback:
    __TLBE__/scripts/camera.lua:103: in function 'updateConfig'
    __TLBE__/scripts/camera.lua:304: in function 'setFrameRate'
    __TLBE__/scripts/gui.lua:556: in function <__TLBE__/scripts/gui.lua:511>
veger commented 10 months ago

I am sorry to hear you having problems with the mod :disappointed:

For some reason your camera settings are lost (bug in migration? :disappointed: ) as transitionSpeedGain should always be set. Since you cannot udpate all missing values in one go, it will be impossible to fix the camera.

The easiest solution is to

  1. create a new camera,
  2. set its position and zoom with an area tracker
  3. delete the broken camera
  4. continue playing with the new camera.

If you have the save file from before upgrading to the newest mod version and are willing to share it, I can take a look if the migration is indeed broken and fix it.

If not, and you really want to keep the broken Camera, we can take a look the manually/temporarily change the code for you in order to inject the missing values. This needs to be done in multiple steps (code changes) and each fix will uncover the following missing setting... So it will be a long/painful process (and it requires you to changing the mods code)

Adix-null commented 9 months ago

I get the same issue even after freshly installing the mod, but the 1.4.5 version works fine

veger commented 9 months ago

I was able to reproduce with one of my (test) saves, where I loaded a development version of the mod, and then loaded the final version. This is caused because the migration is applied already, and updates to the migration file get ignored (as the game will run each migration only/exactly once).

I guess when you use the updated mod (v1.5.0) in the existing save, you do not see the 'migrated to new camera settings' message? (Indicating the migration was indeed executed earlier for that save and it didn't update the camera settings)

If this is the case, your Camera settings are (partially) updated, and your Camera is basically broken :disappointed:

You can either

  1. Abandon the Camera and create a new one (see https://github.com/veger/TLBE/issues/55#issuecomment-1706440799)
  2. Unpack the mod, rename the migrations/tlbe_1.4.5.lua file to migrations/tlbe_1.4.5_fix.lua and it will run again. Then tweak the file to only include the missing fields until it works (don't save the game when it failed or that migration won't be applied the next time a well)
  3. Send me the save file and I'll try to fix the Camera and send it back (using the method of the previous step)