YesNoOk
avatar

An explod to head of character and unaffected by camera (Read 2264 times)

Started by BurningSoul, February 11, 2018, 02:39:33 pm
Share this topic:
An explod to head of character and unaffected by camera
#1  February 11, 2018, 02:39:33 pm
  • ****
  • Pixels are atom's of resolution,Low-res or Hi-res
    • Turkey
    • metekervan26@gmail.com
is there any way I can show an explod in my characters head? and make explod unaffected by camera
Re: An explod to head of character and unaffected by camera
#2  February 11, 2018, 05:23:29 pm
  • *****
  • Shame on you!
    • USA
Yes. Jailbot uses this exact trick I believe. @altoiddealer: Do you happen to have a link that could help?
vVv Ryuko718 Updated 10/31/22 vVv
Re: An explod to head of character and unaffected by camera
#3  February 12, 2018, 12:25:21 am
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
Is it something that will change all the time?  Like my Jailbot has his face constantly changing animations to "look at the enemy".

Or is it some kind of general effect, like puffs of smoke/flames/glowing/etc?

Re: An explod to head of character and unaffected by camera
#4  February 17, 2018, 10:17:03 pm
  • ****
  • Pixels are atom's of resolution,Low-res or Hi-res
    • Turkey
    • metekervan26@gmail.com
Is it something that will change all the time?  Like my Jailbot has his face constantly changing animations to "look at the enemy".

Or is it some kind of general effect, like puffs of smoke/flames/glowing/etc?

I wanna learn both
Re: An explod to head of character and unaffected by camera
New #5  February 18, 2018, 06:04:37 am
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
I might need to cut off my response short and fill it more info later, we'll see how much I can type out right now...

In either case, you'll probably need a bit of code to keep the anim positioned correctly based on the player's current anim / animelem.
You may want to use Null controllers to set vars, to reduce the number of required Explod/ModifyExplod controllers.

General effect: You create a looping anim (smoke, flames, etc) with the axis centered.  You'll use coding to bind it where it needs to be for each anim.  You will want to create the effect as an Explod that doesn't go away - and use ModifyExplod to change it's position without resetting the animation each time (which would happen if constantly removing/creating new Explods).
Spoiler: Example Using Vars to control X/Y position of Explod (click to see content)
Spoiler: Example not using vars (click to see content)

Something that changes anim to match the player anim: If it's something that needs to synchronize with the player on each animelem, you basically need a 1-tick anim dedicated to each one - constantly triggered.  You should use FF3's OnionSkin feature to position it so you don't need to worry about positioning these with your code.
Spoiler: Example (click to see content)

Something that changes all the time, like the face on my Jailbot character:
You'll do the same thing as above - use Explods aligned to fit corresponding to each animelem (not having to use code to position).
However, you'll also factor in a Var to check on whatever condition you have, and use it display the correct anim.
For example, lets say you want to overlay scars/bruises/cuts/etc, as your character gets damaged... you have 3 variations, and you always want them to show.  Well, this would be a lot more work than my character's face changing thing, because he only does it for Stand/Idle/Walk states - not during ALL anims.  Anyway, you would make the 3 different sprites to coorespond with each animelem (3 sprites for Stand elem 1, 3 sprites for Stand elem 2, etc).  They'll be numbered like 10000, 10001, 10002.... 10005, 10006, 10007... whatever, as long they are in groups of 3 for this example.
You'll have a VarSet in State -2 to check whatever the condition is.  In this case, Var(5) will check Life against LifeMax to see how healthy the character is.
Spoiler: State -2 Var to check life (click to see content)
Then just factor it into the example I showed before this like so:
Spoiler: Example (click to see content)
For my Jailbot, there are 18 different faces / directions his eyes will move.  So there are 18 face anims for every single animelem I want the effect to work.  There are a lot of them.

The last thing I'll cover which is even more complicated, is to take the 2 sprite layers (The player, and the head/effect/whatever explod), and actually have them drawn on one sprite layer.  Meaning, if you walk behind a teammate or enemy who is on the same sprite layer as you, the Explod won't get drawn above them.
This can be done by making the player invisible, and instead drawing them as Explods as well - using the same sprite layer.  What makes this complicated is that both Explods (Player and Head) must always trigger simultaneously... the Explod for Player must appear first in the CNS, then the head.  As MUGEN analyzes the code (which is from top to bottom), it will draw the body, then the head on the same sprite layer.  When MUGEN analyzes the code again, it can drawn the head under the body if you are not careful.  I handled this by making both body and head constantly triggered, redrawn every tick.
I'm not even going to try to elaborate on this further.  If you understand this concept, take a look at Jailbot's Stand code.  There are sometimes 3 explods getting squashed into one layer (the "scanlines" damaged effect, plus face, plus body).


If you have any specific question let me know.

Last Edit: February 18, 2018, 11:17:34 pm by altoiddealer