Page 1 of 1

[>=2.0.18] GuiElement "camera" broken

Posted: Tue Nov 26, 2024 1:41 pm
by Pi-C
My mod miniMAXIme allows players to change their appearance on the fly (depending on third-party character mods). The players get a GUI to preview and select characters:
Still working in 2.0.17
Still working in 2.0.17
Screenshot_previews_2-0-17.png (3.26 MiB) Viewed 519 times
I've recently got a bug report because there were no previews. Apparently, this started with Factorio 2.0.18 (yes, I downloaded all versions from 2.0.15–2.0.21 to find the version where the bug first occurred). So this is what players will now see:
No previews in 2.0.18
No previews in 2.0.18
Screenshot_previews_2-0-18.png (3.17 MiB) Viewed 519 times

My mod places its preview characters on hidden surfaces. I have confirmed that the camera GuiElements and the preview characters are still valid by teleporting myself onto the preview surface:
Player on preview surface
Player on preview surface
Screenshot_2-0-18_on_cam.png (112.42 KiB) Viewed 519 times

So it seems that the original behavior of the camera GuiElement (the owner of the GUI can see what's happening at camera.position on the surface with camera.surface_index) has been changed in such a way that the player must be on the surface that the camera is pointed at to see anything.

I didn't find anything about this in the changelog, so I presume this is a bug. To reproduce, load the attached saved game with Factorio 2.0.17 (syncing mods) to get the working version. Quit and start Factorio 2.0.18 or later, and load the same saved game again.

To move the character to the hidden surface, enter the following command on the chat console:

Code: Select all

/c game.player.teleport({0, 1}, 3)

Re: [>=2.0.18] GuiElement "camera" broken

Posted: Tue Nov 26, 2024 2:20 pm
by Rseding91
Thanks for the report. This is now fixed for the next release.

Re: [>=2.0.18] GuiElement "camera" broken

Posted: Tue Nov 26, 2024 3:51 pm
by Pi-C
Great, thank you very much! :-)

Re: [>=2.0.18] GuiElement "camera" broken

Posted: Tue Nov 26, 2024 5:02 pm
by micromario
Thank you!