Stationary and distributed consensus protocols for a network of n dynamic agents under local information is considered. Consensus must be reached on a group decision value returned by a function of the agents' initial state values. As a main contribution we show that the agents can reach consensus if the value of such a function computed over the agents' state trajectories is time invariant. We use this basic result to introduce a protocol design rule allowing consensus on a quite general set of values. Such a set includes, e.g., any generalized mean of order p of the agents' initial states. We demonstrate that the asymptotical consensus is reached via a Lyapunov approach. Finally we perform a simulation study concerning the alignment maneu...