Can I put something in the player's hand?
Can I put something in the player's hand?
`.cursor_stack` is read-only, I can `clear_cursor()` it, but there's no inventory type listed for it and I don't see how to set it otherwise. I want to put a selection tool in the player's hand in response to a custom input (and then destroy it when it's z'd or q'd). Right now I'm just hijacking the decon planner and printing instructions to the chat console to pick one up and use that, the filtering looks very handy anyway so I'm toying with the idea of subclassing it and continuing with the current `if selection_pending[e.player_index] then e.entity.cancel_deconstruction(game.players[e.player_index].force)` stunt, but that's another topic.
Re: Can I put something in the player's hand?
player.cursor_stack.set_stack
(http://lua-api.factorio.com/latest/LuaC ... rsor_stack -> http://lua-api.factorio.com/latest/LuaI ... .set_stack)
(http://lua-api.factorio.com/latest/LuaC ... rsor_stack -> http://lua-api.factorio.com/latest/LuaI ... .set_stack)
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Re: Can I put something in the player's hand?
lol thanks, missed that while the player.cursor_stack is readonly its contents aren't.Bilka wrote:player.cursor_stack.set_stack
(http://lua-api.factorio.com/latest/LuaC ... rsor_stack -> http://lua-api.factorio.com/latest/LuaI ... .set_stack)