System Smooth Unit Modification

Weep

Godspeed to the sound of the pounding
Reaction score
400
Oh, hm, I guess I was mixing the version of SUM from the demo map with the version of UnitApperance from the post. It was the GetUnitRedColor, etc. functions. I had problems the first time I tried to paste the version from the original post. :p

I should re-test the problems I saw with starting two FadeUnitRGB's in a row.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Actually, while I tested my newest version of it it didn't even work XD

So I redid some stuff, and now it should work fine :D
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Yeah, I'm gonna as soon as I've fixed a few more bugs I found in this system...

First one is that it's extremely inaccurate, e.g I use this:
JASS:
        call FadeUnitRGB( u, 2.0, -32, -150, -200, 0 )


Just to test it simply, and the outcome of the real vertex colors the unit has after the fade, is Red: 255 Green: 129 Blue: 66... ?!?!?!?!?!?!?!?!

Why would this happen ?

This is what I'm using:
JASS:
library SmoothUnitMod requires T32, UnitAppearance

///////////////////////////////////////////////////////////////////////////////////////////////////////
//***************************************************************************************************//
//@@//////////////////////////////// *//SmoothUnitModification\\* /////////////////////////////////@@//
//@@                                                                                               @@//
//@@                                                                                               @@//
//@@           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%            @@//
//@@           %%                                                                    %%            @@//
//@@           %%        /////////     ///          \\\   ///\\\            ///\\\   %%            @@//
//@@           %%      /////    ////   ///          \\\   ///\\\            ///\\\   %%            @@//
//@@           %%     /////            ///          \\\   /// \\\          /// \\\   %%            @@//
//@@           %%    /////             ///          \\\   /// \\\          /// \\\   %%            @@//
//@@           %%     /////            ///          \\\   ///  \\\        ///  \\\   %%            @@//
//@@           %%      /////           ///          \\\   ///  \\\        ///  \\\   %%            @@//
//@@           %%       ////\\\\       ///          \\\   ///   \\\      ///   \\\   %%            @@//
//@@           %%           \\\\\      ////        \\\\   ///   \\\      ///   \\\   %%            @@//
//@@           %%            \\\\\     ////        \\\\   ///    \\\    ///    \\\   %%            @@//
//@@           %%              \\\\    ////        \\\\   ///    \\\    ///    \\\   %%            @@//
//@@           %%            \\\\\      ////      \\\\    ///     \\\  ///     \\\   %%            @@//
//@@           %%   \\\\    \\\\\        ////    \\\\     ///     \\\  ///     \\\   %%            @@//
//@@           %%      \\\\\\\\             ///\\\        ///      \\\///      \\\   %%            @@//
//@@           %%                                                                    %%            @@//
//@@           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%            @@//
//@@                                                                                               @@//
//@@                                                                                               @@//
//@@                                                                                               @@//
//@@                                                                                               @@//
//@@                                    Made by , Komaqtion                                        @@//
//@@                                                                                               @@//
//@@                                                                                               @@//
//@@                                          Purpose:                                             @@//
//@@                                                                                               @@//
//@@             ¤ This is a system, which will give the user the opportunity to easily modify     @@//
//@@               3 main aspects of units: Scale, ARGB color and Time Scale (Animation Speed).    @@//
//@@                                                                                               @@//
//@@                                           Usage:                                              @@//
//@@                                                                                               @@//
//@@             ¤ The function that this system provides the user are:                            @@//
//@@                                                                                               @@//
//@@             function ScaleSimple takes unit Scaler, real Time, real scaleMod                  @@//
//@@             function ScaleEx takes unit Scaler, real Time, real scaleMod, code userFunc       @@//
//@@                                                                                               @@//
//@@               "Scaler" is the unit which is to be scaled.                                     @@//
//@@               "Time" is basically, over how long time will the unit scale...                  @@//
//@@               "scaleMod" is how much the unit's scale will change, example:                   @@//
//@@               "userFunc" is the callback, if wanted, the system will execute                  @@//
//@@               when the scaling is done.                                                       @@//
//@@               Example:                                                                        @@//
//@@                                                                                               @@//
//@@               call ScaleSimple( GetTriggerUnit(), 2.0, 0.5 )                                  @@//
//@@                                                                                               @@//
//@@               Will scale the unit to +50% over 2 seconds.                                     @@//
//@@               And, also the modification is in decimal form, meaning that 1.0 will            @@//
//@@               double the unit's size...                                                       @@//
//@@                                                                                               @@//
//@@               The timescale part of this system is basically the same as this, and uses       @@//
//@@               the same amount of "takes"...                                                   @@//
//@@                                                                                               @@//
//@@               The fade part, on the other hand, has more "takes", simply because it handles   @@//
//@@               the red, green and blue colors too, and not only transparency...                @@//
//@@               An example:                                                                     @@//
//@@                                                                                               @@//
//@@               call FadeEX( GetTriggerUnit(), 2.0, 0.0, -255, -255, -127.5 )                   @@//
//@@                                                                                               @@//
//@@               This little sample will make the unit 50% transparent, and also RED.            @@//
//@@               And all the arguments here ranges from 0.0 - 255.0, meaning that a 50%          @@//
//@@               transparent unit has an alpha value of 127.5...                                 @@//
//@@                                                                                               @@//
//@@               You can also use this system to "get" any of the values you can change with     @@//
//@@               it, using functions like this:                                                  @@//
//@@                                                                                               @@//
//@@               function GetUnitScale takes unit u returns real                                 @@//
//@@                                                                                               @@//
//@@               Which will give you the current scale of the unit...                            @@//
//@@                                                                                               @@//
//@@                                           Note:                                               @@//
//@@                                                                                               @@//
//@@             ¤ This system does not support pre-changed RGB colors from the Object Editor,     @@//
//@@               and I'd suggest you manually change the color of the units in-game instead.     @@//
//@@               It presumes that all colors of all units are set to 255 from the start !        @@//
//@@                                                                                               @@//
//@@                                       Requirements:                                           @@//
//@@                                                                                               @@//
//@@             ¤ A vJASS preprocessor, which is easiest found by downloading JASS Newgen Pack    @@//
//@@               <a href="http://www.thehelper.net/forums/showthread.php?t=73936" class="link link--internal">http://www.thehelper.net/forums/showthread.php?t=73936</a>                          @@//
//@@               You&#039;ll also have to update JASS Helper to the latest version...                 @@//
//@@               And, then you&#039;ll need the system called Timer32 (T32), and also my other        @@//
//@@               system, called &quot;UnitAppearance&quot; <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin    :D" loading="lazy" data-shortname=":D" />                                              @@//
//@@                                                                                               @@//
//@@                                         Credits:                                              @@//
//@@                                                                                               @@//
//@@             ¤ Viikuna, for helping me out, and also helping me make &quot;UnitAppearance&quot; !        @@//
//@@               Jesus4Lyf, for also helping me out alot, and making Timer 32 ! <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin    :D" loading="lazy" data-shortname=":D" />               @@//
//@@               Azlier, for some help too <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin    :D" loading="lazy" data-shortname=":D" />                                                    @@//
//@@                                                                                               @@//
//@@               And credits, if you use this that is, is not needed to give me                  @@//
//@@               though it&#039;s always welcome <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite2" alt=";)" title="Wink    ;)" loading="lazy" data-shortname=";)" />                                                   @@//
//@@                                                                                               @@//
//@@///////////////////////////////////////////////////////////////////////////////////////////////@@//
//***************************************************************************************************//
///////////////////////////////////////////////////////////////////////////////////////////////////////

    struct SmoothScaleChange
    
        private integer ticks
        
        private real increment
        
        private unit u
        
        private method periodic takes nothing returns nothing
            set this.ticks = this.ticks - 1
        
            call ModifyUnitScale( this.u, this.increment ) // This will save the scale of the unit in a struct using AIDS...
            
            debug call BJDebugMsg( &quot;#SUM# - Scale: &quot; + R2S( Appearance[ this.u ].scale ) )
            
            if this.ticks &lt;= 0 then
                call this.destroy() // When ticks becomes 0 (Meaning that the scaling is done) destroy it ! <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin    :D" loading="lazy" data-shortname=":D" />
                
                call this.stopPeriodic()
            endif
            
        endmethod
        
        implement T32x
        
        static method create takes unit Scaler, real Time, real scaleMod returns thistype
            local thistype this = thistype.allocate()
            
            set this.u = Scaler // Which unit to scale XD
            set this.increment = ( ( scaleMod * T32_PERIOD ) / Time ) // How much the scale will increase each PERIOD...
            set this.ticks = R2I( scaleMod / this.increment ) // How many times the timer must fire...
            
            call this.startPeriodic()
            
            return this
        endmethod
        
    endstruct
    
    function ScaleUnit takes unit Scaler, real Time, real scaleMod returns SmoothScaleChange
        return SmoothScaleChange.create( Scaler, Time, scaleMod )
    endfunction
    
    function GetUnitScale takes unit u returns real
        return Appearance[ u ].scale
    endfunction
    
    struct SmoothColorChange
    
        private integer ticks
        
        private real rincrement
        private real gincrement
        private real bincrement
        private real increment
        
        private unit u
        
        private method periodic takes nothing returns nothing
            set this.ticks = this.ticks - 1
        
            call ModifyUnitVertexColor( this.u, R2I( this.rincrement ), R2I( this.gincrement ), R2I( this.bincrement ), R2I( this.increment ) )
            
            /*debug call BJDebugMsg( &quot;#SUM# - Alpha: &quot; + R2S( Appearance[this.u].alpha ) )
            debug call BJDebugMsg( &quot;#SUM# - Red: &quot; + R2S( Appearance[this.u].red ) )
            debug call BJDebugMsg( &quot;#SUM# - Green: &quot; + R2S( Appearance[this.u].green ) )
            debug call BJDebugMsg( &quot;#SUM# - Blue: &quot; + R2S( Appearance[this.u].blue ) )*/
            
            if this.ticks &lt;= 0 then
                call this.destroy()
                
                call this.stopPeriodic()
            endif
            
        endmethod
        
        implement T32x
        
        static method create takes unit Fader, real Time, real redMod, real greenMod, real blueMod, real alphaMod returns thistype
            local thistype this = thistype.allocate()
            
            set this.u = Fader
            set this.increment = ( ( alphaMod * T32_PERIOD ) / Time )
            set this.rincrement = ( ( redMod * T32_PERIOD ) / Time )
            set this.gincrement = ( ( greenMod * T32_PERIOD ) / Time )
            set this.bincrement = ( ( blueMod * T32_PERIOD ) / Time )
            
            /*if alphaMod != 0 then
                set this.ticks = R2I( alphaMod / this.increment )
            elseif redMod != 0 then
                set this.ticks = R2I( redMod / this.rincrement )
            elseif greenMod != 0 then
                set this.ticks = R2I( greenMod / this.gincrement )
            elseif blueMod != 0 then
                set this.ticks = R2I( blueMod / this.bincrement )
            endif*/
            
            set this.ticks = R2I( Time / T32_PERIOD )
            
            call this.startPeriodic()
            
            return this
        endmethod
        
    endstruct
    
    function FadeUnit takes unit Fader, real Time, real alphaMod returns SmoothColorChange
        return SmoothColorChange.create( Fader, Time, 0., 0., 0., alphaMod )
    endfunction
    
    function FadeUnitRGB takes unit Fader, real Time, real redMod, real greenMod, real blueMod, real alphaMod returns SmoothColorChange
        return SmoothColorChange.create( Fader, Time, redMod, greenMod, blueMod, alphaMod )
    endfunction
    
    function GetUnitColorAlpha takes unit u returns integer
        return R2I( Appearance[ u ].alpha )
    endfunction

    function GetUnitColorRed takes unit u returns integer
        return R2I( Appearance[ u ].red )
    endfunction
    
    function GetUnitColorGreen takes unit u returns integer
        return R2I( Appearance[ u ].green )
    endfunction
    
    function GetUnitColorBlue takes unit u returns integer
        return R2I( Appearance[ u ].blue )
    endfunction
    
    struct SmoothTSChange
    
        //private code userFunc
        private integer ticks
        
        private real increment
        
        private unit u
        
        private method periodic takes nothing returns nothing
            set this.ticks = this.ticks - 1
        
            call ModifyUnitTimeScale( this.u, this.increment )
            
            debug call BJDebugMsg( &quot;#SUM# - Timescale :&quot; + R2S( Appearance[ this.u ].timescale ) )
            
            if this.ticks &lt;= 0 then
                call this.destroy()
                
                call this.stopPeriodic()
            endif
            
        endmethod
        
        implement T32x
        
        static method create takes unit Timer, real Time, real timescaleMod returns thistype
            local thistype this = thistype.allocate()
            
            set this.u = Timer
            //set this.userFunc = userFunc
            set this.increment = ( ( timescaleMod * T32_PERIOD ) / Time )
            set this.ticks = R2I( timescaleMod / this.increment ) // How many times the timer must fire...
            
            call this.startPeriodic()
            
            return this
        endmethod
        
    endstruct
    
    function ChangeTimeScale takes unit Timer, real Time, real timescaleMod returns SmoothTSChange
        return SmoothTSChange.create( Timer, Time, timescaleMod )
    endfunction
    
    function GetUnitTimeScale takes unit u returns real
        return Appearance[ u ].timescale
    endfunction

endlibrary


JASS:
library UnitAppearance requires AIDS

    struct Appearance extends array
        //! runtextmacro AIDS()

        real scale
        
        real timescale
        
        real alpha
        real red
        real green
        real blue
        
        private method AIDS_onCreate takes nothing returns nothing
            set this.scale = 1.0
            
            set this.alpha = 255.0
            set this.red = 255.0
            set this.green = 255.0
            set this.blue = 255.0
            
            set this.timescale = 1.0
        endmethod
        
    endstruct

    function ModifyUnitScale takes unit u, real addscale returns nothing
        local Appearance this = Appearance[ u ]
        
        if this.scale &gt; 0 then
            set this.scale = this.scale + addscale
            
            call SetUnitScale( this.unit, this.scale, 0.,0. )
        endif
        
    endfunction
    
    function ModifyUnitVertexColor takes unit u, real addred, real addgreen, real addblue, real addalpha returns nothing
        local Appearance this = Appearance[ u ]
        
        if this.alpha &gt; 0 then
            set this.alpha = this.alpha + addalpha
        endif
        
        if this.red &gt; 0 then
            set this.red = this.red + addred
        endif
        
        if this.green &gt; 0 then
            set this.green = this.green + addgreen
        endif
        
        if this.blue &gt; 0 then
            set this.blue = this.blue + addblue
        endif
        
        if this.alpha &gt; 0 or this.red &gt; 0 or this.green &gt; 0 or this.blue &gt; 0 then
            call SetUnitVertexColor( this.unit, R2I( this.red ), R2I( this.green ), R2I( this.blue ), R2I( this.alpha ) )
        endif
        
    endfunction
    
    function ModifyUnitTimeScale takes unit u, real addtimescale returns nothing
        local Appearance this = Appearance[ u ]
        
        if this.timescale &gt; 0 then
            set this.timescale = this.timescale + addtimescale
        
            call SetUnitTimeScale( this.unit, this.timescale )
        endif
    endfunction
    
endlibrary


As you can see I've made some small changes here and there, but nothing major...

I'd believe this is because you need to use integers when setting the vertex colors, but there's no other way of doing it, right ? :S
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Ok, so I've now updated this quite a bit, and it should now be VERY accurate ! :D

The documentation has also undergone an EXTREME makeover, and I'd now like to say it is very structured, and well written :p

I'm not too sure if I'm satisfied about the function names though... :S
Comment on them, please ! :D

Anyways, here's the new version:

JASS:
library SmoothUnitMod requires T32, UnitAppearance

///////////////////////////////////////////////////////////////////////////////////////////////////////////
//*******************************************************************************************************//
//@@////////////////////////////////// *//SmoothUnitModification\\* ///////////////////////////////////@@//
//@@                                                                                                   @@//
//@@                                                                                                   @@//
//@@             %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%              @@//
//@@             %%                                                                    %%              @@//
//@@             %%        /////////     ///          \\\   ///\\\            ///\\\   %%              @@//
//@@             %%      /////    ////   ///          \\\   ///\\\            ///\\\   %%              @@//
//@@             %%     /////            ///          \\\   /// \\\          /// \\\   %%              @@//
//@@             %%    /////             ///          \\\   /// \\\          /// \\\   %%              @@//
//@@             %%     /////            ///          \\\   ///  \\\        ///  \\\   %%              @@//
//@@             %%      /////           ///          \\\   ///  \\\        ///  \\\   %%              @@//
//@@             %%       ////\\\\       ///          \\\   ///   \\\      ///   \\\   %%              @@//
//@@             %%           \\\\\      ////        \\\\   ///   \\\      ///   \\\   %%              @@//
//@@             %%            \\\\\     ////        \\\\   ///    \\\    ///    \\\   %%              @@//
//@@             %%              \\\\    ////        \\\\   ///    \\\    ///    \\\   %%              @@//
//@@             %%            \\\\\      ////      \\\\    ///     \\\  ///     \\\   %%              @@//
//@@             %%   \\\\    \\\\\        ////    \\\\     ///     \\\  ///     \\\   %%              @@//
//@@             %%      \\\\\\\\             ///\\\        ///      \\\///      \\\   %%              @@//
//@@             %%                                                                    %%              @@//
//@@             %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%              @@//
//@@                                                                                                   @@//
//@@                                                                                                   @@//
//@@                                                                                                   @@//
//@@                                        Made by , Komaqtion                                        @@//
//@@                                                                                                   @@//
//@@                                                                                                   @@//
//@@                                              Purpose:                                             @@//
//@@                                                                                                   @@//
//@@             ¤ This is a system, which will give the user the opportunity to easily modify         @@//
//@@               3 main aspects of units: Scale, ARGB color and Time Scale (Animation Speed).        @@//
//@@                                                                                                   @@//
//@@                                               Usage:                                              @@//
//@@                                                                                                   @@//
//@@             ¤ The first functions that this system provides the user are all about                @@//
//@@               &#039;scaling&#039;, and they look like this:                                                 @@//
//@@                                                                                                   @@//
//@@  -&gt;       function ScaleUnitByValue takes unit Modifier, real Time,                               @@//
//@@                      real scaleMod returns SmoothScaleChange                                      @@//
//@@                                                                                                   @@//
//@@               &quot;unit Modifier&quot; is the unit which is to be modifier                                 @@//
//@@               (Scaled, Faded or Timescaled).                                                      @@//
//@@               &quot;real Time&quot; is, basically, over how long time will the unit scale...                @@//
//@@               &quot;real scaleMod&quot; is how much you want the &quot;Modifier&quot;s scale to change.               @@//
//@@               This is used to modify a unit&#039;s scale, not setting it to a specific value.          @@//
//@@               And by modifying I mean e.g set it to 0.5 less than it is now...                    @@//
//@@               &quot;returns SmoothScaleChange&quot;: Since these functions inlines to a struct-             @@//
//@@               creation, just thought it might as well returns that struct too <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite7" alt=":p" title="Stick Out Tongue    :p" loading="lazy" data-shortname=":p" />                  @@//
//@@                                                                                                   @@//
//@@  -&gt;       function ScaleUnitToValue takes unit Modifier, real Time,                               @@//
//@@                      real scaleValue returns SmoothScaleChange                                    @@//
//@@                                                                                                   @@//
//@@               &quot;unit Modifier&quot; is the unit which is to be modifier                                 @@//
//@@               (Scaled, Faded or Timescaled).                                                      @@//
//@@               &quot;real Time&quot; is, basically, over how long time will the unit scale...                @@//
//@@               &quot;real scaleValue&quot; is to what value you want the modifier&#039;s scale to change to.      @@//
//@@               Unlike that &quot;ScaleUnitByValue&quot; function, here you input a specific value            @@//
//@@               you want the unit to be scaled to.                                                  @@//
//@@               &quot;returns SmoothScaleChange&quot;: Since these functions inlines to a struct-             @@//
//@@               creation, just thought it might as well returns that struct too <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite7" alt=":p" title="Stick Out Tongue    :p" loading="lazy" data-shortname=":p" />                  @@//
//@@                                                                                                   @@//
//@@  -&gt;       function GetUnitScale takes unit u returns real                                         @@//
//@@                                                                                                   @@//
//@@               &quot;unit u&quot; is the unit of which scale you wish to retrieve.                           @@//
//@@               &quot;returns real&quot;: This is the current scale of the unit.                              @@//
//@@                                                                                                   @@//
//@@               And here&#039;s an example of how to use these &quot;scaling&quot; functions:                      @@//
//@@                                                                                                   @@//
//@@       call ScaleUnitToValue( GetTriggerUnit(), 2.0, GetUnitScale( GetTriggerUnit() ) / 2. )       @@//
//@@                                                                                                   @@//
//@@               Will scale the triggering unit to half it&#039;s current size over 2 seconds.            @@//
//@@                                                                                                   @@//
//@@               Now we get to the time-scale part of the API, which consists                        @@//
//@@               these three functions (Which are noticably like the &#039;scaling&#039; functions ):          @@//
//@@                                                                                                   @@//
//@@  -&gt;       function ChangeTimeScaleByValue takes unit Modifier, real Time,                         @@//
//@@                       real timescaleMod returns SmoothTSChange                                    @@//
//@@                                                                                                   @@//
//@@  -&gt;       function ChangeTimeScaleToValue takes unit Modifier, real Time,                         @@//
//@@                       real timescaleValue returns SmoothTSChange                                  @@//
//@@                                                                                                   @@//
//@@  -&gt;       function GetUnitTimeScale takes unit u returns real                                     @@//
//@@                                                                                                   @@//
//@@               These functions, and their parameters, work exactly the same as the &quot;scaling&quot;       @@//
//@@               part of this system/snippet:                                                        @@//
//@@                                                                                                   @@//
//@@               &quot;unit Modifier&quot; is the unit you wish to change the time-scale of.                   @@//
//@@               &quot;real Time&quot; is the amount of time you wish the modification should take.            @@//
//@@               &quot;real timescaleMod/Value&quot; is, as in the &quot;scaling&quot; functions, the amount             @@//
//@@               you want the unit&#039;s time-scale to change by/to.                                     @@//
//@@               &quot;returns SmoothTSChange&quot;, just as in the &quot;scaling&quot; functions, this inlines          @@//
//@@               to a struct-creation, so it also returns that <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin    :D" loading="lazy" data-shortname=":D" />                                    @@//
//@@                                                                                                   @@//
//@@               And the &quot;GetUnitTimeScale&quot; function takes the unit you wish to get the              @@//
//@@               time-scale of, and it will return the current time-scale of that unit.              @@//
//@@                                                                                                   @@//
//@@               As said, the scaling and time-scaling parts of this snippet are very much           @@//
//@@               alike, but now we get to the more advanced and extended part of it:                 @@//
//@@               The smooth coloring and fading of units !                                           @@//
//@@                                                                                                   @@//
//@@               And all of these function have more parameters than the other two parts,            @@//
//@@               simply because they handle 4 aspects (ARGB colors <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite7" alt=":p" title="Stick Out Tongue    :p" loading="lazy" data-shortname=":p" />) instead of one.               @@//
//@@                                                                                                   @@//
//@@               Now to the functions provided by this section of code:                              @@//
//@@                                                                                                   @@//
//@@  -&gt;       function FadeUnitByValue takes unit Modifier, real Time,                                @@//
//@@                    real alphaMod returns SmoothColorChange                                        @@//
//@@                                                                                                   @@//        
//@@  -&gt;       function FadeUnitARGBByValue takes unit Modifier, real Time,                            @@//
//@@                    real redMod, real greenMod, real blueMod,                                      @@//
//@@                    real alphaMod returns SmoothColorChange                                        @@//
//@@                                                                                                   @@//
//@@  -&gt;       function FadeUnitToValue takes unit Modifier, real Time,                                @@//
//@@                     real alphaValue returns SmoothColorChange                                     @@//
//@@                                                                                                   @@//
//@@  -&gt;       function FadeUnitARGBToValue takes unit Modifier, real Time,                            @@//
//@@                    real redValue, real greenValue, real blueValue,                                @@//
//@@                    real alphaValue returns SmoothColorChange                                      @@//
//@@                                                                                                   @@//
//@@               Here comes the explanation of the parameters used in these functions:               @@//
//@@                                                                                                   @@//
//@@               &quot;unit Modifier&quot;, as in all other functions, this is the unit to be modified.        @@//
//@@               &quot;real Time&quot;, and again, this is the amount of time the process is gonna take.       @@//
//@@               &quot;real alphaMod&quot; is the amount you wish to change the unit&#039;s alpha color.            @@//
//@@               &quot;real alphaValue&quot; is the value you wish to get after the smooth fading              @@//
//@@               process is done.                                                                    @@//
//@@               &quot;real redMod/Value&quot; is the same as above.                                           @@//
//@@               &quot;real greenMod/Value&quot; is, yet again, same as two/three lines above.                 @@//
//@@               &quot;real blueMod/Value&quot; is, for the last time, same as three/four lines above.         @@//
//@@                                                                                                   @@//
//@@               *NOTE*: The alpha value (And all other colors too) range from 0 - 255,              @@//
//@@                       where 0 is none of that color (Or transparent with the alpha color)         @@//
//@@                       and 255 is full color, and not seethrough with the alpha color <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin    :D" loading="lazy" data-shortname=":D" />           @@//
//@@                                                                                                   @@//
//@@  -&gt;       function GetUnitColorAlpha takes unit u returns integer                                 @@//
//@@                                                                                                   @@//
//@@  -&gt;       function GetUnitColorRed takes unit u returns integer                                   @@//
//@@                                                                                                   @@//
//@@  -&gt;       function GetUnitColorGreen takes unit u returns integer                                 @@//
//@@                                                                                                   @@//
//@@  -&gt;       function GetUnitColorBlue takes unit u returns integer                                  @@//
//@@                                                                                                   @@//
//@@               All of the four above function will let the user get the current amount             @@//
//@@               of a specific color the exists on a unit, where it&#039;s parameter is:                  @@//
//@@                                                                                                   @@//
//@@               &quot;unit u&quot;, which is the unit you wish the the the color of.                          @@//
//@@                                                                                                   @@//
//@@               And it will then return a number somewhere between 0 and 255.                       @@//
//@@                                                                                                   @@//
//@@               Now, to an example of how to use these functions to get a hang of it:               @@//
//@@                                                                                                   @@//
//@@       call FadeUnitARGBToValue( GetTriggerUnit(), 5.0, GetUnitColorRed( GetTriggerUnit() ),       @@//
//@@                                 0.0, ( GetUnitColorBlue( GetTriggerUnit() ) / 2. ),               @@//
//@@                                 GetUnitColorAlpha( GetTriggerUnit() ) / 4. )                      @@//
//@@                                                                                                   @@//
//@@               This little sample will make the unit 75% transparent, and also a                   @@//
//@@               mix of 66% red color and 33% blue color (We remove the green color                  @@//
//@@               and half the blue color. This is also all done, smoothly, over 5.0 seconds.         @@//
//@@                                                                                                   @@//
//@@                                                                                                   @@//
//@@                                               Note:                                               @@//
//@@                                                                                                   @@//
//@@             ¤ This system does not support pre-changed RGB colors from the Object Editor,         @@//
//@@               and I&#039;d suggest you manually change the color of the units in-game instead.         @@//
//@@               It presumes that all colors of all units are set to 255 from the start !            @@//
//@@               It will also use the scale of units as if they were set to 1.0 from                 @@//
//@@               the start, so if you change that scale of a unit, you should change the value       @@//
//@@               &quot;currentScale&quot; and &quot;doneScale&quot; for each unit of that type to the scale they         @@//
//@@               have in the Object Editor.                                                          @@//
//@@                                                                                                   @@//
//@@                                                                                                   @@//
//@@                                           Requirements:                                           @@//
//@@                                                                                                   @@//
//@@             ¤ A vJASS preprocessor, which is easiest found by downloading JASS Newgen Pack        @@//
//@@               <a href="http://www.thehelper.net/forums/showthread.php?t=73936" class="link link--internal">http://www.thehelper.net/forums/showthread.php?t=73936</a>                              @@//
//@@               You&#039;ll also have to update JASS Helper to the latest version...                     @@//
//@@               And, then you&#039;ll need the system called Timer32 (T32), and also my other            @@//
//@@               snippet, called &quot;UnitAppearance&quot; <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin    :D" loading="lazy" data-shortname=":D" />                                                 @@//
//@@                                                                                                   @@//
//@@                                             Credits:                                              @@//
//@@                                                                                                   @@//
//@@             ¤ Viikuna, for helping me out, and also helping me make &quot;UnitAppearance&quot; !            @@//
//@@               Jesus4Lyf, for also helping me out alot, and making Timer 32 ! <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin    :D" loading="lazy" data-shortname=":D" />                   @@//
//@@               Azlier, for some help too <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin    :D" loading="lazy" data-shortname=":D" />                                                        @@//
//@@                                                                                                   @@//
//@@               And credits, if you use this that is, is not needed to give me                      @@//
//@@               though it&#039;s always welcome <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite2" alt=";)" title="Wink    ;)" loading="lazy" data-shortname=";)" />                                                       @@//
//@@                                                                                                   @@//
//@@///////////////////////////////////////////////////////////////////////////////////////////////////@@//
//*******************************************************************************************************//
///////////////////////////////////////////////////////////////////////////////////////////////////////////

    struct SmoothScaleChange
    
        integer ticks
        
        real increment
        
        unit u
        
        static method create takes unit Modifier, real Time, real scaleMod returns thistype
            local thistype this = thistype.allocate()
            
            set u = Modifier // Which unit to scale <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite7" alt=":p" title="Stick Out Tongue    :p" loading="lazy" data-shortname=":p" />
            
            set Appearance[ Modifier ].doneScale = Appearance[ Modifier ].doneScale + scaleMod
            
            if Time &gt; 0. then
                set ticks = R2I( Time / T32_PERIOD ) // How many times the timer must fire...
                
                set increment = scaleMod / ticks // How much the scale will increase each PERIOD...
                
                call startPeriodic()
            else
                call ModifyUnitScale( u, scaleMod )
            endif
            
            return this
        endmethod
        
        private method periodic takes nothing returns nothing
            set ticks = ticks - 1
            
            call ModifyUnitScale( u, increment ) // This will save the scale of the unit in a struct using AIDS...
            
            debug call DisplayTimedTextToPlayer( GetLocalPlayer(), 0., 0., 6000., &quot;#SUM# - Scale: &quot; + R2S( Appearance[ u ].currentScale ) )
            
            if ticks &lt;= 0 then // When ticks becomes 0 (Meaning that the scaling is done) destroy it, and remove it from the T32 queue ! <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin    :D" loading="lazy" data-shortname=":D" />
                call stopPeriodic()
                
                call destroy()
            endif
            
        endmethod
        
        implement T32x
        
    endstruct
    
    function ScaleUnitByValue takes unit Modifier, real Time, real scaleMod returns SmoothScaleChange
        return SmoothScaleChange.create( Modifier, Time, scaleMod )
    endfunction
    
    function ScaleUnitToValue takes unit Modifier, real Time, real scaleValue returns SmoothScaleChange
        return SmoothScaleChange.create( Modifier, Time, scaleValue - Appearance[ Modifier ].doneScale )
    endfunction
    
    function GetUnitScale takes unit u returns real
        return Appearance[ u ].currentScale
    endfunction
    
    struct SmoothColorChange
    
        integer ticks
        
        real rincrement
        real gincrement
        real bincrement
        real increment
        
        unit u
        
        static method create takes unit Modifier, real Time, real redMod, real greenMod, real blueMod, real alphaMod returns thistype
            local thistype this = thistype.allocate()
            
            set u = Modifier
            set Appearance[ Modifier ].doneAlpha = Appearance[ Modifier ].doneAlpha + alphaMod
            set Appearance[ Modifier ].doneRed = Appearance[ Modifier ].doneRed + redMod
            set Appearance[ Modifier ].doneGreen = Appearance[ Modifier ].doneGreen + greenMod
            set Appearance[ Modifier ].doneBlue = Appearance[ Modifier ].doneBlue + blueMod
            
            if Time &gt; 0. then
                set ticks = R2I( Time / T32_PERIOD )
                
                set increment = alphaMod / ticks
                set rincrement = redMod / ticks
                set gincrement = greenMod / ticks
                set bincrement = blueMod / ticks
                
                call startPeriodic()
            else
                call ModifyUnitVertexColor( u, redMod, greenMod, blueMod, alphaMod )
            endif
            
            return this
        endmethod
        
        private method periodic takes nothing returns nothing
            set ticks = ticks - 1
        
            call ModifyUnitVertexColor( u, rincrement, gincrement, bincrement, increment )
            
            debug call DisplayTimedTextToPlayer( GetLocalPlayer(), 0., 0., 6000., &quot;#SUM# - Red: &quot; + I2S( R2I( Appearance<u>.currentRed ) ) )
            debug call DisplayTimedTextToPlayer( GetLocalPlayer(), 0., 0., 6000., &quot;#SUM# - Green: &quot; + I2S( R2I( Appearance<u>.currentGreen ) ) )
            debug call DisplayTimedTextToPlayer( GetLocalPlayer(), 0., 0., 6000., &quot;#SUM# - Blue: &quot; + I2S( R2I( Appearance<u>.currentBlue ) ) )
            debug call DisplayTimedTextToPlayer( GetLocalPlayer(), 0., 0., 6000., &quot;#SUM# - Alpha: &quot; + I2S( R2I( Appearance<u>.currentAlpha ) ) )
            
            if ticks &lt;= 0 then
                call destroy()
                
                call stopPeriodic()
            endif
            
        endmethod
        
        implement T32x
        
    endstruct
    
    function FadeUnitByValue takes unit Modifier, real Time, real alphaMod returns SmoothColorChange
        return SmoothColorChange.create( Modifier, Time, 0., 0., 0., alphaMod )
    endfunction
    
    function FadeUnitARGBByValue takes unit Modifier, real Time, real redMod, real greenMod, real blueMod, real alphaMod returns SmoothColorChange
        return SmoothColorChange.create( Modifier, Time, redMod, greenMod, blueMod, alphaMod )
    endfunction
    
    function FadeUnitToValue takes unit Modifier, real Time, real alphaValue returns SmoothColorChange
        return SmoothColorChange.create( Modifier, Time, 0., 0., 0., alphaValue - Appearance[ Modifier ].doneAlpha )
    endfunction
    
    function FadeUnitARGBToValue takes unit Modifier, real Time, real redValue, real greenValue, real blueValue, real alphaValue returns SmoothColorChange
        return SmoothColorChange.create( Modifier, Time, redValue - Appearance[ Modifier ].doneRed, greenValue - Appearance[ Modifier ].doneGreen,/*
    */                                                   blueValue - Appearance[ Modifier ].doneBlue, alphaValue - Appearance[ Modifier ].doneAlpha )
    endfunction
    
    function GetUnitColorAlpha takes unit u returns integer
        return R2I( Appearance[ u ].currentAlpha )
    endfunction

    function GetUnitColorRed takes unit u returns integer
        return R2I( Appearance[ u ].currentRed )
    endfunction
    
    function GetUnitColorGreen takes unit u returns integer
        return R2I( Appearance[ u ].currentGreen )
    endfunction
    
    function GetUnitColorBlue takes unit u returns integer
        return R2I( Appearance[ u ].currentBlue )
    endfunction
    
    struct SmoothTSChange
    
        integer ticks
        
        real increment
        
        unit u
        
        static method create takes unit Modifier, real Time, real timescaleMod returns thistype
            local thistype this = thistype.allocate()
            
            set u = Modifier
            set Appearance[ Modifier ].doneTimescale = Appearance[ Modifier ].doneTimescale + timescaleMod
            
            if Time &gt; 0 then
                set ticks = R2I( Time * T32_PERIOD )    // How many times the timer must fire...
                
                set increment = timescaleMod / ticks    // How much to increase/decrease each period <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin    :D" loading="lazy" data-shortname=":D" />
                
                call startPeriodic()
            else
                call ModifyUnitTimeScale( u, timescaleMod )
            endif
            
            return this
        endmethod
        
        private method periodic takes nothing returns nothing
            set ticks = ticks - 1
        
            call ModifyUnitTimeScale( u, increment )
            
            debug call DisplayTimedTextToPlayer( GetLocalPlayer(), 0., 0., 6000., &quot;#SUM# - Timescale :&quot; + R2S( Appearance[ u ].currentTimescale ) )
            
            if ticks &lt;= 0 then
                call destroy()
                
                call stopPeriodic()
            endif
            
        endmethod
        
        implement T32x
        
    endstruct
    
    function ChangeTimeScaleByValue takes unit Modifier, real Time, real timescaleMod returns SmoothTSChange
        return SmoothTSChange.create( Modifier, Time, timescaleMod )
    endfunction
    
    function ChangeTimeScaleToValue takes unit Modifier, real Time, real timescaleValue returns SmoothTSChange
        return SmoothScaleChange.create( Modifier, Time, timescaleValue - Appearance[ Modifier ].doneTimescale )
    endfunction
    
    function GetUnitTimeScale takes unit u returns real
        return Appearance[ u ].currentTimescale
    endfunction

endlibrary</u></u></u></u>


JASS:
library UnitAppearance requires AIDS

    struct Appearance extends array
        //! runtextmacro AIDS()

        public real currentScale
        
        public real currentTimescale
        
        public real currentAlpha
        public real currentRed
        public real currentGreen
        public real currentBlue
        
        public real doneScale
        
        public real doneTimescale
        
        public real doneAlpha
        public real doneRed
        public real doneGreen
        public real doneBlue
        
        private method AIDS_onCreate takes nothing returns nothing
            set currentScale = 1.0
            
            set currentAlpha = 255.0
            set currentRed = 255.0
            set currentGreen = 255.0
            set currentBlue = 255.0
            
            set currentTimescale = 1.0
            
            set doneScale = 1.0
            
            set doneAlpha = 255.0
            set doneRed = 255.0
            set doneGreen = 255.0
            set doneBlue = 255.0
            
            set doneTimescale = 1.0
        endmethod
        
    endstruct

    function ModifyUnitScale takes unit u, real addscale returns nothing
        local Appearance this = Appearance[ u ]
        
        if addscale != 0. then
            set this.currentScale = this.currentScale + addscale
            
            call SetUnitScale( this.unit, this.currentScale, 0.,0. )
        endif
        
    endfunction
    
    function ModifyUnitVertexColor takes unit u, real addred, real addgreen, real addblue, real addalpha returns nothing
        local Appearance this = Appearance[ u ]
        
        if addalpha != 0. then
            set this.currentAlpha = this.currentAlpha + addalpha
        endif
        
        if addred != 0. then
            set this.currentRed = this.currentRed + addred
        endif
        
        if addgreen != 0. then
            set this.currentGreen = this.currentGreen + addgreen
        endif
        
        if addblue != 0. then
            set this.currentBlue = this.currentBlue + addblue
        endif
        
        if addalpha != 0. or addred != 0. or addgreen != 0. or addblue != 0. then
            call SetUnitVertexColor( this.unit, R2I( this.currentRed ), R2I( this.currentGreen ), R2I( this.currentBlue ), R2I( this.currentAlpha ) )
        endif
        
    endfunction
    
    function ModifyUnitTimeScale takes unit u, real addtimescale returns nothing
        local Appearance this = Appearance[ u ]
        
        if addtimescale != 0. then
            set this.currentTimescale = this.currentTimescale + addtimescale
        
            call SetUnitTimeScale( this.unit, this.currentTimescale )
        endif
        
    endfunction
    
endlibrary


EDIT: Just added a new and much improved Test Map to the first post, please take time and check it out ! ;)
 

Laiev

Hey Listen!!
Reaction score
188
just a note xD (making my tesh and i notice that)

JASS:
//@@  -&gt;       function ChangeTimeScaleTyValue takes unit Modifier, real Time,                         @@//


should be

JASS:
//@@  -&gt;       function ChangeTimeScaleToValue takes unit Modifier, real Time,                         @@//
 

Komaqtion

You can change this now in User CP.
Reaction score
469
ARE YOU F&%@ING KIDDING ME ?! YOU GRAVEYARDED THIS ?!

YOU JUST LOST A VERY HAPPY AND DEDICATED USER OF THIS FORUM...

Sorry guys, I put WAY too much effort into this for it to be graveyarded, so good bye :'(
 

Laiev

Hey Listen!!
Reaction score
188
:/ komaqtion, just request this to back to resources... some mod/admin just clear all resources submitted and don't see all cases >< don't go (?)
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Stuff automatically gets graveyarded after a while, I think. :( I'm surprised you hadn't noticed. Don't be so quick to react. :eek:
 

BlackRose

Forum User
Reaction score
239
ARE YOU F&%@ING KIDDING ME ?! YOU GRAVEYARDED THIS ?!

YOU JUST LOST A VERY HAPPY AND DEDICATED USER OF THIS FORUM...

Sorry guys, I put WAY too much effort into this for it to be graveyarded, so good bye :'(

LOL <3 Discuss it, not leave. I don't even see some sort of 'review & consequent rejection' post.
 
General chit-chat
Help Users
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top