YesNoOk
avatar

Character Transformations (Read 13060 times)

Started by aokmaniac13, November 02, 2005, 01:31:37 am
Share this topic:
Character Transformations
#1  November 02, 2005, 01:31:37 am
  • ******
  • Just a butcher on a mission
    • www.justnopoint.com/lbends
All of this has already been tested, so far it is 100% effective.

As many of us know, there was a time when character transformations were awkward to implement outside of a full game due to the fact that the inappropriate sprites may display during a throw.  Well no longer, here is a method I have found to solve this problem, but it requires a bit of extra coding on the thrower's part.

1.  For your character, provide and extra set of the required sprites, but with a group number + 10000.  E.G.  sprite 5000,0 will have its counterpart as 15000,0.
2.  For each animation, same deal.

Now for the tricky part
3.  Add this to state -2

Code:
[State -2, Transform Helper]
type = Helper
trigger1 = numhelper(8874) = 0
name = "AmITransformed?"
ID = 8874
pos = 9999,-9999
stateno = 8874

[State -2, Transform Helper]
type = Changeanim
triggerall = helper(8874),var(40) > 0
trigger1 = anim = [0,9999]
value = anim + helper(8874),var(40)*10000

Do NOT change the number from 8874, this is an attempt to establish a standard.

4.  This state must be present in your code

Code:
[Statedef 8874]

[State 8874, OHNOES!]  ; You really don't want to see this helper do you?
type = assertspecial
trigger1 = time
flag = invisible
persistent = 1

[state 8874, INIT] ; Initialize the transformation variable
type = varset
trigger1 = time = 0
v = 40
value = 0

[State 8874, Change] ; This sctrl can be modified as appropriate
type = varset
triggerall = root, animelemtime(5) = 0  ; Halfway through the transformation anim in this case
trigger1 = root, anim = 1000    ; Suppose the anim for transforming is 1000
trigger2 = root, anim = 11000  ; Transforming back is anim 11000 in this case
v = 40
value = ifelse(root,anim=1000,1,0) ;1 = Transformed, 0 = not

And there you have the basics, all you need to do is enter a state using the transformation animation and the helper will automatically detect the fact that you are transforming.


And now for the thrower's part of the code.  There are two things required:

1.  For each custom anim, add an extra one, but +10000 with the sprites also +10000
E.G.  If a custom throw anim is action 650 and uses sprites 5000-5020, another anim must be present, action 10650 using sprites 15000-15020.

2.  For each changeanim or changeanim2 in a custom state, use this
value = "wtf" + helper(8874),var(40) * 10000
Where "wtf" is the anim you would have put your opponent into.

Let me know if any of this is too confusing, or if anyone can explain this in a simpler way than have I.



NOTE: Another and possibly faster piece of code to use instead is
Code:
[State -2, Transform Helper]
type = Changeanim
triggerall = helper(8874),var(40) > 0
trigger1 = anim = [5,6]
trigger2 = anim = 11
value = anim + helper(8874),var(40)*10000

And heavily modify common.cns to use the proper anim changing code.  The advantages and disadvantages to using either method is at this time unknown, because I'm lazy.
Last Edit: November 02, 2005, 01:41:45 am by Jazzy
Re: Character Transformations
#2  November 02, 2005, 01:38:38 am
  • ******
  • In after lock
    • mugenguild.com/~messatsu/index.html
Quote
As many of us know, there was a time when character transformations were deemed impossible outside of a full game due to the fact that the inappropriate sprites may display during a throw.  Well no longer, here is a method I have found to solve this problem, but it requires a bit of extra coding on the thrower's part.
It wasn't exactly impossible before without displaying inappropriate sprites... you could detect standard anims.


Many people risk their lives everyday by having Mugen.
Re: Character Transformations
#3  November 02, 2005, 01:41:20 am
  • ******
  • Just a butcher on a mission
    • www.justnopoint.com/lbends
Quote
As many of us know, there was a time when character transformations were deemed impossible outside of a full game due to the fact that the inappropriate sprites may display during a throw.  Well no longer, here is a method I have found to solve this problem, but it requires a bit of extra coding on the thrower's part.
It wasn't exactly impossible before without displaying inappropriate sprites... you could detect standard anims.
But it was messy wasn't it?  Btw I changed it.

Edit:  You posting reminded me of a suggestion on RS, the code for the helper can be modified as such:

Code:
[State 8874, Change] ; This sctrl can be modified as appropriate
type = varset
trigger1 = time %1 = 0
v = 40
value = ifelse(root,facing=1,1,0) ;1 = Transformed, 0 = not

You know what this can be used for  :)
Last Edit: November 02, 2005, 01:50:49 am by Jazzy
Re: Character Transformations
#4  November 02, 2005, 02:26:27 am
  • ******
  • In after lock
    • mugenguild.com/~messatsu/index.html
Quote
But it was messy wasn't it?
There never was an implementation, so I'd never know.  But all that is needed is something common like a variable so the two can communicate (after you confirm compliance).


Many people risk their lives everyday by having Mugen.
Re: Character Transformations
#5  November 05, 2005, 11:57:19 am
  • **
  • Ok!
You haven't really solved anything.  If you play against a character that doesn't have that special code he can still revert you to your old sprites.  Basically you're setting a standard that everyone would have to abide by.  If that's the case this looks similar to code that would belong in a full game.
Re: Character Transformations
#6  November 05, 2005, 03:30:04 pm
  • ******
  • Just a butcher on a mission
    • www.justnopoint.com/lbends
Re: Character Transformations
#7  November 05, 2005, 03:39:28 pm
  • ******
  • In after lock
    • mugenguild.com/~messatsu/index.html
Though nearly useless, the player could detect the helper via enemy(xxx), numhelper(yyy) to prevent from transforming at all.  That didn't much make sense.


Many people risk their lives everyday by having Mugen.
Re: Character Transformations
#8  December 01, 2005, 11:42:56 pm
  • **
  • Ok!
Now everyone update your characters to jazzy's standards. ::)
Re: Character Transformations
#9  December 07, 2005, 10:24:23 pm
  • ******
  • [E]
    • Mexico
A small let down, since i did not have many hopes in this anyway. The cvs3 project had this same standard 2 years ago.

The only perfect solution would be something that does not require to change the other characters, otherwise is useful outside of closed mugen games/standars.
Don't take me wrong, it is a nice try, just not the holy grial of transformation as you though.