Crash when using "entity-preview" gui element
- GalactusX31
- Inserter
- Posts: 28
- Joined: Thu Jul 20, 2017 11:27 am
- Contact:
Crash when using "entity-preview" gui element
I need to know how to use / implement this gui element for my mod; In the wiki and api page there is no information about the use of this, and every time I try to add it and use it, my game crashes and throws me off.
I have tried to find information about it, but I have not been able to find it anywhere, I would appreciate someone showing me how it can be done to have a preview of the selected entity, as does factorio.
Thanks
I have tried to find information about it, but I have not been able to find it anywhere, I would appreciate someone showing me how it can be done to have a preview of the selected entity, as does factorio.
Thanks
Re: Use of "entity-preview" gui element
Seems to crash for me too:GalactusX31 wrote:I need to know how to use / implement this gui element for my mod; In the wiki and api page there is no information about the use of this, and every time I try to add it and use it, my game crashes and throws me off.
I have tried to find information about it, but I have not been able to find it anywhere, I would appreciate someone showing me how it can be done to have a preview of the selected entity, as does factorio.
Thanks
Code: Select all
Factorio crashed. Generating symbolized stacktrace, please wait ...
c:\factorio\libraries\stackwalker\stackwalker.cpp (907): StackWalker::ShowCallstack
c:\factorio\src\util\logger.cpp (367): Logger::writeStacktrace
c:\factorio\src\util\logger.cpp (469): Logger::logStacktrace
c:\factorio\src\util\crashhandler.cpp (155): CrashHandler::writeStackTrace
c:\factorio\src\util\crashhandler.cpp (485): CrashHandler::SignalHandler
d:\th\minkernel\crts\ucrt\src\appcrt\misc\exception_filter.cpp (219): _seh_filter_exe
f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl (299): `__scrt_common_main_seh'::`1'::filt$0
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FF6ACAB9AE0)
00007FF6ACAB9AE0 (factorio-run): (filename not available): __C_specific_handler
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFF31774C7D)
00007FFF31774C7D (ntdll): (filename not available): _chkstk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFF316ED1D8)
00007FFF316ED1D8 (ntdll): (filename not available): RtlWalkFrameChain
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFF31773BAE)
00007FFF31773BAE (ntdll): (filename not available): KiUserExceptionDispatcher
c:\factorio\libraries\agui\src\agui\style.cpp (141): agui::Style::getNaturalWidth
c:\factorio\libraries\agui\src\agui\widget\widget.cpp (1243): agui::Widget::resizeToContents
c:\factorio\libraries\agui\src\agui\widget\widget.cpp (1259): agui::Widget::resizeToContentsRecursive
c:\factorio\libraries\agui\src\agui\widget\widget.cpp (1253): agui::Widget::resizeToContentsRecursive
c:\factorio\libraries\agui\src\agui\topcontainer.cpp (22): agui::TopContainer::processTriggersToResize
c:\factorio\src\graphics\guirenderer.cpp (50): GuiRenderer::prepare
c:\factorio\src\mainloop.cpp (799): MainLoop::prepare
c:\factorio\src\mainloop.cpp (530): MainLoop::mainLoopStep
c:\factorio\src\mainloop.cpp (332): MainLoop::run
c:\factorio\src\main.cpp (1108): wmain
f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl (283): __scrt_common_main_seh
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFF2ED61FE4)
00007FFF2ED61FE4 (KERNEL32): (filename not available): BaseThreadInitThunk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFF3173EFC1)
00007FFF3173EFC1 (ntdll): (filename not available): RtlUserThreadStart
Stack trace logging done
26.884 Error CrashHandler.cpp:156: Map tick at moment of crash: 650
26.884 Error Util.cpp:67: Unexpected error occurred. If you're running the latest version of the game you can help us solve the problem by posting the contents of the log file on the Factorio forums.
Please also include the save file(s), any mods you may be using, and any steps you know of to reproduce the crash.
28.577 Creating crash dump.
28.673 CrashDump success
Code: Select all
/c entity = game.player.selected game.player.gui.center.add{type = "entity-preview", entity = entity}
Re: Crash when using "entity-preview" gui element
Thanks for the report. It's now fixed for the next version of 0.16.
If you want to get ahold of me I'm almost always on Discord.
- eradicator
- Smart Inserter
- Posts: 5207
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Crash when using "entity-preview" gui element
Odd. It worked fine when i tested it when it was first added.
Re: Crash when using "entity-preview" gui element
If you set a style on it, i think it would workeradicator wrote:Odd. It worked fine when i tested it when it was first added.
- GalactusX31
- Inserter
- Posts: 28
- Joined: Thu Jul 20, 2017 11:27 am
- Contact:
Re: Crash when using "entity-preview" gui element
I can confirm, that even if I put a style to that element, it keeps crashing the game
- GalactusX31
- Inserter
- Posts: 28
- Joined: Thu Jul 20, 2017 11:27 am
- Contact:
Re: Crash when using "entity-preview" gui element
Nvm, problem solved, thanks
- eradicator
- Smart Inserter
- Posts: 5207
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Crash when using "entity-preview" gui element
@0.16.26:
The example code supplied by Klonan that assigns the entity directly when creating the gui element doesn't work for me. It only creates an empty entity-preview. The only way i can get an entity to actually show up in the preview is by assigning the entity after creating the gui element. Would be nice if assignment on creation worked.
The example code supplied by Klonan that assigns the entity directly when creating the gui element doesn't work for me. It only creates an empty entity-preview. The only way i can get an entity to actually show up in the preview is by assigning the entity after creating the gui element. Would be nice if assignment on creation worked.
Code: Select all
/c
g = game.player.gui.center
g.clear()
entity = game.player.selected
ep = g.add{type = "entity-preview", entity = entity}
ep.entity = entity --[[created empty without this]]
Re: Crash when using "entity-preview" gui element
Assignment on creation isn't supported and never will be.eradicator wrote:@0.16.26:
The example code supplied by Klonan that assigns the entity directly when creating the gui element doesn't work for me. It only creates an empty entity-preview. The only way i can get an entity to actually show up in the preview is by assigning the entity after creating the gui element. Would be nice if assignment on creation worked.
Code: Select all
/c g = game.player.gui.center g.clear() entity = game.player.selected ep = g.add{type = "entity-preview", entity = entity} ep.entity = entity --[[created empty without this]]
If you want to get ahold of me I'm almost always on Discord.
- eradicator
- Smart Inserter
- Posts: 5207
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Crash when using "entity-preview" gui element
Oh. Well. Then i was just confued by Klonans example code :P. Thanks for the hint.Rseding91 wrote:Assignment on creation isn't supported and never will be.