Rachael wrote:Yeah I definitely was not asking to apply that unconditionally across all maps. However, Ghost Town definitely is not the only map which makes use of this effect, and the effect should be applied per-map, but having a compatibility option for it lets us curate individual maps for it rather than having to do it manually as has been done in the PR.
So, I had some time (after over a year, I know) and I decided to rewrite this script so the particular cases can be added to the Level Postprocessor. I think this should handle most cases where specific maps require the fast scrolling effect, but I haven't had the time to figure out if this can be optimized somehow.
The biggest problem I found was that GZDoom outright separates all the Sidedefs, so counting multiple references to a single one of them separately simply wasn't going to happen. That's why the script compares front-side textures. This works for Plutonia's MAP05, but I haven't seen any maps that
require this effect that use a Linedef's back side, so that could be added if necessary.
Code: Select all
version "4.5"
CLASS PlFix : LevelPostProcessor
{
protected void Apply(Name checksum, String mapname)
{
switch (checksum)
{
case 'eb0d04aeb2841d5225caa576d7300d43': // Plutonia.wad MAP05
{
int speed = 64;
int scrollers[64]; // Max number of possible scrollers in vanilla levels
int multipliers[63] = {0};
int currentscroller = 0;
int maxscrollers;
String textures[3];
for (int i = 0; i < level.lines.Size(); i++)
{
if (level.lines[i].special == 100)
{
scrollers[currentscroller] = level.lines[i].Index();
currentscroller++;
if (currentscroller >= 64)
break;
}
}
maxscrollers = currentscroller;
currentscroller = 0;
textures[0] = TexMan.GetName(level.lines[scrollers[0]].sidedef[0].GetTexture(0));
textures[1] = TexMan.GetName(level.lines[scrollers[0]].sidedef[0].GetTexture(1));
textures[2] = TexMan.GetName(level.lines[scrollers[0]].sidedef[0].GetTexture(2));
for (int j = 0; j < maxscrollers; j++)
{
// This would never work for non-compressed levels...
if (!(TexMan.GetName(level.lines[scrollers[j]].sidedef[0].GetTexture(0)) == textures[0] &&
TexMan.GetName(level.lines[scrollers[j]].sidedef[0].GetTexture(1)) == textures[1] &&
TexMan.GetName(level.lines[scrollers[j]].sidedef[0].GetTexture(2)) == textures[2]))
{
currentscroller++;
textures[0] = TexMan.GetName(level.lines[scrollers[j]].sidedef[0].GetTexture(0));
textures[1] = TexMan.GetName(level.lines[scrollers[j]].sidedef[0].GetTexture(1));
textures[2] = TexMan.GetName(level.lines[scrollers[j]].sidedef[0].GetTexture(2));
}
multipliers[currentscroller]++;
}
currentscroller = 0;
textures[0] = TexMan.GetName(level.lines[scrollers[0]].sidedef[0].GetTexture(0));
textures[1] = TexMan.GetName(level.lines[scrollers[0]].sidedef[0].GetTexture(1));
textures[2] = TexMan.GetName(level.lines[scrollers[0]].sidedef[0].GetTexture(2));
for (int k = 0; k < maxscrollers; k++)
{
if (!(TexMan.GetName(level.lines[scrollers[k]].sidedef[0].GetTexture(0)) == textures[0] &&
TexMan.GetName(level.lines[scrollers[k]].sidedef[0].GetTexture(1)) == textures[1] &&
TexMan.GetName(level.lines[scrollers[k]].sidedef[0].GetTexture(2)) == textures[2]))
{
currentscroller++;
textures[0] = TexMan.GetName(level.lines[scrollers[k]].sidedef[0].GetTexture(0));
textures[1] = TexMan.GetName(level.lines[scrollers[k]].sidedef[0].GetTexture(1));
textures[2] = TexMan.GetName(level.lines[scrollers[k]].sidedef[0].GetTexture(2));
}
level.lines[scrollers[k]].args[0] = speed*multipliers[currentscroller];
}
}
}
}
}
You do not have the required permissions to view the files attached to this post.