mikem
Quake 2 Mapping Club
Posts: 327
|
Post by mikem on Dec 7, 2021 7:36:37 GMT -5
How can I make a func_train that rotates 90 degrees at a certain path_corner and moves on to the next path_corner?
|
|
|
Post by grieve[Q2C] on Dec 7, 2021 10:12:01 GMT -5
the Lazarus - func_trains should support this. func_train.zip (4.61 KB)
|
|
mikem
Quake 2 Mapping Club
Posts: 327
|
Post by mikem on Dec 7, 2021 10:53:16 GMT -5
But how can I realize it?
|
|
|
Post by grieve[Q2C] on Dec 7, 2021 13:48:08 GMT -5
can't tell you more than what the Lazarus - docs say:
you need to set some spawnflags: ROTATE Spawnflag (=8) Thanks to Rroff for providing the basis for rotating train code. If set, func_train will alter its pitch and yaw angles to turn towards the next path_corner in its sequence, and also alter its roll angle to turn towards the roll value of that same path_corner, unless that path_corner has the NO_ROTATE spawnflag set. Rotational speeds are controlled with the pitch_speed, roll_speed, and yaw_speed values.
SPLINE Spawnflag (=4096) Big kudos to our man Argh! for providing spline fit code for use in Lazarus. If SPLINE is set, the func_train will follow a spline curve between path_corners. What this means is you can create near perfectly smooth curvilinear paths with a handful of path_corners. The train will constantly turn to face the direction it is moving (unless yaw_speed and pitch_speed are negative values). For a couple of examples, see the rottrain and lcraft example maps (available on the downloads page.)
well, etc.
|
|
|
Post by knightmare on Dec 7, 2021 22:12:41 GMT -5
You should use the ROTATE spawnflag only, if you want it to rotate only at specific corners. The ROT_CONST spawnflag makes the train constanly rotate, like if you want to make a rolling boulder. Combining the two makes the train use smooth spline movement (with the internally set spline spawnflag), which may not be appropriate if you want it to only rotate at specific spots.
Be sure to set the train's yaw_speed (or pitch_speed/roll_speed if you want to use those) in order for it to rotate.
As for the path_coners, either set an angle value (for yaw only) or angles (pitch yaw roll) for the train to rotate to when approaching that path_corner.
There's also func_train_origin you can use, which is a slight variant of func_train that follows path_corners by its origin brush instead of by one unit below the mins (absmin) on all 3 axis. This makes aligning the train's movement much easier.
|
|
mikem
Quake 2 Mapping Club
Posts: 327
|
Post by mikem on Dec 8, 2021 1:01:15 GMT -5
Thank you, I will try it out. What is yaw, pitch and roll exactly mean? I want the func_train to rotate 90 degrees up to the next path_corner.
|
|
|
Post by knightmare on Dec 8, 2021 14:28:45 GMT -5
Pitch, yaw, and roll are your basic Euler angles. Quake always uses them in that order. What you probably want to adjust is yaw, which is in the XY plane, around the Z axis. Pitch is in the XZ plane around the Y axis, and roll is in the YZ plane around the X axis.
|
|
mikem
Quake 2 Mapping Club
Posts: 327
|
Post by mikem on Jan 12, 2022 14:24:02 GMT -5
Is it possible to trigger a func_train? So that it only moves to the next path_corner if the player push the button again.
|
|
|
Post by knightmare on Jan 12, 2022 15:11:16 GMT -5
Did you look at the .def description for path_corner? A "wait" value of -1 makes it wait to be triggered again.
|
|
mikem
Quake 2 Mapping Club
Posts: 327
|
Post by mikem on Jan 13, 2022 1:27:08 GMT -5
Thank you. I know I read about it before, but I couldn't remember where.
|
|