I'm thinking it should be possible, probably using metatables, to expand the item_1 and item_2 commands and include item_3 and even item_4, for when more items are needed. But I'm wondering, does modifying the metatable of existing functions expand them or overwrite them? For example, would the code below work? If not, I could create a custom function similar to each of the built-in ones for each of the item slot functions.
local game_metatable = sol.main.get_metatable("game")
function game_metatable:get_item_assigned(slot)
if slot == 2 then
return game:get_value("slot_2_item")
elseif slot == 3 then
return game:get_value("slot_3_item")
end
end
I'm also not 100% sure how the button mapping part would work. Is game:get/set_command_keyboard_binding() expandable or configurable?
Just brainstorming and wanted others' thoughts...