If you have 4 instances that should always behave similarly, you should probably make an AlarmManager blueprint which handles the “going on and off” part, but doesn’t have a light. Instead, a new blueprint (like AlarmLight) would have a light. It wouldn’t check any of the conditions, becuase the Alarm Manager would tell it when to go loud.
But I won’t mess with your setup more than necessery, you’ll decide if you need that.
As for the clarity - first thing is to find everything that looks more or less the same but is called in different places (like our Set Last State node).
In case of my small blueprint I’ve sent you, it would be this part:
because its basically the same nodes but with only one parameter changing (the actual value of Last State)
You can grab these nodes, click Right Mouse Button and click Collapse To Function
(be mindfull what you are selecting)
Functions typically start with a verb (because it DOES something), so lets name it something like TriggerAlarmSequenceIfNewState.
The name is up to you (I’m not sure mine is good), but the general idea is: the shorter the better, but long names are not bad as long as they are not too convuluted and are descriptive. In the future you want to read your code node by node and understand what is it doing without the need of going inside the functions.
Now, create a new input inside a function. You can do it easily with dragging the pin from Set node into the top of the start of the function node, like so:
Now you can change your other branches into your new function, but change the Last State input in every branch, like this:
This already looks much better in my opinion, and more importantly, if you would need to add some more conditions or other stuff to do, you can now to do it inside this function instead of copy-pasting it 4 times.
Now, I know you have more functionality, maybe you can try to do similar stuff yourself, for example with your light color and sound. You can create a new function, like SetAlarmParameters, and set light color and sound to be inputs (similar to Last State in my example).
Let me know if it’s clear! ( I might be out for couple of hours, but will be back later)