Can I put something in the player's hand?

Place to get help with not working mods / modding interface.
quyxkh
Smart Inserter
Smart Inserter
Posts: 1032
Joined: Sun May 08, 2016 9:01 am
Contact:

Can I put something in the player's hand?

Post 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.
Bilka
Factorio Staff
Factorio Staff
Posts: 3470
Joined: Sat Aug 13, 2016 9:20 am
Contact:

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

Post by Bilka »

I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
quyxkh
Smart Inserter
Smart Inserter
Posts: 1032
Joined: Sun May 08, 2016 9:01 am
Contact:

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

Post by quyxkh »

lol thanks, missed that while the player.cursor_stack is readonly its contents aren't.
Post Reply

Return to “Modding help”