Scroll_Ceiling — scrolls a ceiling's texture.
Scroll_Ceiling (tag, scrollbits, zero, x-move, y-move);
Scroll_Ceiling ( tag, // Tag of sector to scroll the ceiling in scrollbits, // Affects scrolling behavior zero, // This parameter should be zero x-move, // Specifies horizontal scroll speed y-move // Specifies vertical scroll speed );
Scroll_Ceiling (tag, x-move, y-move, zero);
Scroll_Ceiling ( tag, // Tag of sector to scroll the ceiling in x-move, // Specifies horizontal scroll speed y-move, // Specifies vertical scroll speed zero // This parameter should be zero );
Value | Meaning |
---|---|
1 | Displacement scroller. The ceiling only scrolls when the floor in front of the control line moves. Cannot be used together with the Accelerative scroller bit. |
2 | Accelerative scroller. The ceiling accelerates and decelerates when the floor in front of the control line moves. Connot be used together the the Displacement scroller bit. |
4 | Scroll speed is determined by the line's length and orientation. When this bit is set, any values specified for x-move and y-move parameters are ignored. Instead, x-move takes its value from the difference in the x-coordinate of the line's endpoints. Y-move is similar, except it uses the y-coordinate. |
Controls the horizontal speed and direction of the scroller. When used on a line, scrollbit 4 must not be set, or this parameter will be ignored. A value of 128 is no scroll, values less than 128 scroll west, and values greater than 128 scroll east.
When used in a script, this value is zero-based, so 0 is no scroll, a positive value scrolls west, and a negative value scrolls east.
Controls the horizontal speed and direction of the scroller. When used on a line, scrollbit 4 must not be set, or this parameter will be ignored.. A value of 128 is no scroll, values less than 128 scroll south, and values greater than 128 scroll north.
When used in a script, this value is zero-based, so 0 is no scroll, a positive value scrolls north, and a negative value scrolls south.
As noted in the synopses above, Scroll_Ceiling behaves differently when you place it on a line compared to when you use it in a script. On a line, the effect takes place immediately when the map is loaded. In a script, the effect does not occur until the special is executed. Also, scripts do not take a scrollbits parameter, because the only meaningful combination of bits in a script is 0. When used on a line, you also need to add 128 to the values of x-move and y-move because you cannot use negative parameters on a line. In ACS, you can pass negative values to specials, so you do not need to add 128 to the values of x-move and y-move when you use this special in a script.
If you use Scroll_Ceiling in a script, this special can have three possible effects on a sector:
Note that this means you can use Scroll_Ceiling in a script to change a ceiling's scrolling behavior, starting and stopping it whenever you want. This is also possible using displacement and accelerative scrollers on a line, but it is a lot easier to set it up in a script.
The zero parameter is a placeholder for the scrollcarry parameter used by Scroll_Floor. A value of zero corresponds to "scroll the texture only," which is exactly how this special behaves. A future ZDoom might add the ability to also carries objects on the ceiling (such as hanging lamps). If this ever happens, the zero parameter will become a scrollcarry parameter just like Scroll_Floor's. Since it's not useful now, you can just omit it when you use this special in a script.
Place this special on a line to scroll the ceiling of sectors with tag 1 with a speed and direction determined by the line:
Scroll_Ceiling (1, 4, 0, 0, 0);
Place this special on a line to scroll the ceiling of any sector with tag 2 west one texel every two tics:
Scroll_Ceiling (2, 0, 0, 144, 128);
Use this special in a script to scroll the ceiling of any sector with tag 2 west one texel every two tics:
Scroll_Ceiling (2, 16, 0, 0); Scroll_Ceiling (2, 16, 0); // This will do the same thing
Use this special in a script to stop the ceiling scrolling in any sector with tag 5:
Scroll_Ceiling (5, 0, 0, 0); Scroll_Ceiling (5, 0, 0); // This will do the same thing
ZDoom 1.16
ZDoom 1.23 beta 8 added the ability to use this special in a script.