Since a large part of the recent FFFs are about previews showing accurately, I have a question.
Is there anything you can do about the placement preview of inserters, where in my mod the script modifies the pickup and drop locations of the hands immediately after placement?
Currently, I know of no way to do anything about the pickup and drop positions (Short of creating an entity for every possibility) until after the entity has been placed, therefore the item in hand always shows the default positions. This is confusing if you're holding a standard inserter that will change to a longhand inserter when placed. (or worse, 90 degree inserter, diagonal inserter, shuffle inserter etc. basically anything but the default configuration)
if it would be possible to detect that the player is holding an inserter in his hand and allow me to specify pickup and drop locations to the curser stack, rather than waiting for the item to be placed before I update, this would help. (Even if I still have to update the inserter after placement)
Inserter placement preview
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: Inserter placement preview
Have any developers looked at this yet?
any response would be appreciated, even if it's to tell me it's not going to happen.
any response would be appreciated, even if it's to tell me it's not going to happen.
Re: Inserter placement preview
I‘m strongly supporting this request 

Re: Inserter placement preview
I've been thinking about it but there's no simple way to do what you've asked for.
Rendering happens in multiple threads outside the normal game loop and is not allowed to change the game state in any way. If it had to do a Lua call every time an inserter was rendered there would be so many complications and performance problems.
Rendering happens in multiple threads outside the normal game loop and is not allowed to change the game state in any way. If it had to do a Lua call every time an inserter was rendered there would be so many complications and performance problems.
If you want to get ahold of me I'm almost always on Discord.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Inserter placement preview
That's bad news. I was really hoping that some time in the far future we might eventually get a method to customize the contruction-preview. Personally i'd only want to have arbitrary overlays (circular range, square range, etc) but inserter preview would have been even more awesome.Rseding91 wrote:I've been thinking about it but there's no simple way to do what you've asked for.
Rendering happens in multiple threads outside the normal game loop and is not allowed to change the game state in any way. If it had to do a Lua call every time an inserter was rendered there would be so many complications and performance problems.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: Inserter placement preview
The main concern is that mods can't change the game state when rendering. Trusting them to do that would mean you have zero access to the normal lua information and it would have to be run in some different context. It would be slow and error prone without providing much utility.eradicator wrote:That's bad news. I was really hoping that some time in the far future we might eventually get a method to customize the contruction-preview. Personally i'd only want to have arbitrary overlays (circular range, square range, etc) but inserter preview would have been even more awesome.Rseding91 wrote:I've been thinking about it but there's no simple way to do what you've asked for.
Rendering happens in multiple threads outside the normal game loop and is not allowed to change the game state in any way. If it had to do a Lua call every time an inserter was rendered there would be so many complications and performance problems.
Simple things like "draw a radius around the player until I say stop" is easy - if you had a better idea how it would work and why you wanted it I might look into doing that. In a different post though.
If you want to get ahold of me I'm almost always on Discord.
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: Inserter placement preview
A thought...
could you add extra (otherwise useless) data to the item stack (Item itself, or entity itself wouldn't be a viable place, as those would be global) tags for pickup_position and drop_position?
The tags wouldn't need to just be for the preview image, they could be used by the actual entity once placed too.
I mean, from how I understand it, there is just one ghost entity, and special properties that are usually on a per entity type basis can be applied to it, so it wouldn't be the first time you add in a work around for special cases.
oh wait, that's still a LUA call...
could you add extra (otherwise useless) data to the item stack (Item itself, or entity itself wouldn't be a viable place, as those would be global) tags for pickup_position and drop_position?
The tags wouldn't need to just be for the preview image, they could be used by the actual entity once placed too.
I mean, from how I understand it, there is just one ghost entity, and special properties that are usually on a per entity type basis can be applied to it, so it wouldn't be the first time you add in a work around for special cases.
oh wait, that's still a LUA call...
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: Inserter placement preview
A question though... would it need to Lua call every frame?
It could do a Lua call on initial load, then it SHOULD only need to do another lua call on certain GUI click and button press events.
Also... how detrimental could it be to do a lua call on player hover ghost anyway?
If you haven't already, play around with the bob's pre-place inserter menu in bob logistics, and you'll see what I mean, and we I want this. (I really need to move it out to the bob's inserters GUI mod with everything else)
It could do a Lua call on initial load, then it SHOULD only need to do another lua call on certain GUI click and button press events.
Also... how detrimental could it be to do a lua call on player hover ghost anyway?
If you haven't already, play around with the bob's pre-place inserter menu in bob logistics, and you'll see what I mean, and we I want this. (I really need to move it out to the bob's inserters GUI mod with everything else)