Skip to content

Ring inventory#1814

Open
TrainWrack wants to merge 179 commits intoTombEngine:developfrom
TrainWrack:RingInventory
Open

Ring inventory#1814
TrainWrack wants to merge 179 commits intoTombEngine:developfrom
TrainWrack:RingInventory

Conversation

@TrainWrack
Copy link
Copy Markdown
Collaborator

@TrainWrack TrainWrack commented Nov 30, 2025

Checklist

Links to issue(s) this pull request concerns (if applicable)

#1289

Description of pull request

To use copy the RingInventory folder into your Engine/Scripts/Engine folder

local  RingInventory = require("Engine.RingInventory.Inventory")

Use provided wad for arrow sprites.
Sprites.zip

Requires
TombEngine/Tomb-Editor#1189

@TrainWrack TrainWrack added this to the Version 1.11 milestone Dec 14, 2025
@davidmarr
Copy link
Copy Markdown
Collaborator

I tested the inventory and it works properly! The bugs I reported have been fixed! But

  • There are no LDoc comments to document the module.

  • I think the file and module should be called RingInventory or something similar. CustomInventory is very generic, it might seem like anyone can create a custom inventory.

  • Perhaps it would be better to have a RingInventory.Enable() and RingInventory.Disable() function? And use a PRE_LOOP or POST_LOOP callback to simplify activation, without having to add code inside LevelFuncs.OnLoop(). This would also simplify creating the inventory nodes.

  • There should be a RingInventory.Settings(table) function to easily customize the inventory, or have separate RingInventory.SetSounds(table), RingInventory.SetColors(table), and RingInventory.SetBackground(table) functions. I thought this would simplify node creation.

  • Organize Lua files better: CustomMenu, InterpolateModule, and Statistics are only used by the inventory. I would move all inventory-related files into the CustomInventory folder (or a less generic name).

  • Several local variables are used. I think it would be better to use LevelVars, GameVars, and LevelFuncs wherever possible, especially in official modules.

@TrainWrack
Copy link
Copy Markdown
Collaborator Author

  • I need to add only the activation docs. And perhaps settings explanation.
  • Agreed on the name. The name can be changed.
  • Can be looked at.
  • Perhaps this can be looked at later.
  • These modules are deliberately kept outside cause the intention is for them to be standalone modules. They will be expanded later, Menu is for creating generic menus, interpolate is for interpolating data sets over time (could be a candidate for utilities module), Statistics will be expanded to allow end of level/game screens nodes.
  • The variables are kept local cause there is no need to save them to savegame. It helps reduce the savegame size.

@Lwmte
Copy link
Copy Markdown
Collaborator

Lwmte commented Dec 20, 2025

Local variables - I agree with TrainWreck, there is no need to keep stuff in LevelVars or GameVars if these variables are not affecting game state (e.g. last used item, last focused item, etc).

Module name - I guess the idea behind CustomInventory name comes from that lua inventory module does not have to specifically be ring inventory, you can modify it to have any shape. The question is whether someone else will eventually implement e.g. LAU inventory or reboot inventory, would these modules be stand-alone, or they would need to be drop-in replacements for ring inventory? If they can coexist with original ring inventory module, then naming it RingInventory makes more sense, otherwise if there will be always a singular custom inventory module, be it ring, LAU, reboot, resident evil, silent hill etc inventory, then CustomInventory makes more sense.

Module organization - I also agree with TrainWreck here, having separate modules is always better than having everything cluttered in one crazy big source file. We already have bad examples of that in TRLE universe. I suggest to split modules wherever possible, ideally we should have modules that can be reused by other custom inventory modules, and a core ring inventory module that will be standalone.

Documentation - I agree with David, we need comprehensive documentation for new inventory module, preferably with description of all customizable options or parameters. We shouldn't leave builders alone with raw code, and instead we need to provide at least basic support in form of the documentation and/or video tutorials. However I don't see it as a big problem, because ring inventory is the most requested and wanted feature, therefore we may expect people creating tutorials or video guides for it anyway, but at least basic documentation (enable/disable, inventory item customization such as position/scale/menu entries, disabling load/save/statistics etc) should be provided, so that builders may have some foundation to work with.

@Lwmte Lwmte mentioned this pull request Dec 24, 2025
13 tasks
@TrainWrack
Copy link
Copy Markdown
Collaborator Author

TrainWrack commented Apr 2, 2026

  • FoV is broken
  • Sometimes item does not return from selected position

@TrainWrack
Copy link
Copy Markdown
Collaborator Author

TrainWrack commented Apr 4, 2026

  • If you combine/separate lasersight with crossbow, it forgets the selected ammo and reset it to normal ammo. Its weird cause the inventory does save the selected ammo for other weapons when reopening.

  • If you use a waterskin, it becomes a full waterskin but when you go back into the inventory it starts from the statistics as the item has changed. I am not sure how to fix this without a hack.

  • Ghost rotation of first item when inventory is opened when item +1 or -1 item is selected in inventory and saved as last used item.

@TrainWrack
Copy link
Copy Markdown
Collaborator Author

TrainWrack commented Apr 6, 2026

  • add weapon mode to selected ammo text for HK

@Lwmte Lwmte added Ready to Test Lua Anything related to scripting labels Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Lua Anything related to scripting Ready to Test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ring inventory module issues

7 participants