Briefly, what I wanted to do was to set up a keyboard key like most games that is my action key that does 50 million things. Think Resident Evil for where A did everything or thousands of other examples. I also wanted an inventory system for less than 12 items and a switch to end the then spit out a level complete screen that would spit out different stats like time taken in the level enemies killed, secrets found etc. Then it would go to a loading/map screen with the name of the next level they would go to and the next level would load and so on. I found a tutorial online for the inventory system which, in a blank project, worked just fine and seems to be what I need.
However when i tried to implement the inventory system in my pre-existing project the e key did not work to grab the item. After watching the tutorials dozens of time I’m sure everything is correct but I was wrong. After a lot of troubleshooting and debugging I’ve pinpointed part of my problem.
My problem seems to be I did do a lot of eventing in the level blueprint. As they say hindsight is always 20/20. I have learned since then that most beginners make the mistake of doing stuff in the level blueprint. Raises hand yep that was me too. When I deleted all nodes in my level blueprint magically the e key picked up the item from the level. So cool I learned that most likely the bug was something in the level blueprint.
My level blueprint contains 8 sets of nodes predominantly responsible for running a bunch of different matinees that move sections of actors “mostly walls” cubes or planes up revealing the secret chambers and then after a few seconds they close. I also learned at this point that apparently there is no way to call a matinee to play from within a blueprint which is why a tutorial told me I had to do this matinee stuff in the level blueprint in the first place.
So here I am trying to find a way to export my nodes from UE4 so i don’t have to do dozens of print screens of my nodes and then upload them. So I beseech you my wiser cousins of UE4 game design help this newb!
My level blueprint nodes don’t look like they first did. My problem at first was whenever I pushed E it would simultaneously fire off all 8 sets of nodes and their events.
Currently, I have
OnActorBeginOverlap(TriggerBox4_SecretDoor4) → Sets a boolean variable “IsinTriggeBox4SecretDoor4” to be true → it prints a string You are standing in the triggerbox4_secretdoor when player overlaps the triggerbox for secret door 4 → cast to firstpersoncharacter (the object of which is connected to the other actor pin from the beginoverlap node) → enable input with a reference to get player controller. enable input → connects to a branch that when a condition is true connects to the open pin on a gate node. Now before we get on into it the condition that must be true to open the gate must be as follows… the branch connects to an andbool node the first pin (first condition to be met) is that the boolean variable “IsinTriggeBox4SecretDoor4” variable must be true (my attempt to stop the event firing from anywhere on the map by trying to force the player to be in the triggerbox) the second pin or second condition on my andbool node is that the e key must be pressed. I did this by putting a inputactioninteractkeye (the e key is what i wanted to be the actionkey and was set up in the project settings input) node this node connects to another set boolean variable whichbecomes true when e is pressed. So this variable “inputactioninteractkeye” and the isplayerintriggerbox4_secretdoor4 variable connect to the andbool which outputs to thecondition in the branch that when true connects to the open pin on the gate. now lets talk about the gate node.
My gate node enter pin is connected to a second inputactioninteractkeye node and the close pin on my gate node is connected as follows
OnActorendOverlap(TriggerBox4_SecretDoor4)-> sets the boolean variable “IsinTriggeBox4SecretDoor4” to be false -> it s connected to a cast to firstperson character node (the object of which is connected to the other actor pin from the endoverlap node). The firstperson character node is connected to a disable input node with a reference to get player controller. the disable input node is connected to a print string node which tells me when i leave the triggerbox4_secretdoor and this pin connects back to the close pin on the gate from earlier. the gate is set to start closed and the exit pin is connected a flipflop node ( i don’t know why, that is what another tutorial said to do when i searched for making a door tutorial) the flipflop “A” pin is connected to a play matinee actor node, the flipflop B pin is connected to a reverse matinee actor node. The matinee actor these two nodes refer to is my matineeactor_secretdoor4 and finally the output of both reverse and play goes into a play sound at location node.
So the overlap nodes are what i used to prevent the e key from triggering these events simultaneously from anywhere in the level the boolean variables andbool and branch nodes are what i used to check and make sure that both the ekey was pressed and they are in the triggerbox because previously when I would try to load the second level I could push e at the start of the playtest and be sent to the second level without doing anything or just walk tonto the triggerbox and be sent to the next level. the gate and flip flop nodes seem to be why my secret doors (actors) as far as the game is concerned my secret areas are simply portions of walls that look exactly like regular walls. The secrets are not supposed to be found not easily anyways lol. they also seem to be the only reason that the matinees open and close hiding the secret again.
The problem that I am encountering is that something in the level blueprint my best guess the gates? are preventing the e key from registering when they are near an item that will be added into the inventory bag. However after I go to a secret door (in this example secret door 4) and the event plays if I return to the item to be picked up and push e magically the e key will register and at present the item destroys itself which is my feedback that thus far things are working.
I know that’s a mountain of text but I was trying to be thorough. I can post screenshots later.