Page 1 of 1

Can I put something in the player's hand?

Posted: Mon Oct 09, 2017 1:18 pm
by quyxkh
`.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?

Posted: Mon Oct 09, 2017 1:28 pm
by Bilka

Re: Can I put something in the player's hand?

Posted: Mon Oct 09, 2017 2:01 pm
by quyxkh
lol thanks, missed that while the player.cursor_stack is readonly its contents aren't.