UE4 C++ Inventory UI : Show Items

  Рет қаралды 11,658

Jayanam

Jayanam

Күн бұрын

Пікірлер: 24
@icyboyy6177
@icyboyy6177 7 жыл бұрын
Your doing very good videos Jay AnAm :) Pls don't Stop
@JayAnAm
@JayAnAm 7 жыл бұрын
Thank you, and no, I won't!
@MrMivex
@MrMivex 4 жыл бұрын
So yeah I have an issue i have done everything but my inventory is not update when I pick up the item. I have set a debug at the moment i touch my item i receive a message. I have a debug at the moment i add it in my c++ array and i loop and print it and everything is fine. I also enter in the function that do the broadcast thing all good too. I have set a picture to my item. The only issue is when i walk on my item i don't see the picture in my inventory i have the same inventory blueprint. Help !
@MrMivex
@MrMivex 4 жыл бұрын
Great I found my issue i had a missing link in the inventory blueprint between the foreachloop and the set node. !
@MrMivex
@MrMivex 4 жыл бұрын
Still having an issue that sometime the items are disapearing from my inventory and the engine crash any idea ?
@vertigo6982
@vertigo6982 7 жыл бұрын
2:50 So Pointers and References confuse me on when you would use one over the other. Can someone explain to me why this is has to be a pointer and not a reference? I understand pointers make copies and point to an address in memory, and that a reference points to the actual object, but I have a hard time figuring out when you would have to have a copy and not the actual object, or instead of using a pointer/reference how come it cant just be a regular variable like 'UTexture2D Image;' which I may be mistaken means it'll be passed by value. I understand that also using a pointer makes a copy, and thus adds more to the brewing pot so people like to not use pointers when possible to keep the program as small and efficient as possible. I also understand that Pointers allow you to change the object in a safe way that you're changing a copy of the original object and that changing a reference will change the actual object... So here its a Pointer to an Image file for Inventory. It makes a copy of the original image thats in file "Image" and prints that to screen. So is it a Pointer, because that image would be used multiple times and not just once so copies would be needed? Also, if it was only being used once, then could we get away with making the Image file a Reference or pass it by value?
@JayAnAm
@JayAnAm 7 жыл бұрын
Hi, are you familiar with the concepts stacks and heap? Please have a look at this and understand where objects are stored when created with new. Also read some documentation about refrences in C++ and copy constructors (why and when are objects copied).
@rtk3738
@rtk3738 7 жыл бұрын
First of all, pointers don't create copies, they just hold an objects memory address. In typical C++, you would a reference over a pointer almost always. They pretty much do the same thing, references pass a reference to the object and pointers pass a reference to the objects memory address. Hope that clears up your question.
@smachgaming439
@smachgaming439 4 жыл бұрын
how do you connect the const pickup variable with the set pickup
@JayAnAm
@JayAnAm 4 жыл бұрын
A broadcast is called with the list of items 07:43 . The broadcast fires an event in the blueprint.
@FluffyTheGryphon
@FluffyTheGryphon 6 жыл бұрын
I was following all these inventory tutorials up until 7:20 point of this video where you're commenting out code that isn't covered under the tutorial. What is '_inventory'? I type that and it is undeclared. I don't know what to do with that. What video did I miss? I am stuck.
@smachgaming439
@smachgaming439 4 жыл бұрын
sorry for the late response. yes we made a function with _Inventory
@vertigo6982
@vertigo6982 7 жыл бұрын
5:26 Why does that have to be 'const' ? Wouldnt the inventory be changing.. using/selling items so an array of items in an inventory wont be constant and fixed right? Just making sure I understand that line of code right but its code to keep checking and updating inventory so it makes an array of the items(actors) in the array and adds items to it as you find them. Or is that the reference itself is const meaning this is an array of pointers but the array itself will be a reference and we dont want to change a reference of these inventory actors so were making it const to make sure those items in the inventory cant be changed? Also this links back to my first question posted previously about pointers, but why is the const array of actor pointers a reference? Could that line of code have been it's own variable like '(FUpdateInventoryDelegate, const TArrayPickedupItems, InventoryItems)' ?
@kg7026
@kg7026 7 жыл бұрын
Due to the & (address operator) the parameter in the multicast delegate is a pointer to a memory address. This pointer to the memory address has to be const, so that we always get the same array data (cause it is always the same memory address, it will always update the same array). The array is not const bu its adress is. hope that makes it more clear to you.
@maverikmiller6746
@maverikmiller6746 6 жыл бұрын
Hey mate quick question. I am using your tutorial to make an inventory and the only difference is I am using character controller to store inventory (not to lose it when different level is loaded). Everything works perfect except my picked up items are disappearing from the inventory after around 30 seconds. I am using 4.18.3. Any ideas about why this might be ? Also great tuts. Thanks man. You are a life saver.
@charliemason7085
@charliemason7085 2 жыл бұрын
I've got this same problem did you or anyone find a fix?
@maverikmiller6746
@maverikmiller6746 2 жыл бұрын
@@charliemason7085 Hey mate. It has been a while but if I remember right in my case when I called Destroy() I called it on both the 3D model AND the stored item on my Inventory array by mistake. So both the 3D model on the level and stored item on Inventory were destroyed and garbage collector simply removed it after a short time, thus item disappearing. Hope helps ;)
@dadjorts
@dadjorts 7 жыл бұрын
What's the purpose of using pointers?
@JayAnAm
@JayAnAm 7 жыл бұрын
Please read the basics about pointers here: www.cplusplus.com/doc/tutorial/pointers/
@HelloFromTokyo
@HelloFromTokyo 6 жыл бұрын
Pointers hold a 4byte address to the start of memory instead of declaring "health,mana,skills,items,DNA,atoms,etc" you just allocate "0x01"
@pizzaspy
@pizzaspy 7 жыл бұрын
Amazing stuff, thank you!
@JayAnAm
@JayAnAm 7 жыл бұрын
Thx, you're welcome
@TM-jb8bw
@TM-jb8bw 7 жыл бұрын
awesome!
@JayAnAm
@JayAnAm 7 жыл бұрын
Thx!
Unreal Engine 4 Inventory Tutorial: Drag and Drop (1)
5:38
UE4 C++ Inventory : Pickup
10:47
Jayanam
Рет қаралды 14 М.
The Lost World: Living Room Edition
0:46
Daniel LaBelle
Рет қаралды 27 МЛН
SLIDE #shortssprintbrasil
0:31
Natan por Aí
Рет қаралды 49 МЛН
Make UI With C++: How to use Slate in Unreal Engine
22:21
How to make an Inventory System with C++ in Unreal Engine
32:06
UE4 C++ Inventory : Add Items
12:28
Jayanam
Рет қаралды 10 М.
Unreal Engine Inventory Tutorial: Create / Update Inventory
26:20
UE4 C++ Tutorial : Rotating Pickup
8:47
Jayanam
Рет қаралды 16 М.
Unreal Engine Inventory Blueprints : Drop Items
7:12
Jayanam
Рет қаралды 10 М.
Unreal Engine 4 Guide - UMG Binding
6:13
Tefel - Astro Colony
Рет қаралды 12 М.
Unreal Engine Spawn Blueprint Actors with C++
4:20
Jayanam
Рет қаралды 22 М.
Unreal Engine #07 - Building User Widget/HUD/UI with C++
48:15