First, you can get it here:
And it will work with 4.6 version. As the plugin is not finished yet, it will always work with newest version of engine available (including preview builds). Once I get it to the state it’s done, I will branch it to match current engine version, but new features in case there will be ones, won’t be backported to older versions.
If you want try it out you can also download presetup version here:
It should work against binary launcher build. It will work 100% against latest 4.6 source.
I recommend using git and cloning it directly.
You will also need some content. If you have existing project, with starter content, you can copy everything except blueprints.
Also you will need to export SampleTags to csv file, and reimport it again. Since it’s not automatically loaded upon engine start, and it will prevent inventory from working properly.
Tested on 4.6 from github. It will NOT work on older releases. And I will NOT make it work on older releases.
What is different about my plugin, from any other inventory system that lays around forums ?
Despite name, it’s not really inventory. Using this plugin, you can create action bars, character dolls (well this one, I’m not sure exactly, but it’s something I want plugin to be able to handle) and of course inventories (;. Essentially anything, which need to contain some data and interact with it can be implemented using this plugin as base.
The base of working are Tabs. You can think of tab as single bag or action bar. You can have multiple tabs, and each tab can have multiple slots to store items. Each slot can store single item.
The next part is class GISItemData, it’s base object type, which is used to store data in inventory. If you want to store your custom data, you need to create new class derived from this object, and define custom properties, you want to store.
Then there GISInventoryBaseComponent, which is base component class to allow any actor, to make use of inventory. Probabaly best place to add is PlayerController.
You can have multiple inventory components on your actor. And you can drag items between components. This is currently working on base level, but it’s not yet finished.
At last there are custom C++ widget classes. They implement basic interactions on client side. They do not display anything. If you want to display your inventory, you need to create your own widgets, which will derive, from these base widget classes. How you display your data is entirely up to you. You can create grid/bag based inventory or full screen list. Sample on github provide simple inventory as grid, which locked to top left corner screen.
GISContainerBaseWidget - base widget which contain inventory widgets. You can think of it as place where tabs will be added. Though of course this class does not specific how they will be displayed. It also takes care of client side interactions, like swapping item positions.
GISTabBaseWidget - base widget, for tabs. It’s not terribly complicated it have two properties ;).
GISSlotBaseWidget - base widget for slots. Slots contain item widgets, and some info about item.
GISItemBaseWidget - widget which will actually display info about our item, like icons, description etc. It’s also used as drag&drop payload, but unless you are planning to modify sources, you don’t need to care about it.
Networking. Replication of inventory objects is set up. I have not tested how well it works though. But replication is critical part of this plugin and I will make sure it will work ;).
Plugin does not support any kind of saving data anywhere. It’s way to game specific, how and where you want to store your data.
Not yet implemented features:
- Picking up items from ground. I do not know yet, how to make in manner which can be easily extended and fits nicely into generic nature of plugin.
- There is no dropping items to ground from inventory. It just wasn’t important enough to tackle it yet (;.
- Inventory only accept items of certain class. Not yet done, but very important!
- Accepting items only from specified inventory component. Don’t know how to tackle it. But I want to add it.
- Adding new tabs at runtime. (adding slots is out of question for now).
- There is no way to get information about item. Like Icon, Description, etc. Since GISItemData doesn’t have appropriate functions to override yet. It’s absolutely going to be done. Though, because it’s fairly generic don’t expect anything specific.
There probabaly won’t be much beyond
and Possibly GetType() as FName, FString, or maybe something else.
Things that will change for sure:
- How you add items now is not safe in client-server environment. It will change. I just left it like that, because it’s easier to test this way.
For now best way to handle this plugin is to add new things trough C++, except display logic. You can do it just as easily with UMG.
Component configuration. Drop Slot Name is slot to which Item Widgets will be droped. Currently it must be Overlay slot, added to widget derived from GISSlotBaseWidget. The name must match exactly the name of slot in your widget blueprint. Also slot should be exposed as variable.
Here is sample setup I use to debug widget
Actual inventory displayed. Single tab with 30 slots.Sorry for no art at all, but it wasn’t really important to me at this point (;.