func_physbox and other physics entities
I'm not sure if there is a way for the physics entity to tell you if it's moving, but if you don't mind some scripting, I would run the outputs through a logic_relay, and run a script to check to see if the origin of the physics object is the same value as it's last tick, where if it is in the same position, enable the relay, and if it isn't in the same position, disable the relay. I wrote one myself that should work if you want to try this method, but I didn't test it so let me know if you use it and it doesn't work. (unless you can fix it yourself)
//Assuming that this function is being called once from the physbox or physics object.
//When calling the script, for a perameter, just user "Vector(0,0,0)"
function Checkmovement(last_pos)
{
//finds current position and logic relay to enable/dissable.
local current_pos = self.GetOrigin()
local relay = Entities.FindByName(null,"static_phys_relay")
//If the two positions match, reach out to a logic_relay that has been named "static_phys_relay" and enables if the physics object is static, and dissables it if the physics object is moving.
if (current_pos == last_pos)
{
EntFireByHandle(relay, "Enable", "", 0.0, null, null)
}
else
{
EntFireByHandle(relay, "Disable", "", 0.0, null, null)
}
//Calls the function again on the next tic, change the delay time as necessary.
EntFireByHandle(self, "RunScriptCode", "Checkmovement("+current_pos+")", 0.1, null, null)
}
https://drive.google.com/file/d/0B9wOk5iIMMN_ajZoMXhXeXJoSjg/view?usp=sharing
I tested with a weighted cube, and it worked perfectly. It ignores subtle movements up to 0.1 units every 0.1 seconds. Let me know if that's a problem.
Edit: I forgot to actually say what this does. It's pretty much a relay that is enabled while the physics object(specified in the parameter) is stationary, and is disabled while the object is moving. Send at an input, and then send an output from it, and it will filter the outputs so they only go off while the physics object is not moving