Ghost In Hand


When a last held item is placed (either by you or by your construction robots) normally your hand would be emptied forcing you to pick that item again. This mod changes this behaviour, so that when you run out of items, a held item is replaced with its ghost.

Utilities
3 years ago
0.17 - 1.1
9.39K

i add an exclusion list: let me declare an item should not be ghosted, or more limitedly, exclude something for me. :)

5 years ago
(updated 5 years ago)

one mod that I use, beltplanner, operates with an item that I place on the ground to set the start and end of the path, and then places ghosts along an automatically generated route. the item magically zaps in and out of my inventory during this process, since it is essentially a "planner" that can be placed in the 2.5D world.

Ghost in Hand is super-awesome for everything but this one item. Which is, TBH, because the items really odd, but still.... So, it'd be nice to have either the specific item blacklisted, or a mechanism to allow me to do that in the game.

To hopefully save you some lookup, the item is an "item-with-label" named "beltplanner", and the entity is a "simple-entity" named "beltplanner" :)

edit: probably no surprised, but adding that the code where the robots are excluded, by that specific name, works fine.

5 years ago
(updated 5 years ago)

The mechanism for the player to choose what items to apply this mod to is a bigger piece of work - requires some in-game UI, extra logic etc.

To resolve the problem for you, I think the easiest way is that you modify control.lua file yourself (I understand that you have done it arleady?). At line 19 there are some exclusions:

and player.cursor_stack.name ~= "construction-robot" and player.cursor_stack.name ~= "logistic-robot"

I am wondering whether excluding this item should be always the case. This would require testing what happens if that item doesn't exist (because the other mod is not installed).

To be honest, I have stopped playing Factorio, but if you or anyone else would like to improve, feel free to open a Pull Request in my Github repository ;)

5 years ago

Yup. That was the one. Should be perfectly safe -- the stack has a name, and the string is just a string.

I understand not playing any longer, and thanks for your work. I'll send a PR if I can. :)

4 years ago

An option to exclude (concrete) tiles would be nice as well.

Also there is a bug in factorio multiplayer related to tiles and GhostInHand:
https://forums.factorio.com/viewtopic.php?f=7&t=78552&p=468479#p468479
but that bug report is independent from my feature request.

New response