Blank entity to extend with 4way sprite?
Blank entity to extend with 4way sprite?
Hi,
If I want an entity/prototype to extend that supports 4way sprites but doesn't have any special logic like an assembly machine, which entity would I use?
If I want an entity/prototype to extend that supports 4way sprites but doesn't have any special logic like an assembly machine, which entity would I use?
bubbels (sic)
Re: Blank entity to extend with 4way sprite?
Constant combinator.
Re: Blank entity to extend with 4way sprite?
That has a GUI already associated with it though?
Is the correct thing to do check player.selected every few ticks, close the default gui (if open) and open my custom gui?
Is the correct thing to do check player.selected every few ticks, close the default gui (if open) and open my custom gui?
bubbels (sic)
Re: Blank entity to extend with 4way sprite?
You can just listen to on_gui_opened:tubs wrote: Fri May 01, 2020 7:41 pm That has a GUI already associated with it though?
Is the correct thing to do check player.selected every few ticks, close the default gui (if open) and open my custom gui?
https://lua-api.factorio.com/latest/eve ... gui_opened
Re: Blank entity to extend with 4way sprite?
It's much simpler to set operable = false in created events than close guis.
My Mods: mods.factorio.com
Re: Blank entity to extend with 4way sprite?
Thanks Klonan!
Optera, if I set operable to false, can I still open my own gui when the player clicks on the entity?
Optera, if I set operable to false, can I still open my own gui when the player clicks on the entity?
bubbels (sic)
Re: Blank entity to extend with 4way sprite?
I didn't read the part about custom gui.
In that case, Klonans way of closing the base gui is easier. Otherwise you'd have to monitor every click.
In that case, Klonans way of closing the base gui is easier. Otherwise you'd have to monitor every click.
My Mods: mods.factorio.com
Re: Blank entity to extend with 4way sprite?
How do I get the gui that was opened? I can see it open on the screen but in the debugger I can't find it under player.guiKlonan wrote: Fri May 01, 2020 7:46 pmYou can just listen to on_gui_opened:tubs wrote: Fri May 01, 2020 7:41 pm That has a GUI already associated with it though?
Is the correct thing to do check player.selected every few ticks, close the default gui (if open) and open my custom gui?
https://lua-api.factorio.com/latest/eve ... gui_opened
bubbels (sic)
Re: Blank entity to extend with 4way sprite?
This seems to return the entity rather than the gui though (unless I am going completely mad...)
bubbels (sic)
Re: Blank entity to extend with 4way sprite?
Correct, you can't edit the constant combinator gui. All you know is that the gui for that entity is open.
Re: Blank entity to extend with 4way sprite?
Right, so this brings us all the way back to the start.
Is there an entity that supports 4way sprites that does not have a GUI (or at least, an empty one like an accumulator)?
I can do it with LuaRendering but that would, I assume, suck.
Is there an entity that supports 4way sprites that does not have a GUI (or at least, an empty one like an accumulator)?
I can do it with LuaRendering but that would, I assume, suck.
bubbels (sic)
Re: Blank entity to extend with 4way sprite?
No.tubs wrote: Sat May 02, 2020 7:14 pmIs there an entity that supports 4way sprites that does not have a GUI (or at least, an empty one like an accumulator)?
What you really want is:
Code: Select all
player.opened = nil