in my game i have an inventory variable of type map (following a tutorial, where part is string and the other is the inventory struct) and i want to find a specific item in my inventory.
however, a ‘For Each loop’ doesnt take map variables. Does anyone know of any alternatives to ‘For Each loop’ for a map variable or if i have to change my inventory type, how would i do that so i can have a string and struct in one variable? (i’d prefer not to do this since it’s hooked to a billion other things and i dont have time to go through each one)
thank you! that worked. kinda still have an issue with this section overall if anyone can help (im a ue5 noob btw so bear that in mind)
im looking for an item ‘Football’ in my inventory, and if it is found, my npc says a certain dialogue. the top part of this bp works (followed a tut for it) , the second part doesnt work AT ALL. am i being dumb and doing something completely wrong pls lmk ive been stuck on this for days.
okay so i’ve actually tried to use find already, it also doesnt work. not sure what a breakpoint does (ik its some time of debug but when theres nothing happening theres nothing to debug … ) but i added it anyway and nothing changes
also i added another talk index (i dont know if the original one stays as the final number it is on or goes back to 0 so i just made a new one)
i cant understand the issue, looks like the first person in the world trying to do a quest system like this…
i think the event is just not being called at all or something? i have no idea whats going on.
also, i tried adding the whole bottom section on the end of the top one and i did get the first message in the ‘after item index’ appear but i didnt even have the item. so i think it’s partially an issue of the event not being called at all and something alone the line not working either.
idek how to make that event be called. everything ive done is by following tutorials, and theres no tutorial for any of this lol
ok i understand the breakpoint now, and no it didnt focus. so i have a BPI called Dialogue with two functions. Talk and TalkAfterDialogue (this should be talk after item but anyway) so as far as i know it should be fine? maybe beginner mistake.
Keep in mind that this is based on what you’ve shared. IMO it’s more likley to be the issue but we will know after this has been sorted and the breakpoint executes.
so the first one is for dialogue the NPC is going to say when the player talks to them (“can you find my ball?”)
the second is supposed to be dialogue for when the player has the ball in their inventory and they talk to the NPC. to which the NPC would reply “thank you for finding my ball”.
the first one is being called and works perfectly with 0 issues. i still dont understand how to be able to call the second one.
Ok. So… what I recommend you do is make only 1 event that checks for the item. The only thing the event has to change is the FString value (the dialogue) depending if the item was found or not.
i then put one on ‘Add AC Inventory’ and it focused too. i added the branch and it focused too. however i never got the print string to focus or even print.
so, this means the issue now is that it cant find the football in my inventory. back to the beginning lol. this is one function in my AC_Inventory (theres a lot so here’s one that checks if an item is in the inventory) but yeah not sure what to do.
Ok. The point of the question is to see if you understand where it is and how it can be accessed. A simple button that checks and prints at the start of the game and right after the player receives the item will go a long way.