Page 1 of 1

[1.1.107]The GuiElementType "entity-preview" is useless.

Posted: Thu Jun 20, 2024 8:31 am
by Deadexow
What did you do?
I simply entered the command

Code: Select all

/c local t = game.player.gui.screen.add{type = "entity-preview",  entity = game.player.character} t.style.height = 180 t.style.width = 180
in the command box.

What happened?
It just no thing happen.

What did you expect to happen instead?
I wish I can get a gui like this.
QQ截图20240620162659.png
QQ截图20240620162659.png (4.44 MiB) Viewed 265 times
Does it happen always, once, or sometimes?
This issue can be reproduced easily by following my steps anytimes.

log-file
factorio-current.log
(7.4 KiB) Downloaded 14 times
save-file
Do I need to provide a save file? This issue can be reproduced easily by following my steps in any savegame.

adds
I am a mod developer from China, and my English is not very proficient.

Re: [1.1.107]The GuiElementType "entity-preview" is useless.

Posted: Thu Jun 20, 2024 9:01 pm
by Rseding91
Thanks for the report. You can't set "entity" when creating the GUI element. You must set it after it's created like this:

Code: Select all

/c local t = game.player.gui.screen.add{type = "entity-preview"} t.entity = game.player.character t.style.height = 180 t.style.width = 180