I started a mine cart pushing map (now on hold now until Valve releases their official mine cart game mode) that had a similar idea as this.
First the movable object is a
func_tracktrain with an appropriate set of
path_tracks to determine the path of motion. Set it's flags to "unblockable by player" because its motion is going to be determined by another entity.
I put two
trigger_multiples on either side of the train, parented to it so they move along with it and shaped appropriately so that someone would have to walk up against their respective side to move the object. Furthermore, you may or may not want to limit these triggers to their respective team to prevent someone from griefing their team or just accidentally moving in the wrong direction.
I then have one
trigger_multiple's
OnStartTouch add 1 to a
math_counter, and it's
OnEndTouch subtract 1 from the
math_counter. Similarly, the other
trigger_multiple would do the opposite, subtracting 1 on it's
OnStartTouch and adding 1 it's
OnEndTouch. I send this
math_counter's value to a
logic_compare entity.
I then have a
logic_timer, with a very small wait interval, which repeatedly evaluates the
logic_compare. The
logic_compare's outputs are the following:
OnEqualTo calls the
func_tracktrain's
Stop input,
OnGreaterThan calls the
func_tracktrain's
StartForward input, and
OnLessThan calls the
func_tracktrain's
StartBackward input. Note, depending on how you oriented the train and setup your triggers, you will of course have to figure which is the appropriate way to move for a positive amount in the
logic_compare and switch the inputs accordingly.
What all this crazy talk does is that the train will move in whatever direction has the most players pushing on their respective trigger. So a deadlock will result when equal amounts of players are pushing either side. You may or may not want to set a min/max on how many players can affect a trigger, if only for clarity. I experimented with using a
math_remap to convert the
math_counter's value into a proper speed range for the train so it would move faster when more players were pushing on it, but there are some serious issues with the
func_tracktrain's motion, ie. it's broken and unwieldy. I have found the
SetSpeed inputs to be unreliable, in particular
SetSpeedDir would oscillate pos/neg for no apparent reason.
Also, see
this thread for information on an issue with making the thing reverse properly. Essentially, you have to explicitly set the speed of all
path_tracks, which removes the possibility of setting the train speed manually anyway. I suspect you can simply put in some inaccessible dummy
path_tracks at the ends of the track and play around with which ones need their speed set and which don't, but I was tired of messing with it at that point. Easiest way is to just pick a good speed and have them all use that same speed, although it could be interesting if the train sped up or slowed down at odd points, possibly along inclines. Lot of interesting things you could do, but be careful as
func_tracktrains aren't the most well behaved entities.