Announcement

Collapse
No announcement yet.

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

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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

    Click image for larger version

Name:	1.PNG
Views:	1
Size:	150.4 KB
ID:	1141326
    Click image for larger version

Name:	2.PNG
Views:	1
Size:	260.0 KB
ID:	1141327
    Click image for larger version

Name:	3.PNG
Views:	1
Size:	241.5 KB
ID:	1141328
    Click image for larger version

Name:	4.PNG
Views:	1
Size:	254.7 KB
ID:	1141329
    Last edited by ADhibi; 11-28-2014, 11:28 AM.

    #2
    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)
    Last edited by Fen; 11-28-2014, 04:28 PM.

    Comment


      #3
      interface too if you have lots of different blueprint
      ... But not if he plans to use the level blueprint, right...?
      (They dont support interfaces)

      Comment


        #4
        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.
        Last edited by Fen; 11-28-2014, 05:17 PM.

        Comment


          #5
          If you access variables wich refer to other objects and stuff you should always do a IsValid (function) check
          Free Inventory System (BP AND C++ Version): Clicky Clicky
          Player Structure System (Houses!) (BP): Pew Pew Marketplace Version: Yoink!
          Howto: Create Dragable UMG Windows: Zoom Zoom

          Comment


            #6
            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
            Last edited by ADhibi; 11-28-2014, 06:51 PM.

            Comment


              #7
              I got time to do something. What i thought you could use to not be bothred is something like that :
              Click image for larger version

Name:	activable.jpg
Views:	1
Size:	125.3 KB
ID:	1061525

              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.
              Last edited by Fen; 11-29-2014, 03:58 AM. Reason: Because i needed to edit once more ^^

              Comment

              Working...
              X