Please or Register to create posts and topics.

func_physbox and other physics entities

I am attempting to make an object relay and output ONLY when it remains completely motionless, and to revert those outputs when moving. unfortunately the func_physbox entities only allow for the second and not the first. is there a way around this?

Just when I think I understand the system, it changes on me.

Hi Fracture,
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)

Spoiler
Sorry, only logged-in users can see spoilers.

i am about as good at scripts as i am at landing shuttles on the moon O_O

Just when I think I understand the system, it changes on me.

Ok, well I debugged the script and utilized it in an instance, so if you still want to use this method, all you would have to do is place the instance and script in the indicated files, and put the instance in your map. Set the Entity Name Fix Up to either 'none' or 'postfix', set the '$PhysicstoTrack' parameter to the name of your physics item. And put an @ before the name of the physics item in both it's actual name, and the parameter so the instance can reference it. Lastly, if you upload it to the workshop, or to TWP, in the final map, pack the script into the map so it will work on other computers.

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