[solved] Setting player cursor stack?

Place to get help with not working mods / modding interface.
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

[solved] Setting player cursor stack?

Post by aubergine18 »

Is it possible to set the player cursor stack? I can see how to clear it with LuaPlayer.clean_cursor(), but the LuaPlayer.cursor_stack property is read-only (according to docs) so.... how do I set a cursor stack? Also the LuaPlayer.character.stack property is also read-only (not sure if that's a different type of stack though).
Last edited by aubergine18 on Sat Oct 08, 2016 1:49 am, edited 1 time in total.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15997
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Setting player cursor stack?

Post by Rseding91 »

The return type is LuaItemStack which has methods to set the stack/count/durability and so on.
If you want to get ahold of me I'm almost always on Discord.
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: Setting player cursor stack?

Post by aubergine18 »

Ah, awesome! Thank you !! :D
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Post Reply

Return to “Modding help”