YesNoOk
avatar

Projectile Afterimage Effects (Read 9014 times)

Started by Elix, May 12, 2007, 06:06:27 pm
Share this topic:
Projectile Afterimage Effects
New #1  May 12, 2007, 06:06:27 pm
  • ****
  • "Moyashi tsuku shite yaru..."
The idea is inspired by kofz, where I have seen flashy effects in fire attacks, like trails of fire. I understood quickly that they were arterimages. So I decided to write my own code for fire afterimage effect to use in my character. Here is an example of what was and what is now. (This afterimage makes an effect of hi-res sprites :P Only better, because the amout of frames is doubled)


How to use:
1) Choose an animation (effect) you want to change. Normally it could be an Explod or a Projectile. Now you must create a Helper where you will apply those AfterImages to the animation. However, if you just want to add an afterimage to normal projectiles just put AfterImage. tags in it (For more information read sctrls.html .-> Projectile).
2) You must double the time of animation. In order to do that just go to your animations in .air file, locate the projectile's animation and add a blank frame with the duration of the whole anim. For example,
8160,0, 0,0, 1,, A1
8160,1, 0,0, 1,, A1
8160,2, 0,0, 1,, A1
8160,3, 0,0, 1,, A1
8160,4, 0,0, 1,, A1
8160,5, 0,0, 2,, A1
8160,6, 0,0, 2,, A1
8160,7, 0,0, 2,, A1
8160,8, 0,0, 3,, A1
8160,9, 0,0, 3,, A1
8160,10, 0,0, 3,, A1
8160,11, 0,0, 2,, A1
-1,-1, 0,0, 22
Now if you have normal projectiles with a limited duration, you must double that duration for AfterImage to vanish properly. The duration is "ProjRemoveTime" parameter.
3) First create a state which will be your AfterImaged animation. Add AfterImage controller there. For example:
[Statedef 8100]
anim = 8100
sprpriority = 3

[State 8100, AfterImage]
type = AfterImage
trigger1 = !Time
time = 999
length = 8
PalContrast = 250,244,10
PalAdd = 240,90,15
PalMul = .6,.5,.25
TimeGap = 2
FrameGap = 1
Trans = Add

[State 8100, Commit Suicide]
type = DestroySelf
trigger1 = !AnimTime
If you want this effect binded to a player just use a simple controller:
[State 8100, Bind]
type = BindToParent
triggerall = parent, StateNo = ()
trigger1 = 1
facing = 1
pos = (),()
4) Now create a Helper controller in the state you want it to appear. Example:
[State 1000, 8100 Helper]
type = Helper
trigger1 = AnimElem = 1
Persistent = 0
IgnoreHitPause = 1
HelperType = Normal
KeyCtrl = 0
Name = "8100 Helper"
ID = 8100
PosType = P1
Pos = 0,0
StateNo = 8100
PauseMove = 1
SuperMove = 1
PauseMoveTime = 2147483647
SuperMoveTime = 2147483647

Now edit the numbers of AfterImage controller to get the desired effect. Enjoy!

Note: You could just use AfterImage. tags and turn Explods into Projectiles, as I was suggesting earlier, but it is a bad idea. This triggers AI in CPU matches, cheating them that there's a projectile on the screen. Also it would be harder to bind it if needed.
Last Edit: July 20, 2007, 02:28:24 am by Elix
Re: Projectile Afterimage Effects
#2  May 12, 2007, 06:16:58 pm
  • ******
  • In after lock
    • mugenguild.com/~messatsu/index.html
I know you didn't previously know this, but this is documented.


Many people risk their lives everyday by having Mugen.
Re: Projectile Afterimage Effects
#3  May 12, 2007, 06:19:14 pm
  • ****
  • "Moyashi tsuku shite yaru..."
Where? If I get you right, this kind of code is already somewhere on the forum, right?
Re: Projectile Afterimage Effects
#4  May 12, 2007, 07:10:43 pm
  • ******
  • In after lock
    • mugenguild.com/~messatsu/index.html


Many people risk their lives everyday by having Mugen.
Re: Projectile Afterimage Effects
New #5  May 12, 2007, 07:17:13 pm
  • ****
  • "Moyashi tsuku shite yaru..."
Messatsu, either you didn't read my post or you really don't understand that the meaning is not in the structure of the code, which you really can find in MUGEN docs, but in explict data that I presented. Numbers, Mugen (ç„¡é™
Last Edit: May 12, 2007, 07:20:06 pm by Elix