I need to make a completely new inventory system at this rate.

Any advice for things I can improve? I imagine all of it.
image












1 Like

Tbh, looks like standard inv shenanigans. Neither they are pretty (but you tried hard to make it so!) or easy to work with.

Above, start using Set Members in Struct to cut down on the wires dramatically with larger structs:

These 2 do the same thing.


Stuff like this should be done by pulling data from a Data Table:

Or, at least, by exposing the struct / vars on the spawn node:


But inventories will always be complicated.

The point where I decided to give up on my current system was when testing out various weapons, I discovered that the ammo items that I used to reload had to perfectly match the ammo capacity of the gun… So if I had a box that held 31 rounds and my gun used 30, it would be an infinite ammo generator, and if it held 29 rounds, it wouldn’t register as a valid item… I tried to fix that problem, but after something like five hours of tinkering, I couldn’t find a solution, because for some reason that I can’t quite fathom, when I tried to subtract the spent ammo from the respective item in the inventory system it would either consume every single item of that type, or it just wouldn’t do anything.

So… what is this post about? If you need to vent, just carry on! I hear ya. I hate / love inventories, too.

That, and just generally asking for advice on how I might improve this system.

1 Like

Yeah, can’t advise without understand how it (doesn’t) works and what needs improving. And that’d take hours none of us have.

Yeah, plus I can’t really give a good description of how it works, I just kinda threw it together.

Move it to an empty project and post it here. :grimacing:

1 Like

Just threw it together!? An inventory? The absolute madman. I salute you sir, :saluting_face:

Is there a reason that you keep your inventory inside a HUD as a some sort of object reference array? Can’t you just keep it inside game instance as a struct array?

1 Like

(Sorry for the late reply), I’m a girl lmao.

(Sorry for the late reply), Because I have absolutely no idea what any of that means lmao. I just followed this video, and then the rest I made up on the fly with what little I already knew: https://www.youtube.com/watch?v=TcTxSyk8Vks

Uh.
I don’t want to be rude to this guy. I don’t think I’m a good programmer. But even for me this tutorial is “meh”.

1 Like

Interesting, well it was the first one I found so I assumed it would be good… Do you have any suggestions for better ones?

Most of the people prefer to use Actor Component, but I prefer to use Game Instance to keep my Inventory.

I’ve made a tutorial for a super simple inventory system, you can read it to get the ropes. And a bit more complex inventory is in the working.

1 Like