Synchronizing sector and line scroll speeds

Handy guides on how to do things, written by users for users.

Moderators: GZDoom Developers, Raze Developers

Forum rules
Please don't start threads here asking for help. This forum is not for requesting guides, only for posting them. If you need help, the Editing forum is for you.
Post Reply
Talon1024
 
 
Posts: 374
Joined: Mon Jun 27, 2016 7:26 pm
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support
Contact:

Synchronizing sector and line scroll speeds

Post by Talon1024 »

I'm sure there have been at least some mappers who have wanted to synchronize the scroll speeds between walls and flats in order to create the illusion of the player being on a subway, train or some other kind of moving vehicle.

You may have thought that you could just assign the same numbers to Scroll_Texture_Left/Right/Up/Down and/or Scroll_Floor/Ceiling, but you found that when you did so, your flats and walls were scrolling at different speeds! I think these gotchas are some of those relics of ZDoom's history.

So this tutorial explains how to set up scrolling so that your walls and flats move at the same speed.

First of all, you'll need a "base speed", like 5. I think this is the amount of pixels the wall or flat will scroll each tic.

For Scroll_Texture_Left/Right/Up/Down:

Code: Select all

arg0 = base speed * 64
For Scroll_Wall, the x and y values are given in fixed point, so just multiply the base speed by 65536:

Code: Select all

x = base speed * 65536
y = base speed * 65536
Note that assigning a line the Scroll_Wall special does not immediately start scrolling the wall, unlike Scroll_Texture_Left/Right/Up/Down, so you'll need to use the special on a wall with a switch, or an ACS script.

For Scroll_Floor and Scroll_Ceiling:

Code: Select all

xMove = base speed * 32 + 128
yMove = base speed * 32 + 128
Post Reply

Return to “Tutorials”