|
Post by Swordplay on May 4, 2010 9:11:03 GMT
Hello, was just wondering if anyone knows how to do a physics version of the momentary rot button.
What I basically want to do is something like an old school crank, so as you turns it in raises a drawbridge or lowers a portcullis. But the catch that you are turning it with your body instead of the use key.
So think of it as a func_physbox on a phys_hinge and as you rotate it clockwise, it raises the func_movelinear based on SetPosition and Position.
Anyone know if this is possible with the current entities in Hammer? Or do I have to create a new entity using the Source SDK for something like that.
Thanks.
|
|
|
Post by Zeph on May 4, 2010 10:17:24 GMT
Oh i like it.
Couple of things to try: Try the momentary_rot_button with "use activates" untouched and set to "solid". See if pushing it does turn it.
Try having small thin trigger_multiple brushes either side of the handles, where "on touch" start TWO func_rotatings (one for the handles, one for the drawbridge or whatever) moving (in correct direction) and "on not touching" stop.
a physbox and hinge would look great, but there will be no way of getting out data for how much it's rotating by. Perhaps a trigger_mutliple with an entity filter of the name of the physbox, and placed so that a handle passes through it. on touch, start rotating. would only work in one direction though.
EDIT: or like the above, but have one handle a func_brush parented to the physbox, so it has a unique name, and a ring of trigger_multiples. which ever trigger it's in, open to that amount. Need to stop it going from fully open to fully closed in a small turn...
|
|
|
Post by Zeph on May 4, 2010 17:52:26 GMT
Here's my attempt, made for CS:S. Many problems, but meh, i tried! Attachments:
|
|
|
Post by Swordplay on May 5, 2010 6:01:23 GMT
Thanks for the quick reply. Forgot to mention that it is suppose to move WITHOUT the player being there. The mod we guys are working on does some things with physics which will allow the crack thingy to rotate by itself without needing the player to use it or touch it. Why I mentioned you turn it with your body is to get the idea of using physics to turn it, but the actual puzzle thingy will not use the player's body but physics to turn the object by means of manipulating physics. And different forces applied to it will make it go faster or slower, can't really do that with triggers. I'll try the turning off use activates and set to solid and give that a try, thanks! But if that doesn't work, I guess we gotta try creating a new entity. Thank you.
|
|
|
Post by Swordplay on May 5, 2010 7:05:31 GMT
Just tried, solid and no use activates momentary rot button isn't physic-ky. Guess gotta create attempt to create a new physic-ky entity. Thanks.
|
|
|
Post by Zeph on May 5, 2010 10:10:13 GMT
So... WHAT turns the button? Player? Wind? Thrown objects?
I think you're looking at a physbox on a hinge, but theres very nearly no way of getting out data from that.
Possibly the 4th method i wrote above.
|
|
|
Post by Swordplay on May 6, 2010 6:20:20 GMT
Modifiable gravity turns it. And yeah, looking for the effect of a physbox on a hinge. Trying to ask the programmer dude to look into creating a new entity if possible that can be affected by physics and outputs a position value.
|
|
|
Post by Zeph on May 6, 2010 10:22:41 GMT
Possibly doable...
Say you have a physbox bar connected to a hinge at one end. In normal gravity, the bar would dangle downwards. When you change gravity, say upside down, the bar would dangle "upwards" (relative to the old position). You could name the bar something, add a filter with that name, and have a trigger_multiple, with that filter, in the positions the bar dangles, which would "on touch" "open/close" whatever. Or just directly output from the change in gravity to the open/close whatever, and skip the 'switch' all together, since it has no interaction.
Or if you mean a local gravity box around it, which is basically 'wind', you could use a trigger_push only affecting the leaver (again via filtering) and change it's direction as you would change the gravity. Trigger it the same as above.
|
|
|
Post by Swordplay on May 12, 2010 3:40:53 GMT
Thanks for the help. Asking my programmer friend to look into exploring the func_door_rotating code to see if they can create a brush entity with a "hinge" that is affected by physics and outputs a position (Func_door_rotating has the "distance" thing after all). Changing gravity not up and down (Z), but imagine changing it for X, -X, Y, -Y slightly. I have figured out how to do it in terms of just Hammer entities only, but that would kill me and it would be better if an entity can be created. How to do it via hammer is if we are doing a merry go round kind of rotating crank. [t]|[vphysics_clip] [t] | [t] [t] o [t] [t] [t] [t] [t] [t] Each little trigger around the circle will tell the "door" to move up or down slightly. (Imagine triggers at each part of a "clock face". Smaller and even more triggers for greater accuracy.) When each trigger is triggered, it will kill and forcespawn new triggers in front and behind (Or enable / disable) it so that if it continues to move "forwards", the door continues going up, but if it goes backward, the door will start going down. Then the vphysics_clip will be deleted by a trigger near it and when you are near the ending of a crank, it will spawn a new vphysics_clip. All in all, a bloody heck of a lot of triggering, point templates or enabling disabling of triggers, outputting to the door to where it is suppose to be and then some.
|
|
|
Post by Swordplay on May 12, 2010 3:42:47 GMT
Sorry, my illustration screwed up.
Imagine a clock face with just the minute hand and each number on the clock face is a trigger and the minute hand can rotate freely as if on a hinge clockwise or counterclockwise till the min or max distance.
|
|
|
Post by Swordplay on May 21, 2010 9:39:04 GMT
Hello again. One of my friends made a new entity for me that works as a physics momentary rot button. Only problem I have now is making a spring for it. I attached a phys_spring to it, but let's say if it is at 3 o'clock, and it is suppose to turn 1080 degrees, meaning every 360 it will go back to 3 o'clock, the spring will make it lock back to 3 o'clock no matter which rotation is in when I want it to go back to 3 o'clock at the first rotation. Meaning at 0 degrees, it will spring to 3 o'clock, at 360 degrees it will spring to 360 degrees 3 o'clock and not go back to 0 degrees 3 o'clock, same with 720 and so on. Can I use the phys_spring this way to or do I have to ask my friend to make add some type of spring to the new entity?
|
|
|
Post by Zeph on May 21, 2010 11:27:52 GMT
Because the sprint can't 'wrap' around the axis of the button, it is a direct link. This is a good picture of what you are doing currently. Imagine rope L was your spring, it only works for 360. What you need is a coiled spring or axis spring, which will be much harder.
|
|
|
Post by Swordplay on May 26, 2010 4:27:49 GMT
Thanks, I'll ask my friend to look into making something like a auto-return thingy in the entity then, if possible.
|
|