Dynamic Inventory GUI

Hey, I’ve already asked a question about how I should make my Inventory system. Thanks to the guys there I managed to make a nice Inventory system which includes picking up/throwing away items.
However, now comes the step in which I make the inventory manageable via the GUI.

The problem I’ve ran into is that I want to make every item in the inventory individually selectable and manageable, a lot like you can do it with the factory component. But since I’m working with a single gui script, I still, after quite some researching and testing out (I worked around with cloning nodes), cannot achieve to make a manageable inventory in which there could potentially be an infinte amount of items.

Think about the Skyrim inventory GUI: every individual item selectable, all items can be found on screen by scrolling, the inventory can theoretically hold an infinte amount of items.
Anyone who can give me a hint on how to do it properly? Thanks in advance!

Ok, so doing picking (ie clicking on a GUI node) is done using gui.pick_node(). For an inventory with an unknown number of items you need to create GUI nodes to represent your items at runtime. You can either use gui.new_boxnode() to create nodes or use gui.clone_tree() to copy an existing template node.

2 Likes

This example could potentially be of use as well: https://github.com/britzl/publicexamples/tree/master/examples/dynamic_buttons

1 Like

How did I miss this?! :sweat_smile:

2 Likes

Really? What have you done so far in Fates of Ort!?

4 Likes

Basically re-created that function…

9 Likes