Combat Music Trigger Problem

Good Morning! i have been trying to trigger combat music depending on if my player character is overlapping my enemies ‘combat zone’ ( a collision box used to initiate the music) but for some reason upon entering the combat zone, the music keeps restarting, been banging my head against the wal trying to figure this out lol. hopefully someone can help…this is my current audio setup ( courtesy of some lovely soul on these forums who helped me already :D)


Capture1

I am changing the music depending on the time of day, as you can see from the pics…but then in the 3rd pic…im trying to get it so, if the player mesh overlaps the ‘combat zone’ of the enemy, to play the combat music…it works…but the combat music keeps restarting every second…per the timer by event…but that doesnt happen with the day and night music…ugh…any ideas? thank you SO much for your time and i hope your new years eve is awesome :slight_smile:

Do you really need ‘target’ here?

image

I think you’re comparing the wrong things at the moment…

1 Like

hey! i dunno, i got shown a way to do it and its been working, lol, didnt wana question it :smiley:

Try taking it out :wink:

( I thought you said it wasn’t working?.. )

1 Like

i took it out, and now the daytime music keeps repeating :smiley: no, it does work, but when i enter the ‘combat zone’ of my enemy, the combat music just keeps restarting and i cant figure out why :frowning:

Ok, let me look again…

So combat only happens during the day?

now its not working at all … lol fml…it was working day or night, as i attached the outputs initially of day and night, to the combat music, it just kept restarting the combat music. not it wont work at all for some reason. ( i put evereything back to how it was) im so sorry for all these questions man, i just really want to understand where im going wrong so i can learn ya know. i have tried using my mesh overlapping the combat zone collision of the enemy, doesnt work now, im so confused

The problem is, you have two competing sound play systems, that are interfering with each other, you need one system.

i have to head to work in a min, but i will check my phone regularly , thanks again man :slight_smile:

makes sense, if its not too much trouble, would you happen to know a simple solution? i could then build upon?

Are you ok with blueprint interfaces? I would do it that way, and have the player in the character.

Are you ok with that concept?

yes, i have been practising with them :slight_smile:

i mean im ok with them lol, far from a bpi genius :smiley: :smiley: i understand the concept, and how they can be used more or less

Ok, using your method. We still have

But

I’ll do the BPI version next ( bit more efficient ).

1 Like

Question…going by that…wudnt my played have to basicslly be on top of the enemy for the music to play? Apologies if i sound stupid haha,just trying to understand :slight_smile: and awesome,cos woth the bpi method,i cud call it and change it anywhere as long as the bp has the interface implemented?

No, combat zone is a blueprint with a big collision box. It covers the whole area.

So with the BPI method, I’m holding the code in the player. Same code more or less.

The BPI, play sound just takes a sound

and the enemy override just takes a bool

In the player on begin play

( very similar, except those are calls to the BPI handler )

To handle the play sound event

( notice it’s just the same as before except we swap the sound if the enemy bool is set )

The handler for the bool is very simple

image

And the whole point of this operation, is that you don’t need to loop going over all the enemy areas. The enemy zones tell the player to change the sound

image

You don’t even have to cast, because the interface isn’t implemented by anything else :slight_smile:

1 Like

Awesome…thank…you… dude …when i get home imma get this implemented,and just glancing at it i can kinda understand it,ill stud it proper when i get home. Hypothetically if i wanted to change the song for anything else,i.e entering a certain town,i wud be able to change the song without issue?

You would need collision volume over the town then.

This is implemented so that it plays different music in the ‘enemy’ volume. You could also do it so that it change music when you cross a volume ( and don’t have to stay in it ). But now that’s moving the goalposts… :slight_smile:

1 Like

So its not possible with this system? Lets say the player enters a town,and it has a trigger box, i cudnt somehow override the daytime music to play town music? Apologies,still very early in my bpi journey :joy: