Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error While Changing Camera Settings #55

Open
dundalkian opened this issue Aug 26, 2023 · 3 comments
Open

Error While Changing Camera Settings #55

dundalkian opened this issue Aug 26, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@dundalkian
Copy link

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 veger added the bug Something isn't working label Sep 5, 2023
@veger
Copy link
Owner

veger commented Sep 5, 2023

I am sorry to hear you having problems with the mod 😞

For some reason your camera settings are lost (bug in migration? 😞 ) 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
Copy link
Contributor

Adix-null commented Sep 30, 2023

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

@veger
Copy link
Owner

veger commented Oct 9, 2023

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 😞

You can either

  1. Abandon the Camera and create a new one (see Error While Changing Camera Settings #55 (comment))
  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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants