Download

Blueprint matchbox required to spawn fire in furnace working 50/50

i have a blueprint which is to press E next to a matchbox and then go up to a furnace to and press e again for it to light, the problem im getting is that its working 50/50 of the time with it seeming alot more likely to work the less amount of time i take to go up to the furnace after obtaining the matchbox, its like its not remembering me picking the matchbox up, i have a print string which says ‘matchbox required’ if i go up to the furnace and press E on it without picking up the matchbox beforehand but even after i pick up the matchbox 50/50 of the time it will come up saying ‘matchbox required’ although i picked it up 1 minute ago, my blueprint is basically a normal blueprint for the matchbox pickup with a boolean for when i have obtained it and a level blueprint for the fire spawning in the furnace and smoke out the chimney at the same time, this also uses a boolean for when i enter the triggerbox so that i cant press E anywhere in the map for it to light the furnace, help would be greatly appreciated, iv been having problems with this for a few days now. It keeps referring me to the function page but i dont have a clue what im meant to do on there if so :S

07566c1d18bff4e4c56974e12180287f7e6ee366.png
93d0fb53f4b4ca31150b4b461bffe450ae664221.png
6bc0f5f565dae5b6cf873bfb16465b53ce9196b8.png
679860ba80ee986611047e773ef882329c4f50d4.jpeg

Hello,
I haven’t got time to check but try to use a different key for your second event, if it works fine then this is the trouble and you just have to use only one e event and do all in it
for example in your character : on e event / bool “matchbox on” branch
false / get overlapping actor matchbox / get 0 / cast to / set your event
true / get overlapping actor furnace / get 0 / cast to / set your event

Edit and you can use an array to compare what actor you overlap to know what action to do. (you can use an interface too if you have lots of different blueprints)

… But not if he plans to use the level blueprint, right…?
(They dont support interfaces)

For level blueprint, the best solution will be event dispatcher or cast to or use reference of item. To have a complete overview about communication, check the content example blueprint_communications, and you’ll have exampels of cast to, event dispatcher and interface.

If you access variables wich refer to other objects and stuff you should always do a IsValid (function) check

thanks for the feedback guys, i tried changing the ‘E’ key on the second event but no luck with that :s, iv also played around with the overlapping actor etc as you said Fen but I dont think im doing it right at all, im not too sure how to go about doing that part of the blueprints as of yet as iv only been using UE for a few weeks with doing mostly building so im new to the blueprints/ mechanics side, and ill try what you said ruohki, where would i place the IsValid in my blueprint?
EDIT: I think the ‘IsValid’ worked, will keep you updated

I got time to do something. What i thought you could use to not be bothred is something like that :
activable.jpg

where you need to create a class array where you register all the activables items you want and a bool to know if you have the matchbox. You can add classes to have all your activables items and can eventually use it as a global loot sytem (but then you’d better use a parent class “loot item bp” with a variable dedicated to know which item you loot and a activable system with a variable item needed to activate.)

Edit : I used a loop instead of a “get” in case of you overlap another item. Beware, in this case all the overlapped item registered will be activated. You’ll need to add a verification.

Edit 2 : Then you set 1 furnace Bp (a furnace and a box) and 2 matchbox Bp (a matchbox and a box) in your level, to test.

Edit 3 : I forgot : Link the default output of the switch on int to the “no action” print or to a new one “this is not an activable item” but only if you don’t have multi overlap. In multi overlap, nothing is better.

Edit 4 : If you need to activate functions or custom events in your item blueprint, instead of a switch, use two “cast to”, but it will be a lot of “cast to” if you don’t parent and then an interface will be a good way.

Edit 5 : 4 edits was not a good thing. :stuck_out_tongue: