Download

Action RPG Inventory System

I’m at a bit of a crossroads here. Whilst trying to utilize the inventory system, I ran into a snag. Note that in my controller, if i enable the Play Game logic as shown, the character drops into the world and all is well… then it displays my login screen and character selection (which is bad). This means the systems work and don’t break anything. Ruling out any issues with the UI elements that are being fired. All that’s happening from a gameplay standpoint is grabbing the character from the db and setting it as a struc in the playercharacter.

But if I disconnect Play Game (which fires after the character selection phase after CLT_DisplayLogin), this delays the initialization of the inventory system until after a character is selected. There’s no other magic happening, just a bunch of UI mumbo-jumbo beforehand. It gives the following errors, which indicate that the server is not initializing properly and setting references to both the playerinventory and that characterreference.

This baffles me, because if I fire it manually tied to event beginplay, it works fine. However, if I let the UI make the call later, the errors come up and inventory doesn’t work. The only thing that’s non-standard is that I’m not calling the hud into the viewport until initialization of the inventory system.

It’s pretty simple, but has me stumped, it’s almost like I’m waiting too long to initialize the inventory and something’s happening through replication or delayed and I can’t for the life of me find it.

I initially thought that I was re-writing a variable at some point, but narrowed it down to timing. Play Game fires off your initialization like in the marketplace project. If called manually up-front, we’re fine but the entire login/character creation/selection happens after entering the world, which won’t do.

The ONLY difference is removing the connection from Play-Game in the playercharacter below.

I have tried absolutely everything I can think of, even removing pieces down to just firing a login widget then calling playgame and it still fails without any of the login logic happening.

I know this may be silly or simple, but I’ve spent a couple days debugging this and following variables to try to find out where the breaking point is, ruling out the entire entry UI system. The only way that I can get it to work is if I initialize the inventory and drop the character into the world immediately, anything else results in referencing bad variables.

As a side-note, I have a thorough knowledge of the inventory system and have dug into it pretty deep in the last few weeks. In the screenshots below, it works (wrong, but it works). In a perfect world, the playgame function would not be called from the playercharacter, this is a work-around to make it work until I find a good fix.

Player Controller:
985b38e76c4937f9bff88e4cd94d255fc18b0bb0.png
https://forums.unrealengine.com/core/image/gif;base64

​Player Character:
76c5c0ca206be8da009eef108ce97d82bca1eabe.png
https://forums.unrealengine.com/core/image/gif;base64

This is the call from My UI to the PlayGame logic:
7e7851655ac85a0335cc55557caead46865066fe.png
https://forums.unrealengine.com/core/image/gif;base64

Errors:
9f986fe5cfa0978de4b583425934203fb46018f6.png

Update: Found out that a second player borks it also.

Background: I have a login, server selection, character creation and world.
During initial testing, I had two servers and one client, separate projects, they have been consolidated for ease.
I have a dedicated server build as well as client build.
I moved the sql into a savefile, since resetting it was easier than wiping sql each iteration. (so basically everything’s really simple presently)
So the flow currently is:

  1. Client connects to the server (fake loading level fired event)
  2. Server displays login (widget mumbo-jumbo, sets account variable in playercharacter)
  3. Then character creation/selection (widget mumbo-jumbo, sets my characters array and current character variable in playercharacter)
  4. Then Play Game (inventory initialization happens here) -> multicasts current character to all other players actor renders (updates nameplate and cosmetics)
  5. Streams the starting zone level to the player and teleports them to the correct spot (or last saved coordinates).

If play game fires before the login screen (and transfers execution to it), it works. (what this means is that the game starts and the login screen displays with a blank character) Once the character is created/chosen, it updates the character in-game).

If play game fires normally, login and character selection takes place, then when you drop into the game, inventory doesn’t work.

Either way, when a secondary player joins, inventory fails as soon as it initializes (before or after login).

I hope that makes sense.

Has anyone had any success with trying to change out the player controller responsibility to a player state or character? Been working on this for about a week now (been too timid to until now lol)

I’ve nearly got it but I’m not generating an inventory. I’m wondering if a player state is not able to do this

Update: I’ve managed to get the inventory grid to generate from the player state instead of the controller. The controller just calls the UI elements now. Throwing some errors trying to generate the equipment inventory (player inventory) from the player state though. For some reason it is not a huge fan of the idea. Going to do some more tinkering

