- 听众
- 收听
- 积分
- 1779
- 主题
- 回帖
- 0
- 精华
注册时间2007-3-9
最后登录1970-1-1
该用户从未签到
|
How to use func_pendulum
By fizscy46, edited by Egir Helgrimson
I thought I'd write a little tutorial since a lot of people tend tohave trouble getting this entity to work. Hazaa! (Note, I bypassedsaying aboot as I normally do)
Have you ever wandered through half-life, and noticed thosedangling things that swayed to and fro... No, I'm talking about thosewires and light fixtures.
This effect is rather simple to set up, but it takes a bit of explaining to get you started.
First of all, the full goodness of a swinging item can only be achieved on SIMPLEthings. Don't even bother trying to make a swinging sphere or cylinder,or any other no rectangular brush, ause it won't turn out perfect.
By Egir:
Actually, if all faceson the brushes you want to use are parrallel with the rotation axis orif their normals are, you won't be having any problems
First of all, make your dangling swinging thing. Just make it facing straight down.
Now, decide the angle that you want it to swing. By this I mean, from which angle should it start swinging? Maybe start at a 45 degree angle and do a full swoop down and back up to 45 degrees on the other side (For a swinging axe maybe). Or, do you want it to just dangle and sway lightly at 3 or 6 degrees (Like those wires in half-life)?
Decide where the pivot is. The pivot is the point that it swings around. On a swingset (Which I will use as an example throughout), the top bar is the pivot.
At this location, make a cubed origin (Brush covered with the origin texture) brush that has its centre on this point.
Now, have you decided your angle?Look at the swing object from the 2D view window in which you couldwatch it swing around (On a swingset, this would be from its side, asyou can watch the swing go back and forth and up and down as if it wasa flat image). Look at the letters at the top left of this view.Whichever of the 3 axis (X,Y,Z) isn't there is the pivot axis. Select the object and origin brush, and press Ctrl + Mto bring up the transform tool. in the textbox labelled with the pivotaxis, rotate it the angle from straight down that you want it to startat (If you want it to start swinging from 22.5degrees, put 22.5 in).
SelectOK once you typed it in. Its because of this part that the objectcannot be complex as vertice coordinates may be rounded and thus causemalformed brush faces. Make sure you move the objects pivot back to itscorrect position.
Select the origin brush and the swinging object again, and press Ctrl + T to make it an entity. Select your newly formed masterpiece, and press Alt + Enter to bring its properties up.
From the pull down list in the window at the top, select func_pendulum. Remember that angle you just rotated it? Double it and make it a negative number! Put this under the Distance (Deg) box. This will make it swing from the angle its at, down to straight down, then back up on the other side to the same angle.
Now under the flags, check either the X-Axis or Y-Axis flag if your pivot axis was one of those 2 (If it was on the Z-axis, check niether of them). Check passable to make it non-solid, check Start On too... make it start on.
(Egir needed slightly other settings for his example)
Back to the Class Info tab:
Give it a name to make it turn on and off when triggered. give it a speed (About 10 for a swaying wire; higher for faster object).
Dampning is useful for many instances of this entity. It slows it down by its value out of 1000 eachfull swing until it stops at the centre point (In our case, straightdown). If you want your object to swing forever, set this to 0,however, if you get into more complex uses of this entities (Such asmaybe a breaking rope bridge), you'd set this to a very high value(Maybe 750).
So basicallythats it. I know this was confusing, perhaps egir will add pictures toit (edit: perhaps), I don't really the initiative to make them andupload them and everything.
And this is how it looks ingame (1.5mb heavy download from an animated gif):
[ 本帖最后由 Simen.sllove 于 2007-11-20 09:30 编辑 ] |
|