Creating an Item with selectable place_results
Posted: Sat Mar 25, 2017 1:51 pm
Hi,
i just started creating my first mod but now i kinda stuck at some basic stuff i cannot figure out.
i want to have an item where the user can select which entity it places by cycling through a list of entities. this should be done while the user has the item stack in its hand with a keyboard press (kinda what rotating does).
soooo i figured that there is no way that an ItemPrototype can have multiple place_results or that the place_result can be changed during control.lua.
i tried to do it some hacky way by creating multiple (hidden) item prototypes from the (craftable) base item for each placeable entity and changing the players item stack when pressing the keyboard key. This works in a way, but creates a multitude of problems, for example when the player places this stack back into its inventory or in a container i would need to change the item stack back to the base item prototype.
i am getting to the point where i need to work around the problems of a workaround and my (very basic) lua skills are running thin.
is there actually no way to accomplish this in a handy way?
thanks!
i just started creating my first mod but now i kinda stuck at some basic stuff i cannot figure out.
i want to have an item where the user can select which entity it places by cycling through a list of entities. this should be done while the user has the item stack in its hand with a keyboard press (kinda what rotating does).
soooo i figured that there is no way that an ItemPrototype can have multiple place_results or that the place_result can be changed during control.lua.
i tried to do it some hacky way by creating multiple (hidden) item prototypes from the (craftable) base item for each placeable entity and changing the players item stack when pressing the keyboard key. This works in a way, but creates a multitude of problems, for example when the player places this stack back into its inventory or in a container i would need to change the item stack back to the base item prototype.
i am getting to the point where i need to work around the problems of a workaround and my (very basic) lua skills are running thin.
is there actually no way to accomplish this in a handy way?
thanks!