this project does not have a save system

Scyclone, unsure if you’ve fixed your issue yet, but the most effective method to fix this problem would be to export your custom weapon mesh to a 3rd party program
such as Blender and manually adjust the rotation of the skeletal mesh and then reimport. Hope this helps :slight_smile:

Maybe this would help. Tutorial - Action RPG Inventory System - Weapon Import/Export - YouTube

Why would you even what to move the inventory from the controller ?

That is a simple fix check the tooltip widget.

Hello! First of all, thank you so much for this inventory system. I managed to migrate it into my project and am nearly there with full integration. I’m just having a few issues with the cursor and object interaction.

My project is a 3d side scroller. I’m not using my own playercontroller, just the InventoryPlayerController. I’ve got to the point where I can open up the inventory, but I cannot interact with anything in my bag or character. Right clicking makes the cursor disappear and become immovable. I also cannot interact with any object set in the world. Any ideas on why my cursor will not interact with anything?

I’m still learning a lot, but any advice would be greatly appreciated. Thanks.

Side note, I’ve disabled some of the third person functionality, and character keyboard movement in the InventoryPlayerController since I will not be using it at all.

Try full screen. Also if you have any other widgets (non ARPGIS) try temporarily disabling them see if it helps. and make sure the line trace for objects trace channel in the player controller is set to block that channel in the objects collision settings.

Ah thank you! This fixed the problem with the HUD, now I can interact with objects in the inventory now. Awesome!

Although I still can’t seem to click on anything in the world. I can’t use any of the useable or world objects. I was unable to find anything relating to ‘trace’ in the objects collision settings. Since I’m in a 3d sidescroller setting, I’m wondering if the camera is throwing the cursor off? I can’t even get an outline over usable objects when my cursor hovers over them.

In the player controller go to “Get usable actor” function. Make sure trace channel is set to visible (or if you have a custom one), Can also set debug type to duration or persistent to make sure it is shooting trace ( and check your camera )

Then on world item, click on it, in the details pane, click on static mesh and check the collision, make sure that channel from the lane trace is blocked.

Oh my dude right on thank you. That led me right to the issue! Now I can interact with objects. Thank you soooo much.

hello, i hope everyone is fine and doing well.

can anyone help me with changing the camera back to ue4 default where the camera moves along with the mouse (the third person default template)

in the action rpg, we have to hold the right mouse button down.

i have tried deleting the branch node to check if the rmb is held down but all it does is make the camera movable when i hold down other mouse buttons.

i checked other parts of the code and found that there is also a third person/first person view swap. (this is something that is confusing. there is no point making this replicated as it should not matter to the server if the player is in first or third person mode? )

anyway i tried disabling all of these but i still have to hold a mouse button down to move the camera. can anyone please help?

thanks!

If I remember correctly in the player controller, begin play, there is a setup or initialize function. In there change the game mode and ui to game mode only and uncheck show mouse cursor.

The issue you will run into however is whenever you hit I or any other windows, you will not have mouse control so make a function to toggle between game mode and ui and game mode only and show mouse cursor.

Thanks.

i found a video showing how to change it at post 92
it’s not perfect since several things has changed but i think i can make it work for now

Is there no discord channel for easier communication?

So to start, ive followed the migrating video (It was missing the part of setting up the tooltip info tho :P, luckily i noticed tooltip stats were missing and just looked at the base project and copied that single thing over). I had some issues at first because once i got everything copied over and moved into my own folder, i force deleted the extra files that were not needed (The mann stuff, the Inventory Controller) and it lead to breaking my tooltips. Also couldnt figure out how to get my dead AI to be lootable even after copying much of the NPC example stuff over into my AI parent. Eventually i decided to go back to a revision before i deleted the inventory folder from my project and the issues had started. Once i was back to that i had a bunch of issues with my project cause it didnt like that i deleted the entire thing and redownloaded it but i got it working again haha.

