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

Bugs that are actually features.
Post Reply
Deadexow
Manual Inserter
Manual Inserter
Posts: 4
Joined: Fri Jun 14, 2024 1:47 pm
Contact:

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

Post 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 264 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.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13385
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post 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
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Not a bug”