Checking if overlapping Actors are specific amount and type of Actors
I hope you guys can help me, atm I am trying to build a blueprint prototype for a gameidea contest of ours. Because of a possible game that might spawn out of this, it's a c++ project, but I do the prototyping in Blueprints, so this is a blueprints question. I have tried quite a lot but I fail to understand the logic needed, on paper it's straight forward and should work well, it's just that as my first project I don't know all blueprint notes and I have run into a stone wall with this. - also its been a long workday of staring into the same screen, might have something today with that. I am trying to archive this:
On open craft menu (press “c” key – set up and working) check which actors “collection box” (collision box component part of the character) is overlapping with. Then: if its 2 Twigs set bool lighter to true, if its 2 branches and 30 twigs set bool shelter true, if its 4 branches and 10 twigs set bool fire true.
Then (this part is already set up and working) the craft menu which has already been opened has three buttons for lighter, fire and shelter and if the bool or the object is true it can be placed otherwise the game prints debug “you don't have the resources”.
So basically I am stuck at the check of the overlapping actors, comparing them to the amounts and stetting the booleans accordingly.
(After uploading I realized that a) this is the CharacterBP and b) The Hud Ref is connected because I copied this to take the screenshot, it works so no need to point that out )
Additional Info: I know that the overlapping actors part works, I have - in c++ - a setup which I created where the player picks up power ups that change attributes. So I know it works. My 2 Blueprints, BP_Twig and BP_Branch, which I am placing in the level to be used for crafting are both children of a c++ crafting pickups class. That class at the moment only adds a mesh, the children blueprints are untouched (other then the static being added.).
I would highly appreciate the help and if possible posted pictures of the solution, as I do hope to finish this in time. Thank you in advance!
asked Aug 16 '16 at 01:28 AM in Blueprint Scripting
If you can confirm that the overlapping actors array is properly being populated. I recommend building a map with the results, the key being the actor class and the value being the count.
Since I am completely oblivious to the blueprint nodes available to you (I solely use C++) and you seem savvy enough with blueprints and probably have a basic understanding of pseudo-code, so I'll go ahead and give you a rundown.
At this point you can manipulate the buckets however you want. Do you have 30 sticks?
if (ActorCountMap.Find(StickClass) >= 30) Do Something;
answered Aug 16 '16 at 03:34 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here