Now here’s where im at, im going to begin the work again soon here and see what happens when i mess with the extra files that arent supposed to be needed anymore.
One question i do have is does anybody know how to make it so i have both the E to interact AND the mouse hover over acts the same where it highlights + right click will loot as well. Obviously for right click i can add that to make it act just like E so you can use either one, but how would i go about making it so mousing over a lootable item would highlight it? I’m going to try to dig into it when i get to work here in a bit but just asking in case i get a reply before i get to work. Thanks in advance!

ok im really confused. I duplicated the ‘Loot_Skeleton’ and did an over-ride for his function ‘GetLootList’. I changed the loot list to be a custom one i have with nothing but the food that already exist with this system. What im having a hard time understanding is the min loot / max loot / inventory size.
I thought okay min loot = the minimum amount of loot that can drop. Max = max amount that can drop. Inventory size = ??? no idea. So i then changed the max quantity in the loot table to be 50 for 2 of the foods but it never drops past an amount of 5.

My values are:
Min Loot Items: 1
Max Loot Items: 10
Inventory Size: 100

i tried different values but either run into infinite loop errors or it works but nothing much changes. I wish there was an actual documentation on this :frowning:

EDIT: Oh i see the master items list has a max stack size value :open_mouth:
I’m assuming inventory size is used for stashing limit for player stashing.

Ya if you look at the pot example i think that is where their inventory size comes into play.

I think this is it. but there is pretty much zero creator support anymore. someone should make a discord for this for users. I ended up creating my own system from scratch, so haven’t played with this in awhile.

Thats not good :frowning: To hear there isnt much creator support, thats incredibly unfortunate. The whole silver lining of why i purchased this was because it would have support unlike the abysmal month to 2 long wait to get replies from the creator of mmokit -_-
Well, atleast there is everyone here that can give guidance, hopefully haha.

Ok so on a side note, does anybody know why if you move the spawned object (Loot_Skeleton) or in my case a copied version (Loot_Chest) after it has spawned (physics), it breaks the ability to loot it?
Additionally, i changed the mesh into a gold bar thats fairly small and even when i have it highlight it will not open its loot -.- Why is this so broken. Its supposed to easy lol.
I’ve been at this for 4 hours and its just not working consistently. I dont understand why its not working 100% with a different mesh set. The white outline works perfect but looting does not.

EDIT: After working on this (testing back and forth) for too many hours, ive figured out its my invisible dead NPC’s that are causing it. So with mmokit the respawn system is set so when you kill an NPC it changes it into invisible but its still techniquely in that same spot, but invisible and doesnt dissapear until it hits its respawn timer. This was blocking parts of the item im trying to loot which is why half the time it would work and half the time it wouldnt. I changed my respawn timer to be half a second after its death and now i can loot no problems. Now i guess i have to figure out how to change it so when its set to invisible it also sets some other collision property into ignore maybe.
Still not sure whats up with the physics tho. If i set a mesh to have physics and i push it around somewhere else, it loses its loot-ability but still highlights white.
EDIT2: Took me an extra couple hours but i was able to figure out the collision/object responses. I set my ‘Loot_Bag’ to block everything minus Pawn. I then changed the collision trace it does over in the player controller in the function ‘Get Usable Actor’ from Visibility to ‘Camera’ and now i have it roughly working how i want. I really want physics in so if its a flying npc it would drop its loot chest/bag down onto the ground but for whatever reason this breaks the loot completely :frowning: Any thoughts??

EDIT3: Okay so since i had finally managed to get some stable settings i had retried the dropping loot from up high and noticed that as long as the rotation and location doesnt go too far off, it’ll stay loot-able. I was able to set my ‘Loot_Chest’ collisions to Ignore on the WorldDynamic (So it doesnt collide with other chests) and Pawn (So player doesnt collide with it, including AI). I then re-enabled Simulate Physics where i set the massInKg to 250 and the Lock position X and Y enabled. Z was left off and all the lock rotations left off, this way the boxes can atleast tilt/fall away from static object in the world like a tree or clothes lines in my village (rather than the chest landing on top of the clothes line and looking totally unrealistic). I then set it so when the loot chest is spawned it does a +500 to Z so it spawns higher up in the air from the AI’s location so i could test if i could still loot everything once it landed. I could indeed with a good 98% success rate where the other 2% is just where i would have to try different spots on the chest before it would open up the loot.

I still cant set the loot so its not locked to its position tho, that’ll break the loot 100% every time when it gets moved around too much in any direction.