Action RPG Inventory System

Thanks. This works. :slight_smile:

I added my own character skeletal mesh/rig and now all the equipment no longer applies to the character the right way. I’m not really sure how to go about fixing this since I’ve always used sockets to attach things and this system doesnt do that. The rig I’m using is a slightly modified version of the ue4 rig.

EquipmentBroke.jpg

I think this is a problem caused by the joint orientation.

if your using a modified version of the unreal skeleton you will have export and re-rig all the equipment items to your skeleton your using, for the weapon just add a socket using the name mainhand.

I got it working for the most part. The helmets still dont fit but thats a proportion issue. The orientation of the bones was the issue.

6da2a2f43c39fb17c05fb8a759f15e900d43dec3.jpeg

@OverRated_AU I noticed you created a struct called WorldItemData which has a lot of the same data as InventoryItemData. Is there a reason you didn’t just add the extra data to the InventoryItemData struct?

Because i didn’t want to waste bandwidth sending data thats isn’t used, its a waste and you should always only send what is needed.

Makes sense. I forgot your game is multiplayer. Thanks for the quick reply. I just starting looking through this inventory to figure out how it works. There is a lot to figure out lol.

Its fairy simple and its logic is very clean so its good to learn off took me about a week to pickup, but i was also learning how blueprint worked as well at the same time, there are a lot of other assets out there that are very badly scripted i recommend this for beginners.

HI,

I am trying to do a simple delete of an item from my inventory… only it isn’t so simple. I can add an item no problem with trytoadditemtoinventory.
I made a new function from this one and tried setting the localitemamount to -1 but that didn’t work.

So then I tried this:

Can someone give me a clue?

Thanks,

Arthur

OK I found the issue.

I had my maxstacksize set to 10 and the number of items in my inventory set to 10. Findaddamouttostacks won’t add a negative 1 to the amount if those two numbers equal each other. I bumped up my maxstacksize to 100 and the problem went away.

Hopefully, someone will be able to save me some time.

Where is the code that draws the crosshair located?

It will be best to probably create a Find and Remove Amount from Stack function that returns true if it was successful. Then inside that new function it would be very similar logic as the Find and Add Amount to Stacks code but will return true if there was stacks and the amount removed.

In the HUD Class Event Graph.

Thanks! :slight_smile:

I’ve hit another speed bump though. I upgraded to 4.12.4 and my inventory slots disappeared from the Inventory widget. As I haven’t made any changes to the widgets in a very long time, I’m thinking that either the update broke something or the widget gremlin has returned.

Any suggestions?

The update didn’t break anything with the Action RPG Inventory System I have tested it in the original project and my own that are using it in 4.12.4.

If the Inventory Slots don’t show up in your backpack it’s because in your PlayerController init logic didn’t finish the client init code for the InventorySystem.
I would suggest taking a look at your init code and putting print strings on cast failed to see if your code is fully executing or if something is causing it to abort prematurely.

I’ve tracked the problem down to the CreateInventorySlots function in the IMC. The first for loop is not firing. I’m going to compare the function in my project (which is not updated to the latest version of ARPGIS) with one from a fresh project and see if I can find a broken link or other irregularity. A cursory examination of the function in my project did not reveal one.

Edit: SlotsPerRow is my culprit

Edit again: Even though I did not know the variable existed until I found it, I either set InventorySlotsPerRow to zero somehow or it just took it in its head to change :slight_smile:

Anyway, back on track and thanks for your help. :slight_smile:

Hi there,

I’ve been using item intelligence as a placeholder for the scale parameter on objects in the function randomizedroplocation. I figured I’d finally add a scale parameter as a float to the inventory item structure. I’ve done that and set the value. I copied the itemintelligence macro to itemscale. I can not get the scale back from this macro for some reason. If I use itemintelligence it works fine. the macros are just a break so I don’t get this but when I run debug nothing is coming back.

Anyone have any ideas?

Thanks,

Arthur

Hello Again,

I wanted to drop my objects a little further out from my FPS character and come to find out you can drop them off the map or inside the map doing that. Any tips on how to prevent that from happening?

Thanks,

ARthur

Hi,

One last question for today. I can I drop an item so it always ends up in front of my character. Right now it always drops outside of the field of view of the character.

Thanks,

ARthur

Hey Dude,

What version of the inventory are you using if its older than 1.5 then you mite have to connect up the wires that make the inventory item structure, which marco can’t you get the float from?

So, I’ve gotten the inventory connected through a socket server to my db and I can send and receive the inventory from the db.

My current problem is that I have not been able to figure out how to display the loaded inventory in the UI.

Though I originally had the socket and packet functions and variables in my playercontroller, I moved all of them to the IMC, but this produced no different result. My original intent was to leave the IMC as pristine as possible and add my own code in other places. I also tried to create a child class of the IMC and place my additions there, but that would not work as the IMC would need to call functions in the child class. (Edit: just realized that I can override the IMC functions in the childclass so that I can make my additions and everything should play nice. Once I get everthing working properly, I may back up and switch everything over.)

I have tried: RefreshInventorySlots, Server_RefreshInventorySlots, Client_LoadInventory (both in my PlayerController and in the IMC)

None of these worked because the InventoryUI variable returns None. The Inventory UI functions properly otherwise (at least in single player – I have introduced a multiplayer bug somewhere that I haven’t sought out yet.)

I do not call the load from db function until after the InitializePlayer function in the InventoryPlayerController is called, which should init the InventoryUI variable through the InitializeInventoryManagerUI function (which only sets the InventoryUI variable.)

I can pick up another item and swap it to another slot and cause the loaded items to appear when they are swapped to the new slot.

Does anyone have any suggestions?