Hi, I’m really loving this inventory but I ran in to a problem. If I package my project for Windows the player inventory doesn’t seem to load. I’ve also tried with a fresh JCInventory project but I still get the same issue. Am I missing something simple because I’m surprised no one else has mentioned this?
@Staggerlee - not sure if this is already known or addressed, but I found a small bug related to drag and drop - namely, it doesn’t preserve the offset into the item when you drag (e.g., if you click in the middle of the icon, it will slide until the cursor is over the top left corner). This makes it a bit harder to drag and drop organize items.
Also, quick question (not a bug), is there a way to make it so that when the items are just sitting in the inventory, it will have a transparent background so the grid squares show through? Right now it resizes the grid square to the size of the item’s image, which looks a bit weird.
Thanks man, and great pack.
@alienbyday Hey there, this issue was related to the 4.8 release with the HUD class being set up before the pawns begin play. To fix this issue you can put a timer on begin play on the HUD class of about 0.1, or for a more solid fix i recommend implementing the 4.8 Spawn pawn fix.
n00854180t, yes i intend to make the offset more accurate with 4.9, thanks for pointing that out. as for the resizing, do you mean so you can have images that say are not set up by the JcInventory ratio, but wont distort? That can be done pretty easy with a size box. Its probably not a bad thing to include in the next build, if your having problems with it ill make a screenshot. I would set it up the same way the equip slots & quick slots handle image re sizing.
's an example - the single square is stretched when there’s an item present. Bigger items have more stretching. I’d just like it to tile such that it looks like they’re sitting on top of the grid.
hey, its maybe very basic, but i can’t find out how to populate the jcinventory with specific inventory items at game start. any hint will be greatly appreciated. thanks a lot c.
@**n00854180t **, ah i understand! the easiest way to achieve this would be to make the backgrounds of the JcInventorySlot set to totally transparent. (change there alpha), then put in a gridded background on the actual JcPlayerInventoryWindow widget. Is that clear? Because each Slot has its own background that’s why the background stretches with the image. Is that clear?
I was hoping to avoid doing it that way since it wouldn’t handle add/remove slots correctly. Right now I have it so that it sets it transparent if there’s an item, so it just doesn’t have the grid squares at all when there’s an item. I think that will work okay for my purposes, though.
Thanks for your help
I never really took the time to revisit this as I wanted to do this when I first got the system. might be a more efficient way but I did it like this.
create a function called items to start with in your charBP
spawn each item you want them to start with and add it to an array of items (i only have one in my example but you’d repeat the same for each item then on the last connect it to the next part which is the loop.
then run a loop that adds each item in the array to the inventory and then delete the spawned actor
Add this function to your char begin play, or in after the event possess.
(ignore the attach to holster function. thats not needed for this functionlity)
Hi, i bought JCInventory a few hours ago and i have followed your tutorial on how to add the inventory to a custom pawn.
I ran into a problem when i add an item to the inventory by class. I can see the item in the inventory but i cannot move it, drop it, use it or equip it. However i can place it into a hotbar. Any idea what the problem might be?
**Eqric **Hmm, never heard that one before. This stuff is really hard for me to debug because as soon as you implement it into your own game logic you essentially have changed JcInventory and its very hard for me to know where and how without a lot of debug information. Can i have a few more details, does it create a Drag and drop operation (thus allowing you to move it to the quick bar) but simply vanish when you try and move it somewhere (including off the inventory) - do you have ANY other UMG widgets in your game? What is there collision?
I can see the icon moving and i hear the sound when i start to drag it and when i drop it somewhere.
The icon do not vanish when i drop it(in the inventory to a new slot, outside or anywhere else). It just simply goes back to its original place.
I have disabled all my UMG widgets.
If i right click on the icon, the menu will drop down with the options “Use,Drop,Cancel” but only the “cancel” option works. The other just play the sound and nothing happens.
If i hover the mouse over the icon i can see the description text pop up with the correct text.
@**n00854180t ** You can also set the BG Image inside the JcItemSlot tiling to ‘both’ and make sure your image size is the same size as your grid size as another alternative?
@Eqric The only thing i can think of is that your Interface is set up incorrectly on your pawn. Put some break points on your nodes inside the RPCGRAPH and check they are firing. The strange thing is that to snap back to its original place means that it is adding to the inventory through the RPCs. The way it is returned is when Return Payload is called on the drag and drop payload. it is called when the item is dropped somewhere out of bounds. Very very strange stuff.
Would you mind doing this for me,
- set a break point up inside JcUserInterface on the Event OnClicked(UseButton) on the function RPCUseItem and ensure no null values are going through to the function.
- set a break point up in your pawns RPC GRAPH (in the pawn you made, you would have done this if you followed tutorials) at the event UseAndItemRPC on the function Use An Item- check it for null values.
- Use a consumable item (by right clicking then selecting use item) and check for any null values.
hmm very strange things.
So far i have tried:
1. set a break point up inside JcUserInterface on the Event OnClicked(UseButton) on the function RPCUseItem and ensure no null values are going through to the function.
The result is that it is being called however when it reaches RPCUSE Item , it suddenly jumps to my “P” on the keyboard is pressed event… I did not press P. Then it jumps back to PLay Sound 2D.
2. set a break point up in your pawns RPC GRAPH (in the pawn you made, you would have done this if you followed tutorials) at the event UseAndItemRPC on the function Use An Item- check it for null values.
This one is not being called.
3. Use a consumable item (by right clicking then selecting use item) and check for any null values.
UseAnItemRPC is not being called
I will try to re-implement JCInventory one more time into my project.
Update:
I must have done something very wrong the last few times i tried to implement it following your youtube video…
This time i followed “Implement Custom Pawn | JcInventory Wikia | Fandom” and it does work now
This is super edge-casey and likely not even close to what you built this system to do, but my entire project is in C++, and what I’m really looking for is a slick UMG front-end capable of displaying and interacting with item data from my own custom classes and item databases- would it be reasonably straightforward for me to get that working, or is JCInventory built from the ground up with the assumption that users will design and curate content via blueprint and the editor?
does anyone know how to detect what item has been placed in a slot? for example i have a gun and put it in the slot and once its in there i spawn a skeletal mesh in the players hands?
set it as a variable.
make the variable “rep notify”
start your mesh switching logic from the repnotifty function that gets generated
I have been following your c++ survival tutorials very closely and I cannot figure out why i am not getting an item displayed in my inventory around 7 minutes into video #2.5
Everything seems to be set up exactly as you showed but when i interact with the rifle item, it is just removed from the world and not added to the player’s inventory.
Any ideas on how to debug this? I am not having any luck placing breakpoints to find out more information.
Sorry but could you explain a little more? im kinda new to all this
Nevermind got it sorted thank you
@**HInoue **Hey there, as i have said before its pretty impracticable with C++ as the Structs are blueprint structs for example. We are moving ourown project over to C++ and it means i am having to entirely redevelop JcInventory in C++ (total pain). im afraid there’s not much flexibility for blueprints communicating with C++, but for a better understanding of how they can relate have a look at the C++ Survival series.
@dodgethisunrealHey, would like to hear more infomation about what your breakpoints returned, did they all fire? Did the command RPCAddItemToInventory fire? did OnUsed trigger CPPOnUsed ?
Thanks.
That’s the thing I’ve tried lots of combinations of doing that, and it seems to be completely ignored, such that it simply draws the single square in the upper left (the actual slot the item is occupying) with blank in the rest of the background. For some reason the tiling just doesn’t seem to want to actually function.