I’m still somewhat new to UE. I’m trying to get a value from a data table and use that to trigger music layers in Quartz. I have verified the data working but I’ve not figured out how to take that value and say “when wave X starts, begin music layer 2.”
I have been able to successfully trigger the music layers via placeholder user input (press 2 and layer 2 begins). The waves are controlled via a script “start wave {1}” and uses the value table to populate.
Any ideas?
If you’re curious, this is from the UE Legacy sample game called “Action RPG” in the UE Samples - Marketplace.
Here are pics of the Value Table and the Widget calling each new wave without any edits I’ve tried.
Have you gotten your music to start playing when the first wave begins?
If your music layers are synchronous, you would want them all to start at the same time but with the volume set to zero on the additional layers. Then when a new wave starts, you change the volume of the corresponding music layer so that it’s audible.
I can’t tell for certain if that’s what you’re trying to accomplish, but if you’re just trying to get something to happen (play music) when something else happens (begin wave), you can create a custom event or an event dispatcher.
Let me know if you want more help with either of these, or if I’ve entirely missed what it is you’re asking.
Howdy! The first layer of music plays upon eventBeginPlay. The other layers are set to a 0 volume multiplier and I’m just trying to connect them to the data from the Value Table.
I’ve gotten Quartz to keep everything in sync in other game builds but that was me manually entering in a custom event (i.e. pressing a key on the keyboard) or walking into a trigger.
Okay so I saw your YouTube demonstration and understand what you’re trying to do.
In your wave spawner Blueprint, you’re going to want to create an Event Dispatcher and name it something like PlayWaveMusic. Add an input to the event dispatcher so you can tell your music system which wave has started, this could be the row name from the data table.
Then, drag the event dispatcher into your wave spawner graph and choose “Call” from the listed options. Connect the event dispatcher call to whatever event is starting the wave, and feed the row name into the dispatcher’s input.
Then drag the event dispatcher from your wave spawner blueprint over to your music system blueprint. This time, choose “Event.” Now you have an event that will fire each time the event dispatcher is called and you will be able to get the row name. [Edit: I forgot to mention binding the event before doing this, I will explain when I get back.]
This is where it’ll get a bit tricky with how your system is set up.
The easiest way to go from here would be to have all of your layers in the same sound cue (assuming you’re on UE4) so you only have one audio component to manage. Your sound cue would have each of the layers in its own wave player, connected to a continuous modulator, then all of them combined in a mixer node before hitting the output.
On the continuous modulator you would set the name of the volume modulation parameter to be the same as the data table’s row name.
Then back in your music system blueprint, you would use Set Float Parameter using the data table row name as the input name, then lerp in your volume fade.
I gotta run right now so I apologize for not including screenshots, but this is one way it could work.