request_slot_count for LuaPlayer

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Honktown
Smart Inserter
Smart Inserter
Posts: 1045
Joined: Thu Oct 03, 2019 7:10 am
Contact:

request_slot_count for LuaPlayer

Post by Honktown »

It's not apparent from LuaPlayer that there is a way to get the last request slot, instead of guessing the last slot, or using the, I believe, undocumented limit of 1000 slots. Having it as a LuaControl for player and entity "would be nice".

It makes sense a character is required for request slots to mean anything. A long check would need there to be a player.character, but unless I am missing something, no character present could return 0 slots, and the people wanting to *set* slots already need to ensure there is something to set slots on. (I checked, it's an error, not false/nil, to set it without a target). It looks like another controller like editor doesn't enable request slots, so returning 0 for a character-less controller might not cause problems? If it does, then that would require the long method and no changes at present.

This is just a small thing I've come across a few times, wanting to know which requests slots of a player should be considered instead of 1000.
I have mods! I guess!
Link
User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 615
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

Re: request_slot_count for LuaPlayer

Post by raiguard »

LuaEntity::request_slot_count gives the highest requested slot for the entity, including characters.
Don't forget, you're here forever.
Post Reply

Return to “Modding interface requests”