Dynamic Inventory GUI

#1

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!

0 Likes

#2

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

#3

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

1 Like

#4

How did I miss this?! :sweat_smile:

2 Likes

#5

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

4 Likes

#6

Basically re-created that function…

8 Likes