YesNoOk
avatar

AfterImage (SCTRLs) (Read 5140 times)

Started by Ricepigeon, September 25, 2015, 10:57:08 pm
Share this topic:
AfterImage (SCTRLs)
#1  September 25, 2015, 10:57:08 pm
  • *****
  • Gaps? Where we're going, we don't need gaps...
    • USA
    • ricepigeon.neocities.org
Enables player afterimage effects. The character's frames are stored in a history buffer, and are displayed after a delay as afterimages.

Required parameters:
    none
Optional parameters:

    time = duration (int)
        Specifies the number of ticks that the afterimages should be displayed for. Set to -1 to display indefinitely. Defaults to 1.
    length = no_of_frames (int)
        Sets the capacity of the frame history buffer. The history will hold up to no_of_frames of the character's most recently saved frames. Assuming constant values for timegap and framegap, increasing the length can increase the number and "age" (for lack of a better term) of afterimages displayed at one time. The maximum length is 60, and the default is 20.
    palcolor = col (int)
        See below.
    palinvertall = invertall (bool)
        See below.
    palbright = add_r, add_g, add_b (int)
        See below.
    palcontrast = mul_r, mul_g, mul_b (int)
        See below.
    palpostbright = add2_r, add2_g, add2_b (int)

        These parameters determine palette effects to be applied to all afterimages. First the color level is adjusted according to the palcolor value, then if invertall is non-zero the colors are inverted. Afterwards, the palbright components are added to the corresponding component of the player's palette, then each component is multiplied by the corresponding palcontrast component divided by 256, then the palpostbright components are added to the result. The value of palcolor ranges from 0 (greyscale) to 256 (normal color). For instance, if the red component of the character's palette is denoted pal_r, then the red component of the afterimage palette is given by (pal_r + add_r) * mul_r / 256 + add2_r, assuming palcolor and palinvert are left at their default values. Valid values are 0-256 for palcolor, 0-255 for palbright and palpostbright components, and any non-negative integer for palcontrast components. The defaults are:
Code:
        palcolor = 256
        palinvertall = 0
        palbright = 30,30,30
        palcontrast = 120,120,220
        palpostbright = 0,0,0

    paladd = add_r, add_g, add_b (int)
        See below.
    palmul = mul_r, mul_g, mul_b (float)

        These parameters specify palette effects that are applied repeatedly to successive frames in the afterimage. In one application of these palette effects, first the paladd components are added to the afterimage palette, then the components are multiplied by the palmul multipliers. These effects are applied zero times to the most recent afterimage frame, once to the second-newest afterimage frame, twice in succession to the third-newest afterimage frame, etc. Valid values are 0-255 for the paladd components, and any non-negative float value for the palmul multipliers. The defaults are:
Code:
        paladd = 10,10,25
        palmul = .65,.65,.75

    timegap = value (int)
        This parameter controls how many frames to skip between saving player frames to the history buffer for afterimage display. The default is 1 (skip no frames). To save every third frame (for example), you would use timegap = 3.
    framegap = value (int)
        Every value'th frame in the history buffer will be displayed as an afterimage. For instance, if framegap = 4 (the default), then the first, fifth, ninth, ... frames of the history buffer will be displayed as afterimages.
    trans = type (string)
        Specifies the transparency type for the afterimages. Valid values for type are "none" for an opaque afterimage, "add", "add1", and "sub". Defaults to "none".

Example:
    none

Additional Notes
The red component of AfterImages is currently bugged as of MUGEN 1.0. Due to storing the value of add_r at the wrong RAM address, the add_r component of the palbright parameter is always fixed at 30, ignoring the value assigned to add_r. Please see this thread for more detailed information.
Re: AfterImage (SCTRLs)
#2  September 26, 2015, 05:24:16 pm
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
Also interesting to mention, is that only one AfterImage controller can be applied at once per player. Setting a new AfterImage will override the previous one.

So, in case it is needed to create different AfterImages, such as a rainbow colored one, it will be necessary to spwn helpers (using same anim as root), make them invisible, and then have each helper spawn their own AfterImage.
XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!
Re: AfterImage (SCTRLs)
#3  September 30, 2015, 04:04:37 am
  • *****
    • Guyana
    • Skype - ryon_persaud
I also want to mention if you use the afterimage code without any color values, it is by default a very nice blue.

[State 0, AfterImage]
type = AfterImage
trigger1 = !time
time = 50
length = 10
framegap = 1
trans = add
Characters := http://www.mediafire.com/folder/kx11h6lcbbqj1/Characters
Stages := http://www.mediafire.com/folder/xy7wk5q9qka62/Stages

Projected Character Forcast := FighterZ Android 18 , FighterZ Vegeta , FighterZ Goku.
Re: AfterImage (SCTRLs)
#4  August 01, 2016, 10:06:51 am
  • *****
  • Shame on you!
    • USA
Has anyone looked into hex editing Mugen like @Demented Fortune Cookie: suggested in the other thread to fix the red issue?
vVv Wheat Stage Released vVv