From a8e018d5078a59c941d63fc8e0dd74e4e20398a8 Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Mon, 31 May 2021 10:11:26 +0200 Subject: [PATCH] Adjust "scripted textures" for 4.6 compat. --- zscript.txt | 2 +- zscript/ammoled.zsc | 72 +++++++++++++++------------------------------ 2 files changed, 24 insertions(+), 50 deletions(-) diff --git a/zscript.txt b/zscript.txt index 936db8d..2bf503d 100644 --- a/zscript.txt +++ b/zscript.txt @@ -1,4 +1,4 @@ -version "4.3" +version "4.6" #include "zscript/dt_libeye/projector.txt" #include "zscript/dt_libeye/projector gl.txt" diff --git a/zscript/ammoled.zsc b/zscript/ammoled.zsc index fb8dcf6..40242ed 100644 --- a/zscript/ammoled.zsc +++ b/zscript/ammoled.zsc @@ -24,26 +24,14 @@ Class PulseGunLED : Actor SetZ(floorz); roll = 180; angle = 180; - double stretch = level.pixelstretch; - double halfstretch = (1.+level.pixelstretch)/2.; - if ( !base ) - { - base = Spawn("AmmoLEDScreen",(PULSELEDBASE,PULSELEDBASE-128.,floorz+64./halfstretch)); - base.scale.y /= level.pixelstretch; - } + double halfstretch = 1.+(level.pixelstretch-1.)/2.; + if ( !base ) base = Spawn("AmmoLEDScreen",(PULSELEDBASE,PULSELEDBASE-128.,floorz+64.*halfstretch)); for ( int i=0; i<3; i++ ) { if ( !digits[i] ) - { - digits[i] = Spawn("LEDFont",(PULSELEDBASE+1.,PULSELEDBASE-72.+48.*i,floorz+50./halfstretch)); - digits[i].scale.y /= level.pixelstretch; - } - } - if ( !bar ) - { - bar = Spawn("AmmoCountBar",(PULSELEDBASE+1.,PULSELEDBASE-98.,floorz-26./halfstretch)); - bar.scale.y /= level.pixelstretch; + digits[i] = Spawn("LEDFont",(PULSELEDBASE+1.,PULSELEDBASE-72.+48.*i,floorz+50.*halfstretch)); } + if ( !bar ) bar = Spawn("AmmoCountBar",(PULSELEDBASE+1.,PULSELEDBASE-98.,floorz-26.*halfstretch)); } override void Tick() { @@ -91,20 +79,12 @@ Class FlakCannonLED : Actor SetZ(floorz); roll = 180; angle = 180; - double stretch = level.pixelstretch; - double halfstretch = (1.+level.pixelstretch)/2.; - if ( !base ) - { - base = Spawn("AmmoLEDScreen",(FLAKLEDBASE,FLAKLEDBASE-64.,floorz+32./halfstretch)); - base.scale.y /= level.pixelstretch; - } + double halfstretch = 1.+(level.pixelstretch-1.)/2.; + if ( !base ) base = Spawn("AmmoLEDScreen",(FLAKLEDBASE,FLAKLEDBASE-64.,floorz+32.*halfstretch)); for ( int i=0; i<3; i++ ) { if ( !digits[i] ) - { - digits[i] = Spawn("LEDFont",(FLAKLEDBASE+1.,FLAKLEDBASE-30.+20.*i,floorz+16./halfstretch)); - digits[i].scale.y /= level.pixelstretch; - } + digits[i] = Spawn("LEDFont",(FLAKLEDBASE+1.,FLAKLEDBASE-30.+20.*i,floorz+16.*halfstretch)); } } override void Tick() @@ -142,20 +122,12 @@ Class MinigunLED : Actor SetZ(floorz); roll = 180; angle = 180; - double stretch = level.pixelstretch; - double halfstretch = (1.+level.pixelstretch)/2.; - if ( !base ) - { - base = Spawn("AmmoLEDScreen",(MINILEDBASE,MINILEDBASE-32.,floorz+32./halfstretch)); - base.scale.y /= level.pixelstretch; - } + double halfstretch = 1.+(level.pixelstretch-1.)/2.; + if ( !base ) base = Spawn("AmmoLEDScreen",(MINILEDBASE,MINILEDBASE-32.,floorz+32.*halfstretch)); for ( int i=0; i<3; i++ ) { if ( !digits[i] ) - { - digits[i] = Spawn("LEDFont",(MINILEDBASE+1.,MINILEDBASE-30.+20.*i,floorz+16./halfstretch)); - digits[i].scale.y /= level.pixelstretch; - } + digits[i] = Spawn("LEDFont",(MINILEDBASE+1.,MINILEDBASE-30.+20.*i,floorz+16.*halfstretch)); } } override void Tick() @@ -177,26 +149,28 @@ 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 stretch = level.pixelstretch; - double halfstretch = (1.+level.pixelstretch)/2.; - if ( !base ) - { - base = Spawn("AmmoLEDScreen",(ROCKETLEDBASE,ROCKETLEDBASE-32.,floorz+32./halfstretch)); - base.scale.y /= level.pixelstretch; - } + double halfstretch = 1.+(level.pixelstretch-1.)/2.; + if ( !base ) base = Spawn("AmmoLEDScreen",(ROCKETLEDBASE,ROCKETLEDBASE-32.,floorz+32.*halfstretch)); for ( int i=0; i<3; i++ ) { if ( !digits[i] ) - { - digits[i] = Spawn("LEDFont",(ROCKETLEDBASE+1.,ROCKETLEDBASE-30.+20.*i,floorz+16./halfstretch)); - digits[i].scale.y /= level.pixelstretch; - } + digits[i] = Spawn("LEDFont",(ROCKETLEDBASE+1.,ROCKETLEDBASE-30.+20.*i,floorz+16.*halfstretch)); } } override void Tick()