Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

On version 0.2.1, the mechanic for multiple-use items, like the "Large Tub Of Ice Cream" that says it has 3 uses in the item description, is not implemented yet.

Maybe it is plained to take into account side effects according to uses, but for now, a quick fix to enable this straightforward mechanic is to check "uses" property on the item dictionary on inventory ("current uses" consumed) and "uses" property on the item data definitions ("maximum uses") before deleting the item; incrementing "item uses" by 1 until it equals "maximum uses", then deleting the consumable item. Additionally, also to add the "(Uses left: X)" at the end of the "Used TYPE: NAME" notification, and show the "remaining uses" correctly in the item icon on the center-left HUD inventory (maximum - current = remaining). The HUD icon solution will only work for the "Large Tub Of Ice Cream" for now.

 

The following list show all the places affected by the bug, and the quick fixes I applied (all code line numbers based on original v0.2.1 unaltered files):

[code]

  File "game/init.rpy", lines 1649-1655, inside use_item:

        if item_type in ["potion", "food"]:

            max_uses = item_data.get("uses", 1)

            current_uses = item_dict.get("uses", 0) # Before used

            if max_uses > 1:

                item_dict["uses"] = current_uses +1

            if current_uses +1 >= max_uses:

                try:

                    persistent.player_inventory.pop(index_in_list)

                    renpy.restart_interaction()

                except IndexError:

                    notify(f"Error removing {item_name}!")

                    return

[/code]

 

[code]

  File "game/init.rpy", lines 1742-1744, inside use_item:

            if item_type in ["potion", "food"]:

                max_uses = item_data.get("uses", 1)

                current_uses = item_dict.get("uses", 1) # After used

                remaining_uses = max_uses - current_uses

                _message = f"Used {item_type.title()}: {item_name}"

                _message += f"{' (Uses left: ' + str(remaining_uses) + ')!' if current_uses < max_uses else '!'}"

                notify(_message)

            

            if item_type in ["unique", "map"]:

                notify(f"Used {item_type.title()}: {item_name}!")

                if item_type == "unique": renpy.restart_interaction()

[/code]

 

[code]

  File "game/screens.rpy", lines 3606-3607, inside the "# --- Inventory Section ---" fixed block of the hud screen:

                                if _item_id == "food_large_tub_ice_cream":

                                    add Transform(Text(f"{_item_data.get('uses', 3) - _item_dict.get('uses', 0)}x", style="unique_stack_text_style"), alpha=_alpha_for_column)

[/code]

;)