Utility mod that replaces single-use item behavior with bulk-use logic—ideal for stackable consumables.
-
Bulk-use system
Replaces single-use actions with a flexible bulk-use mechanic. -
Helper functions
Includes utility methods to simplify integration. -
Minimal boilerplate
Clean, modular design speeds up implementation. -
Non-intrusive
Does not modify core gameplay or existing save data.
Integrate the MenuHelper.show_stack_box method within the item's custom_use_menu. This will present a stack selection dialog and return the player's chosen quantity amount.
func custom_use_menu(_node, _context_kind: int, _context, arg = null):
...
# The selection range is defined by min_value (default: 1) and max_value (default: item_amount).
# The selected amount will be returned once the player confirms their choice.
var amount: int = yield(MenuHelper.show_stack_box(self, max_value, min_value), "completed")
# Return any provided arguments, including the amount selected for consumption.
return { "arg": arg, "amount": amount }Once the quantity is selected, consume the specified number of items by calling MenuHelper.consume_item in either the _use_in_world or _use_in_battle. The selected amount is passed as an argument.
func _use_in_world(_node, _context, arg):
...
# Consumes the specified amount of the item.
# A boolean flag controls whether a MessageDialog is displayed during the process.
return MenuHelper.consume_item(self, arg["amount"], false)- Mod ID:
mod_inventory_plus - Save File Tags:
none - Netplay Tags:
none
