Make non-Lua shortcut state readable.

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

Make non-Lua shortcut state readable.

Post by Honktown »

There exists what feels like a rather arbitrary limitation, that one can't read "non-Lua" shortcuts toggle state. I'm specifically trying to read the toggle-personal-roboport shortcut, so a player can know if it were accidentally toggled.

Code: Select all

Only custom shortcut prototypes with the action type "lua" can be used. For all others there are specific functions/properties.
I can understand when setting is forbidden, perhaps because of whatever logic not expecting a change this way, but READING? It's a true/false value, perhaps "non-readable" (is_shortcut_available) if the controller is one that doesn't use it (e.g. editor), or if it's just not available (pre-unlock).
I have mods! I guess!
Link
Honktown
Smart Inserter
Smart Inserter
Posts: 1063
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Re: Make non-Lua shortcut state readable.

Post by Honktown »

Silari wrote: Sun Dec 07, 2025 11:20 pm Can't you just read that from the player's LUAEntity?

allow_dispatching_robots
The character doesn't exist, at least can't be retrieved when, the player is in a vehicle. I haven't checked if the LuaEntity is still valid when the player is in a vehicle, if one had it already. It'd be a little wonky logic to make it work, because if the character is no longer associated with the player, the controllers, .vehicle, etc would need to be consistent (detaching the character would leave the character valid, and the player without one).
I have mods! I guess!
Link
Post Reply

Return to “Modding interface requests”