Every time I find another bug in this that I have to fix, I wish harder and harder for scripted textures to be a thing in GZDoom. I have managed to fix ONE issue with this, but another remains that appears entirely unfixable. I just cannot wrap my head around why this is broken in some Eviternity maps still. I've debugged everything I could, I've checked all possible parameters that could be responsible for the odd vertical offsetting, but nothing. ABSOLUTELY NOTHING explains why it's happening. It's just broken, simply broken like that, there is no explanation for it, the engine is just mocking me at this point. I seriously really REALLY wish there was a better way to do this, but alas, no, there simply isn't. Unless someone goes and makes it possible to draw directly to textures like in UT99, this will remain forever broken. That's just how it is. This is the last time I try to fix any more bugs related to this specific part of the code. The mod is supposed to no longer receive updates, so I'll just stop. No more. If I have to live with this constant reminder of the engine's nonsense, so will all who play the mod as well. -- Marisa
259 lines
5.7 KiB
Text
259 lines
5.7 KiB
Text
const PULSELEDBASE = 60000.;
|
|
const FLAKLEDBASE = 61000.;
|
|
const MINILEDBASE = 62000.;
|
|
const ROCKETLEDBASE = 63000.;
|
|
|
|
Class PulseGunLED : Actor
|
|
{
|
|
Actor base, digits[3], bar;
|
|
transient PulseGun mygun;
|
|
|
|
Default
|
|
{
|
|
+NOGRAVITY;
|
|
+NOBLOCKMAP;
|
|
+NOINTERACTION;
|
|
+DONTSPLASH;
|
|
Radius .1;
|
|
Height 0;
|
|
}
|
|
|
|
override void PostBeginPlay()
|
|
{
|
|
SetOrigin((PULSELEDBASE+128.,PULSELEDBASE,0),false);
|
|
SetZ(floorz);
|
|
roll = 180;
|
|
angle = 180;
|
|
double halfstretch = (1.+level.pixelstretch)/2.;
|
|
double zofs = (ceilingz>floorz)?CurSector.GetFloorTerrain(0).footclip*16.:0.;
|
|
if ( !base ) base = Spawn("AmmoLEDScreen",(PULSELEDBASE,PULSELEDBASE-128.,pos.z+64.*halfstretch-zofs));
|
|
for ( int i=0; i<3; i++ )
|
|
{
|
|
if ( !digits[i] )
|
|
digits[i] = Spawn("LEDFont",(PULSELEDBASE+1.,PULSELEDBASE-72.+48.*i,pos.z+50.*halfstretch-zofs));
|
|
}
|
|
if ( !bar ) bar = Spawn("AmmoCountBar",(PULSELEDBASE+1.,PULSELEDBASE-98.,pos.z-26.*halfstretch-zofs));
|
|
}
|
|
override void Tick()
|
|
{
|
|
if ( !mygun ) return;
|
|
base.SetState(base.SpawnState);
|
|
int amo = flak_pulsereload?mygun.ClipCount:mygun.Ammo1.Amount;
|
|
int mamo = flak_pulsereload?mygun.default.ClipCount:mygun.Ammo1.MaxAmount;
|
|
digits[0].SetState(digits[0].SpawnState+1+((amo/100)%10));
|
|
digits[1].SetState(digits[1].SpawnState+1+((amo/10)%10));
|
|
digits[2].SetState(digits[2].SpawnState+1+(amo%10));
|
|
if ( amo < 10 )
|
|
{
|
|
digits[0].SetShade(Color(255,0,0));
|
|
digits[1].SetShade(Color(255,0,0));
|
|
digits[2].SetShade(Color(255,0,0));
|
|
}
|
|
else
|
|
{
|
|
digits[0].SetShade(Color(0,0,255));
|
|
digits[1].SetShade(Color(0,0,255));
|
|
digits[2].SetShade(Color(0,0,255));
|
|
}
|
|
bar.scale.x = amo/double(mamo);
|
|
}
|
|
}
|
|
|
|
Class FlakCannonLED : Actor
|
|
{
|
|
Actor base, digits[3];
|
|
transient FlakCannon mygun;
|
|
|
|
Default
|
|
{
|
|
+NOGRAVITY;
|
|
+NOBLOCKMAP;
|
|
+NOINTERACTION;
|
|
+DONTSPLASH;
|
|
Radius .1;
|
|
Height 0;
|
|
}
|
|
|
|
override void PostBeginPlay()
|
|
{
|
|
SetOrigin((FLAKLEDBASE+64,FLAKLEDBASE,0),false);
|
|
SetZ(floorz);
|
|
roll = 180;
|
|
angle = 180;
|
|
double halfstretch = (1.+level.pixelstretch)/2.;
|
|
double zofs = (ceilingz>floorz)?CurSector.GetFloorTerrain(0).footclip*16.:0.;
|
|
if ( !base ) base = Spawn("AmmoLEDScreen",(FLAKLEDBASE,FLAKLEDBASE-64.,floorz+32.*halfstretch-zofs));
|
|
for ( int i=0; i<3; i++ )
|
|
{
|
|
if ( !digits[i] )
|
|
digits[i] = Spawn("LEDFont",(FLAKLEDBASE+1.,FLAKLEDBASE-30.+20.*i,floorz+16.*halfstretch-zofs);
|
|
}
|
|
}
|
|
override void Tick()
|
|
{
|
|
if ( !mygun ) return;
|
|
base.SetState(base.SpawnState+1);
|
|
int amo = mygun.Ammo1.Amount;
|
|
digits[0].SetState(digits[0].SpawnState+11+((amo/100)%10));
|
|
digits[1].SetState(digits[1].SpawnState+11+((amo/10)%10));
|
|
digits[2].SetState(digits[2].SpawnState+11+(amo%10));
|
|
digits[0].SetShade(Color(255,0,0));
|
|
digits[1].SetShade(Color(255,0,0));
|
|
digits[2].SetShade(Color(255,0,0));
|
|
}
|
|
}
|
|
|
|
Class MinigunLED : Actor
|
|
{
|
|
Actor base, digits[3];
|
|
transient Minigun mygun;
|
|
|
|
Default
|
|
{
|
|
+NOGRAVITY;
|
|
+NOBLOCKMAP;
|
|
+NOINTERACTION;
|
|
+DONTSPLASH;
|
|
Radius .1;
|
|
Height 0;
|
|
}
|
|
|
|
override void PostBeginPlay()
|
|
{
|
|
SetOrigin((MINILEDBASE+32,MINILEDBASE,0),false);
|
|
SetZ(floorz);
|
|
roll = 180;
|
|
angle = 180;
|
|
double halfstretch = (1.+level.pixelstretch)/2.;
|
|
double zofs = (ceilingz>floorz)?CurSector.GetFloorTerrain(0).footclip*16.:0.;
|
|
if ( !base ) base = Spawn("AmmoLEDScreen",(MINILEDBASE,MINILEDBASE-32.,floorz+32.*halfstretch-zofs));
|
|
for ( int i=0; i<3; i++ )
|
|
{
|
|
if ( !digits[i] )
|
|
digits[i] = Spawn("LEDFont",(MINILEDBASE+1.,MINILEDBASE-30.+20.*i,floorz+16.*halfstretch-zofs));
|
|
}
|
|
}
|
|
override void Tick()
|
|
{
|
|
if ( !mygun ) return;
|
|
base.SetState(base.SpawnState+2);
|
|
int amo = mygun.Ammo1.Amount;
|
|
digits[0].SetState(digits[0].SpawnState+11+((amo/100)%10));
|
|
digits[1].SetState(digits[1].SpawnState+11+((amo/10)%10));
|
|
digits[2].SetState(digits[2].SpawnState+11+(amo%10));
|
|
digits[0].SetShade(Color(255,0,0));
|
|
digits[1].SetShade(Color(255,0,0));
|
|
digits[2].SetShade(Color(255,0,0));
|
|
}
|
|
}
|
|
|
|
Class UTRocketLauncherLED : Actor
|
|
{
|
|
Actor base, digits[3];
|
|
transient UTRocketLauncher mygun;
|
|
|
|
Default
|
|
{
|
|
+NOGRAVITY;
|
|
+NOBLOCKMAP;
|
|
+NOINTERACTION;
|
|
+DONTSPLASH;
|
|
Radius .1;
|
|
Height 0;
|
|
}
|
|
|
|
override void PostBeginPlay()
|
|
{
|
|
SetOrigin((ROCKETLEDBASE+32,ROCKETLEDBASE,0),false);
|
|
SetZ(floorz);
|
|
roll = 180;
|
|
angle = 180;
|
|
double halfstretch = (1.+level.pixelstretch)/2.;
|
|
double zofs = (ceilingz>floorz)?CurSector.GetFloorTerrain(0).footclip*16.:0.;
|
|
if ( !base ) base = Spawn("AmmoLEDScreen",(ROCKETLEDBASE,ROCKETLEDBASE-32.,floorz+32.*halfstretch-zofs));
|
|
for ( int i=0; i<3; i++ )
|
|
{
|
|
if ( !digits[i] )
|
|
digits[i] = Spawn("LEDFont",(ROCKETLEDBASE+1.,ROCKETLEDBASE-30.+20.*i,floorz+16.*halfstretch-zofs));
|
|
}
|
|
}
|
|
override void Tick()
|
|
{
|
|
if ( !mygun ) return;
|
|
base.SetState(base.SpawnState+3);
|
|
int amo = mygun.Ammo1.Amount;
|
|
digits[0].SetState(digits[0].SpawnState+11+((amo/100)%10));
|
|
digits[1].SetState(digits[1].SpawnState+11+((amo/10)%10));
|
|
digits[2].SetState(digits[2].SpawnState+11+(amo%10));
|
|
digits[0].SetShade(Color(255,0,0));
|
|
digits[1].SetShade(Color(255,0,0));
|
|
digits[2].SetShade(Color(255,0,0));
|
|
}
|
|
}
|
|
|
|
Class LEDFont : Actor
|
|
{
|
|
Default
|
|
{
|
|
RenderStyle "Shaded";
|
|
StencilColor "FF 00 00";
|
|
Radius .1;
|
|
Height 0.;
|
|
RenderRadius 131072;
|
|
+NOBLOCKMAP;
|
|
+NOGRAVITY;
|
|
+NOINTERACTION;
|
|
+DONTSPLASH;
|
|
+WALLSPRITE;
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
TNT1 A -1;
|
|
LFN1 ABCDEFGHIJ -1 Bright;
|
|
LFN2 ABCDEFGHIJ -1 Bright;
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class AmmoCountBar : Actor
|
|
{
|
|
Default
|
|
{
|
|
Radius .1;
|
|
Height 0.;
|
|
RenderRadius 131072;
|
|
+NOBLOCKMAP;
|
|
+NOGRAVITY;
|
|
+NOINTERACTION;
|
|
+DONTSPLASH;
|
|
+WALLSPRITE;
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
AMCB A -1 Bright;
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
Class AmmoLEDScreen : Actor
|
|
{
|
|
Default
|
|
{
|
|
Radius .1;
|
|
Height 0.;
|
|
RenderRadius 131072;
|
|
+NOBLOCKMAP;
|
|
+NOGRAVITY;
|
|
+NOINTERACTION;
|
|
+DONTSPLASH;
|
|
+WALLSPRITE;
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
AMLD ABCD -1 Bright;
|
|
Stop;
|
|
}
|
|
}
|