Page 1 of 1

[posila] [1.1.35] Crash before startup mod dialogue! Sprite::registerToLoad

Posted: Sat Jun 19, 2021 2:38 am
by eradicator
This crash happens so early that the user has to manually remove the mod.
The "disable mods" dialogue is not shown!

Reproduction:
Download the savegame and sync mods.
Add vram saver (attached).
Crash during startup.

Probable cause:
Addition of frame_sequence to electric-energy-interface animation.

Re: [posila] [1.1.35] Crash before startup mod dialogue! Sprite::registerToLoad

Posted: Mon Jun 28, 2021 6:16 pm
by posila
Thanks for the report.
Fixed for 1.1.36. It was because of using frame_sequence together with repeat_count, so that will work and do something.

Re: [posila] [1.1.35] Crash before startup mod dialogue! Sprite::registerToLoad

Posted: Mon Jun 28, 2021 7:08 pm
by eradicator
Nice!
posila wrote:
Mon Jun 28, 2021 6:16 pm
using frame_sequence together with repeat_count
Hm... the only meaningful mention of repeat_count is a wiki page quoting your answer from one of my request threads...

Looking at it again, I admittedely don't see how repeat_count is meaningful for anything but "forward-then-backward" where it presumably increases the time until the "turnaround point"?
posila wrote:
Sat May 16, 2020 8:09 pm
The actual lenght of the animation will then be lenght of the frame_sequence (times repeat_count, times two if run_mode is "forward-then-backward"). There is a limit for (actual) animation lenght of 255 frames, though.
Wait, does that mean that a "forward-then-backward" animation with repeat_count = 2 has a maximum allowed frame_sequence length of math.floor(255/4) == 63? And does that mean that "forward" and "backward" animations frame_sequence length limit is actually affected by repeat_count even though they repeat for infinity anyway?

(Just wondering what the effects would be of enforcing repeat_count = 1 to handle edge-cases with very long animations in the mod posted above.)

Re: [posila] [1.1.35] Crash before startup mod dialogue! Sprite::registerToLoad

Posted: Tue Jun 29, 2021 9:33 am
by posila
repeat_count was added for cases where we have animation with layers ... and some layers can be just single sprite, but the layers have to match in frame_count, so repeat_count can be used to replicate short animation or single sprite to match frame count of longer animation (for example shadow of the steam turbine)

frame_sequence is the most powerful and on its own can achieve what run_mode and repeat_count can, and it's not really necessary or particularly useful to mix frame_sequence with repeat_count or run_mode... but I don't know if it is particularly useful to throw an error when such mixing occurs, especially at this stage of 1.1

Re: [posila] [1.1.35] Crash before startup mod dialogue! Sprite::registerToLoad

Posted: Tue Jun 29, 2021 2:27 pm
by eradicator
Right, forgot about layers.
posila wrote:
Tue Jun 29, 2021 9:33 am
frame_sequence is the most powerful and on its own can achieve what run_mode and repeat_count can, and it's not really necessary or particularly useful to mix frame_sequence with repeat_count or run_mode... but I don't know if it is particularly useful to throw an error when such mixing occurs, especially at this stage of 1.1
So does that mean that 255 is the maximum for any combination? And this isn't allowed either:

Code: Select all

run_mode = "forward-then-backward"
frame_count = 200
frame_sequence = nil
repeat_count = nil

Re: [posila] [1.1.35] Crash before startup mod dialogue! Sprite::registerToLoad

Posted: Tue Jun 29, 2021 4:14 pm
by kirazy
I'll also add that I use repeat_count to loop an animation for very-high animation playback speeds e.g. for Bob's pumpjacks with high numbers of speed modules so that the animation doesn't immediately reduce to a single frame. It had decent results.