Call level blueprint macro from inside class blueprint macro

I have a macro inside a class blueprint that I want to call a macro in the level blueprint upon completion but can’t seem to find anything about communicating in that direction. I understand this may be due to the fact that class blueprints are designed to go from level to level but I still feel there should be a way.

You can, using event dispatchers.

Create an event dispatcher inside your actor → Add it in the levelBP event graph → Call your macro

Sorry for the extremely late reply. I have the event dispatcher created inside my actor class but how do I add it to the levelBP event graph? I cannot find a way to reference it.

Is your class placed in the level?

It was not. I spawn the actors systematically. I have placed a dummy one outside of view in my level to use for reference and can now see the event dispatcher but it does not seem to be firing. I have even tried skipping the macro for testing purposes and gone straight to Print String, but nothing. This is what I have so far which seems to mimic yours nicely:

134315-call.png

134316-event.png

I am creating a falling block game to help orient myself with the engine/environment. This call is tacked onto the end of an event that moves my block(blit) down (x) number of spaces. I know this event is firing properly and I added a Print String after the call to make sure the processing was making it that far, which it is. From my understanding of how all of this works it should work perfectly fine and print the message out every time the block moves down a space, but does not. Does the event need to be bound? I tried doing it that way but it didn’t work either.

I’m don’t quite understand what you’re trying to accomplish, but it doesn’t sound at all that class/levelBP communication is necessary, or am I wrong?

Technically I do not. This all originally spawned from trying to loop a timeline which it was giving me an infinite loop error even if I was only to run once. I came to the conclusion (I may be wrong) that you may not place a timeline inside of a loop. I tried every method I could think of to loop this, even with out a technical while or for loop, with no success. Essentially what I need to accomplish is after running an event in the actor class blueprint for my block that contains certain processing and said timeline to then run coding in the level blueprint. The timing on it is very important because in the level blueprint I need to run checks and calculations after the block is done moving and if I fire the event in the actor class from the level blueprint and continue my processing it will run these macros after firing the timeline event with no regard to the timeline being done or not. The method I currently have is to have a variable ‘waitingOn’ that contains what exactly the game is waiting on or what the next needed action is. On eventTick I check the string, if it says we’re waiting on a block then I check the current action block for a variable it contains saying whether it is in the middle of dropping. If not, the animation has completed and the game may commence to the next step.

Needless to say this is rather complicated and I feel most likely unnecessary. Not only that but after a while of running when the block count gets high, it starts to lag on the ticks. I believe that if I could have the actor class blueprint fire an event in the level blueprint upon completion this would solve a lot of the issue and be much simpler.

Sorry man, I still don’t get what you’re trying to actually do in terms of gameplay. So you want to just move blocks around right? Is there any current game you can show a video of?

Also, there’s a loop checkbox inside of the timeline, are you using that?

I’m afraid my laptop does not have the hardware capabilities to run screen capture, it can barely run UE4 as it is. Here is a screen shot of my gameplay:

134365-gameplay.png

So essentially, it’s a Tetris inspired game where it drops single blocks and you use them to form tetris pieces to clear them.

If I were to use the loop feature of the timeline, is there a way to make it only run a set number of times, instead of for a certain amount of time?