I’m trying to figure out what the best way to do this is. I want an alarm that is triggered by certain weapons, that can be localized to individual areas and will instantly alert all guards in that area.
I’m thinking some kind of a volume. Can you make a custom volume? If I could make an alarm volume, how hard would it be to determine which alarm volume I’m in and send an alert notification to any guards either specified by the volume or contained in that volume?
I know how to get a list of ALL actors of a class, but that is too many. If I have a list of the correct actors, I know how to send the alert notification (I would use an interface to send this to a variety of classes) I’m just not sure how about the volume part.
A trigger volume would be best suited for something like a laser beam alarm, or a camera where the player triggers it if they walk through it. That volume could then raise events on your guards via an interface, as you said. You’d simply pass relevant variables like the location of the player at the time of overlap through this interface event.
If you want to trigger it via a weapon, I would raise the same event every time the weapon is fired and you are inside a trigger volume - as for knowing when you are inside one, add a bool to your player which is set to true when you end overlap of the volume, or false if it is already true. In essence, a bIsInsideAlarmArea boolean ^.=.^
I’m sure you can filter your actor results by other trigger volumes, areas or simply by distance.
I think I finally figured this out. there is a method? (it doesn’t have an execute pin) called Get Overlapping Actors that can be used against the trigger volume. It returns an array of actors. You can even filter this to a certain type of class.
Then all I have to do is when I enter the trigger volume, I store which one I’m in. Then I know which alarm to set off if a non stealth weapon is used.
So I had one more issue, but got it resolved. How do I determine if what you hit should trigger a volume as well. Turns out you can’t get overlapping actors to find said volume without actual overlapping collision and bullet puffs don’t overlap. So I added an invisible cube with overlap all set. That did it. I got my volume. In order to make sure I don’t have invisible cubes killing too much memory I set them to destroy themselves after 5 seconds.