# Transformations in Mugen, DBZ style (Read 54875 times)

Started by The Railgunner, December 01, 2008, 11:52:47 am

#### The Railgunner

##### Transformations in Mugen, DBZ style
#1  December 01, 2008, 11:52:47 am
• Sunglasses Security Guy is watching you necrobump.
This is relatively easy to achieve, it just takes patience (I'll be skipping everything in the code that's not relevant to the transformation).

[State 0]
anim=ifelse(var(1)=1,10000,0

where var(1) is the transformation variable. Now, for more than one transformation (using three as an example):

[State 0]
anim=ifelse(var(1)=3,30000,ifelse(var(1)=2,20000,ifelse(var(1)=1,10000,0)

meaning that if var(1) equals 3 (i.e., the third transformation), than state 0's anim is 30000, if it's 2, 20000, if 1, 10000, and if in base form (no transformation), 0.

Now, for attack values, simply move the ifelse(s) from the first state and put them in the hitdef, adjusting the values accordingly.

Light Punch:

[State 200]
damage=ifelse(var(1)=3,45,ifelse(var(1)=2,35,ifelse(var(1)=1,25,20)

Now, the actual transformation. There are two logical ways of doing this. Here is the first, which is command-based:

[State 4000];Transformation
anim=ifelse(var(1)=2,24000,ifelse(var(1)=1,14000,4000);The characters transformations aren't going to look identical, are they?

[State 4000];Varset
type=varset
trigger1=command="transform"
v=1
value=ifelse(var(1)=2,3,ifelse(var(1)=1,2,1)

[State 4000];Changestate
type=changestate
trigger1=animelem=5;it doesn't have to be five, that's just a placeholder
value=0;back to standing state

The other method is power-based, where you replace "command="transform"" with this:

power=>###;### is the number, if that wasn't already evident

The transformation can be reversed like so:

[State 4001];Revert
anim=ifelse(var(1)=3,34001,ifelse(var(2)=1,24001,14001);The characters transformations aren't going to look identical, are they?

[State 4001];Varset
type=varset
trigger1=command="untransform"
v=1
value=ifelse(var(1)=3,2,ifelse(var(1)=2,1,0)

[State 4001];Changestate
type=changestate
trigger1=animelem=5;it doesn't have to be five, that's just a placeholder
value=0;back to standing state

And the power trigger:

power<=###

And that's it, really. You can have an indefinite amount of transformations with this method. There's a much harder way of doing this, but I'll post that another day.

#### EVILNEON

##### Re: Transformations in Mugen, DBZ style
#2  December 02, 2008, 04:03:51 am
• Oozaru with a hang over
Awesome Vegeta , thanks a million ! were do you put in the sprite #'s in ? Im trying to learn, its just really confusing at this point  ??? .
Last Edit: December 02, 2008, 06:40:53 am by EVILNEON

#### The Railgunner

##### Re: Transformations in Mugen, DBZ style
#3  December 03, 2008, 01:45:00 am
• Sunglasses Security Guy is watching you necrobump.
You have to make the animation in the AIR file first. When you do that, put the animation number in the place of the 4000 that I used in this code. You should look at another Mugen character's AIR file to see how an animation is made in Mugen.

The first number is the sprite group number. The second is the sprite number within the group. The third and fourth numbers are x and y offset, which is how many pixels the sprite is shifted from it's original position in the SFF. The last number is the amount of time (in ticks, 60 to a second) the animation frame takes.

#### Xarian

##### Re: Transformations in Mugen, DBZ style
#4  February 12, 2009, 05:36:47 pm
ok im kinda confused...if i want my char to have 3 transes i need to put [State 0]
anim=ifelse(var(1)=3,30000
but... u said to add that code to ALL states...when i opened chars data file
where states are i got confused...so where do i put [State 0]
anim=ifelse(var(1)=3,30000 exactly? ??? any explaination is appreciated
Last Edit: February 12, 2009, 06:31:56 pm by Xarian

#### Anjel

##### Re: Transformations in Mugen, DBZ style
#5  February 12, 2009, 08:54:32 pm
• Horrible
There is a easier way.
Set a variable to like 10000 (your transformation anims needs to be 10000 + then).
Then set you anim to.
Anim = 0+var(yourvar)
My shitty mugen stuff:

#### XGargoyle

##### Re: Transformations in Mugen, DBZ style
#6  February 13, 2009, 09:26:58 pm
• Hedgehog Whisperer
in any case, you will have issues with custom states
 XGargoyle: Battle posing since 1979http://xgargoyle.mgbr.nethttp://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that linkhttp://paypal.me/XGargoyle  <-- Donations welcome!

#### Xarian

##### Re: Transformations in Mugen, DBZ style
#7  February 14, 2009, 01:24:27 am
so basicly i gotta add to CNS files some custom states?
such as for transformation...but if i do how i put commands then?
tnx in advance guys im still noob at this

#### DavidGee

##### Re: Transformations in Mugen, DBZ style
#8  March 27, 2009, 09:57:25 pm
• I never really was on your side.
From what I can tell, characters with transformations are common. But, there doesn't seem to be an unofficial transformation standard. Although there are characters that transform, there are not characters that support these transformations in custom states (namely, throws), besides probably the particular transformation character itself and perhaps other characters by the same author. Please correct me if I'm wrong.

So what we do have so far is the indices that characters should use for required sprites and animations of their alternate forms. Simply increase the index by 10,000 for each form.

• Form 0 - indices 0 to 9,999
• Form 1 - indices 10,000 to 19,999
• Form 2 - indices 20,000 to 29,999
• Form 3 - indices 30,000 to 39,999
• (and so on if there are more forms...)

Assuming all transformation characters follow this numbering scheme, there is only one thing that prevents us from making our character use the correct sprites when throwing a transformed character. We can't tell what form the character is in!

We need a way to determine (A) that the opponent has multiple forms, and (B) what form they are currently in.

What I want to know is... has anybody done this? Is there a reliable method that has been used by multiple authors? Is there a single author who has released multiple transformation characters using a reliable method? If a good method already exists, is already implemented in more than 1 existing characters, then it should be taken and made an unofficial standard. Otherwise, a new standard should be documented and implemented in a new character, and then (hopefully) adopted in future character releases.

#### Bastard Mami

##### Re: Transformations in Mugen, DBZ style
#9  March 27, 2009, 10:20:06 pm
• [E]
the closer we got to that is gm's gill.

While I am also doing transformations using a very similar method I gave uup on comunitty standars and am making it for a closed game.

#### DavidGee

##### Re: Transformations in Mugen, DBZ style
#10  March 28, 2009, 12:04:07 am
• I never really was on your side.
I downloaded GM's SF3 characters, and they just use authorname="GM" and name="Gill" as triggers, so there's no standard detection method there. And Gill's form simply depends on the direction he's facing. The only thing that indicates the character's current form is the facing trigger.

So far, I know of no implemented method that can be standardized to use in any character. It's a rather simple matter though. All you need is a variable that says "I have multiple forms" and another variable that says "I am in this form right now." It could be reduced to 1 variable if you use something else (like action numbers) to indicate that multiple forms exist.
Last Edit: March 28, 2009, 12:11:49 am by DavidGee

#### XGargoyle

##### Re: Transformations in Mugen, DBZ style
#11  March 28, 2009, 01:39:36 pm
• Hedgehog Whisperer
Again, the problem is that some characters will have just one form (Goku -> SSJ Goku) whereas others will have more than 1 (MVC Ryu -> MVC Ken or MVC Akuma)

Therefore, even if all characters use the same variable, you still don't know how many transformations your enemy has. Are you going to include thousands of custom states just for the sake of compatibility with that character who happens to have 13 transformations (Shang Tsung, for example)
 XGargoyle: Battle posing since 1979http://xgargoyle.mgbr.nethttp://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that linkhttp://paypal.me/XGargoyle  <-- Donations welcome!

#### DavidGee

##### Re: Transformations in Mugen, DBZ style
#12  March 28, 2009, 02:56:33 pm
• I never really was on your side.
Well you wouldn't need to duplicate states; only animations. And the only modification you'd need to make to them is prepending the sprite numbers with 10, 20, 30... And then you put a variable in the value of changeanim2, so not much work would be involved in making any given character compliant.

And I don't see a reason to support more than 5 forms. Shang Tsung isn't something I think is worth mimicking in Mugen. But I am thinking of characters that drop weapons or armor (Vega), characters with multiple costumes (KOF), and characters that power up and change their appearance (DBZ). Apart from something like Shang Tsung, is there a character that would need more than 5 forms? Deciding on a specific number would be nice.

#### c001357

##### Re: Transformations in Mugen, DBZ style
#13  March 28, 2009, 04:06:07 pm
• ロッキングガール
• 「目指すはクールでロックなアイドル！」
Twelve.

#### USL-Intelligence

##### Re: Transformations in Mugen, DBZ style
#14  May 10, 2009, 11:14:07 am
• Reincarnation of UltraSonic50
how about changing the get-hit animations (5000-whatever) using variables and "ifelse" trigger?

Anyway, I can use this for my edit.

#### _Josue_

##### Re: Transformations in Mugen, DBZ style
#15  June 11, 2009, 05:10:22 am
• Freedom is the right of all sentient beings.
I don't know whether what I'm about to do is right or wrong,
however I think there's a genius among us that already solved this trouble:
The maker of reploids
Yes, N-mario, and I say this because Vent&Aile have up to 7 transformations and can keep track of the correct animation even in custom states. I know N-mario already said Vent&Aile were unfinished crap, (and he abandoned them because of his rockman game I guess...)
However the three models that are working (X,Zx and Ox) can be normally thrown without loosing the corresponding anim i.e. you throw them as model Ox and they remain as model Ox while thrown.
Yet, even being "unfinished crap" (some sprites are not correct)
the problem is that I can't seem to find how the heck he did it.
I wanted to try to work on them so I asked him "where's the trick",
and he only answered with evasive. ???

#### LivingVoodooDoll

##### Re: Transformations in Mugen, DBZ style
#16  June 11, 2009, 07:51:03 pm
As far as i know FIREBOY the MK mugen creator did a shang tsung that can fully transform.maybe u should ask him.Also there is a twelve done by "rei" he can transform sakura and ken.Folder contains all 3 chars' def in it.but it turns to twelve whenever it is thrown.Anyway its not looking so absurd in those chars. but probably suck at DBZ chars.

#### XGargoyle

##### Re: Transformations in Mugen, DBZ style
#17  June 11, 2009, 08:46:34 pm
• Hedgehog Whisperer
@Josue: What GCNMario did is a full game, where you know beforehand the sprites that each character will require during a custom state. This is nothing out of the extraordinary, and any developer with a basic experience can do it.

What is impossible, is doing that on a standard and open mugen environment.
 XGargoyle: Battle posing since 1979http://xgargoyle.mgbr.nethttp://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that linkhttp://paypal.me/XGargoyle  <-- Donations welcome!

#### _Josue_

##### Re: Transformations in Mugen, DBZ style
#18  June 12, 2009, 06:49:00 am
• Freedom is the right of all sentient beings.
@Josue: What GCNMario did is a full game, where you know beforehand the sprites that each character will require during a custom state. This is nothing out of the extraordinary, and any developer with a basic experience can do it.

What is impossible, is doing that on a standard and open mugen environment.

Wait a minute. I don't get it, why do you say "full game", Vent&Aile are just chars, they can be thrown in any mugen by any other char that means they can be put into any custom state you
desire no matter who is the opponent or what kind of throw made!
Or I just misunderstood the whole thing ???

#### XsLaught

##### Re: Transformations in Mugen, DBZ style
#19  June 12, 2009, 08:51:43 pm
I believe I know how this can work with transformations. I believe it was discussed long ago.

Your required get hit sprites must all have all forms in them but with their offset way separate. Like say 1000 pixels separate in the y-axis. This way when you are in a custom state, the sprites for both forms are shown. However what will appear on screen is the current form and the other form will be 1000 pixels or so above or below depending on how you set it.

Use the offset controller to trigger when you are in a custom gethit state. This would have to be put in statedef -2. Apply the offset for y so that it will be offset by 1000 in form 2 when in a custom state to show form 2's sprites on screen with form 1's sprite 1000 pixels above/below depending on how you set it.

I haven't tested it out but it should work.

Hope someone understands it.
Last Edit: June 12, 2009, 09:00:46 pm by XsLaught

#### Byakko

##### Re: Transformations in Mugen, DBZ style
#20  June 12, 2009, 11:56:26 pm
Won't work if the enemy uses a targetbind or a constant posset in the custom state.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.

#### XsLaught

##### Re: Transformations in Mugen, DBZ style
#21  June 13, 2009, 12:01:53 am
Won't work if the enemy uses a targetbind or a constant posset in the custom state.

I'm not talking about the position offset but the display offset. PosSet and TargetBind would affect the position but not the display. The Offset sctrl would have to be applied every tick in the custom state.
Last Edit: June 13, 2009, 12:05:19 am by XsLaught

#### Byakko

##### Re: Transformations in Mugen, DBZ style
#22  June 13, 2009, 01:31:57 am
... type = Offset affects the display and not the axis ? Never tested it...
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.

#### _Josue_

##### Re: Transformations in Mugen, DBZ style
#23  June 13, 2009, 02:16:28 am
• Freedom is the right of all sentient beings.
I believe I know how this can work with transformations. I believe it was discussed long ago.

Your required get hit sprites must all have all forms in them but with their offset way separate. Like say 1000 pixels separate in the y-axis. This way when you are in a custom state, the sprites for both forms are shown. However what will appear on screen is the current form and the other form will be 1000 pixels or so above or below depending on how you set it.

Use the offset controller to trigger when you are in a custom get hit state. This would have to be put in statedef -2. Apply the offset for y so that it will be offset by 1000 in form 2 when in a custom state to show form 2's sprites on screen with form 1's sprite 1000 pixels above/below depending on how you set it.

I haven't tested it out but it should work.

Hope someone understands it.

Understood, seems to be a good possibility,

M.U.G.E.N 2002.04.14 Manual said:

Changes the player's display offset. The player is drawn shifted from his axis by this amount.

However now the question is :
Trigger1=???
How do you know you're in a custom state?
maybe excluding ALL your own states?

[State -3, Offset]
type = Offset
x = 1000*var(Trans_Control)
ignorehitpause = 1
Trigger1= stateno != [0,20]
Trigger1= stateno != [130,132]
Trigger1= stateno != [5000,5900]
;and so on

and what if the stateno # is the same as in your foe's custom state?
is there any easier way to detect custom states?
I still wonder what the heck N-mario did to make Vent&Aile work!

#### XsLaught

##### Re: Transformations in Mugen, DBZ style
#24  June 13, 2009, 03:33:15 am
I use a simple variable to check if I am in a custom state using the knowledge statedef -3 is not checked when you are in a custom state.

In statedef -2:

[State -2, SelfState Check]
trigger1 = 1
var(22) = 1

In statedef -3:

[State -3, SelfState Check]
type = VarSet
trigger1 = 1
var(22) = 0

[State -3, SelfAnim Check]
type = VarSet
trigger1 = 1
var(23) = Anim

Any code that should execute for when you are in a custom state should be above that first state controller with trigger1 or triggerall = Var(22).

ex:

[State -2, OffSet]
type = OffSet
trigger1 = Var(22)
trigger1 = Var(50) = 2 ; Form 2
trigger1 = Anim != Var(23) ; You probably need this trigger to see if your anim changed from when you were in your own states.
trigger1 = Anim != [5000, 5510] ; In case you are put into a custom state and use your own action number
trigger1 = Anim != [0, 195] ; In case you are put into a custom state and use your own action number
x = 0
y = 1000 + (ScreenPos Y < 0) * (ScreenPos Y) + (ScreenPos Y >= 240) * (ScreenPos Y - 240) : I think this is the correct math.
; I may be off on the math

[State -2, SelfState Check]
trigger1 = 1
var(22) = 1

The offset sctrl needs to be adjusted for incase the player is moved off the screen. Use the ScreenPos Y trigger for it.

This assume the opponent does not use a custom action number between 0, 195 and 5000, 5510 for your gethit sprites. That's the problem with this. To work around that would be a bit more complicated as you need to detect if you are using your own action number or one from your opponent's .air file. I guess one way (not the best way) to get around this is to make sure every sprite you use for action numbers 0-195 and 5000-5510 has both forms in them. Then you can remove those bottom 2 triggers. Or you just make adjustments for each of those action numbers by using ChangeAnim, SelfAnimExist, etc. I can't think of an easy way to get around this at the moment. Like if the opponent puts you in a custom state then use your own dizzy animation.

EDIT:
AnimExist
"The result of this trigger is undefined if the player has been placed in a custom state by a successful hit"
I believe this trigger can be used to detect if you are using an anim from your .air file or your opponent's .air file.
Last Edit: June 13, 2009, 04:04:58 am by XsLaught

#### MirageAtoli

##### Re: Transformations in Mugen, DBZ style
#25  June 13, 2009, 07:24:18 am
• +1 to whoever added Godzilla to the main index.
Does the CLSNs move when the "player is drawn shifted from his axis by this amount"? Do the CLSNs stay in place or should they be drawn around all of the forms in the gethit sprites?
i think we should call it an "engine" so we don't look like total idiots because otherwise we'd be arguing about a "game" and that would be somehow "dumber" than arguing about an "engine" on the "internet" for countless hours

Iced said:
I for one, do not enjoy round corners!
But they hurt much less when we accidentally hit them!

#### Cyanide

##### Re: Transformations in Mugen, DBZ style
#26  June 13, 2009, 07:33:04 am
• Legendary XIII
• I am the eye of the storm to come!
Unless you do all of them, it breaks if using something like flowagirls flash battle code, which looks for your basic attacks and plays them. Also, there is still the chance that through some sort of fluke they posset you by 1000 in some direction and your other sprite shows, and AFTER all that, there's still the fact that the sff is going to be about 20 times bigger than it would have been if you'd just left it as it was.

In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

#### _Josue_

##### Re: Transformations in Mugen, DBZ style
#27  June 13, 2009, 08:25:54 am
• Freedom is the right of all sentient beings.
Unless you do all of them, it breaks if using something like flowagirls flash battle code, which looks for your basic attacks and plays them. Also, there is still the chance that through some sort of fluke they posset you by 1000 in some direction and your other sprite shows, and AFTER all that, there's still the fact that the sff is going to be about 20 times bigger than it would have been if you'd just left it as it was.

Besides of those issues XsLaught's method seems to work. if the offset is 10000 instead of 1000
bugs will be less likely to happen.
I think that if you're going to use this method to have transformations, you must still "do all of them".
However I still wonder what N-Mario did to Vent&Aile so they can be thrown by any char on any mugen.

[...]
I wanted to try to work on them so I asked him "where's the trick",
and he only answered with evasive. ???
someone said "full game" but I don't get why.

#### XsLaught

##### Re: Transformations in Mugen, DBZ style
#28  June 13, 2009, 09:59:38 am
An assertspecial of flag invisible with triggers of ScreenPos Y < 0 or ScreenPos Y > 240 will solve the other sprite appearing on screen accidently. Numbers can change to fit the character.
As for the file size, yeah that can't be avoided. 1000 difference is a bit big. It could probably be reduced a bit to optimized the SFF file.
For using basic attack anims, that is a tough issue to solve. You could use

[State -2, ChangeAnim]
type = ChangeAnim
trigger1 = Anim < 9999
trigger1 = Var(50) = 2; 2nd form
trigger1 = Var(22) && Anim != Var(23) ; In custom state and anim was changed from when you were in your own states
trigger1 = SelfAnimExist(Anim + 10000)
value = Anim + 10000 ; Can adjust

Where form 2's action numbers are in the 10000s. This only works for if the opponent uses ChangeAnim in the custom state instead of ChangeAnim2

However, suppose the code in the other player does require detecting p2's anim. You do not want to interfere it. You could make yourself invisible when in a custom state and not change the anim allowing P2 to detect everything as if nothing happened. Use a helper to appear over yourself giving the illusion it is P1. Have it be binded to P1 with the same anim at start then have it use:
[State xx, ChangeAnim]
type = ChangeAnim
trigger1 = Anim < 9999
trigger1 = SelfAnimExist(Anim + 10000)
value = Anim + 10000 ; Can adjust

Again this only works if the opponent uses ChangeAnim instead of ChangeAnim2.

You cannot detect if you are using an anim from your opponent's .air file or your own .air file. Meaning you cannot tell if ChangeAnim or ChangeAnim2 was used in the custom state.

So suppose the opponent puts you in your own action number 5300 using ChangeAnim. You could just ChangeAnim to 15300 within state -2 to show form 2's anim "5300". However, if the opponent puts you into their own action number of say 850 using ChangeAnim2. You would have to apply the Offset method to show form 2's sprite on screen. You won't know when to use which.

The best way I can think of of detecting if ChangeAnim or ChangeAnim2 was used would be to use SelfAnimExist(Anim). This wouldn't work if you have the same action number in your air file as the one your opponent is using to put you into a Custom State. You could create a helper with that same action number and see if the AnimTime matches to check if it is the same anim but it won't always work.

As for Clsn boxes. They stay with the position not the display.

#### _Josue_

##### Re: Transformations in Mugen, DBZ style
#29  June 13, 2009, 07:11:25 pm
• Freedom is the right of all sentient beings.
[...]
The best way I can think of of detecting if ChangeAnim or ChangeAnim2 was used would be to use SelfAnimExist(Anim). This wouldn't work if you have the same action number in your air file as the one your opponent is using to put you into a Custom State. You could create a helper with that same action number and see if the AnimTime matches to check if it is the same anim but it won't always work.

As for Clsn boxes. They stay with the position not the display.

well, after all this, we can conclude that:
1.-When our char is in a custom state we can detect wheter the animation is within our AIR file or not
(maybe not accurately though?)

2.-if it's within our AIR we use

trigger1 = SelfAnimExist(Anim + 10000)
value = Anim + 10000*Var(Transformation_numer) ; Can adjust

Seems like this is what Aile&Vent uses, however it doesnt explain why it works in custom states.

3.-If it's not we use the offset trick.

[State -2, OffSet]
type = OffSet
y = 1000*Var(50)
trigger1 = Var(22)
;[...]

therefore all sprites that are normally used to create custom state animations will have a 1000 offset
all other sprites will go normally.
With this almost all problems seem solved, however I still wonder if there's anything else that can make this fail.

I also had an Idea but...
Spoiler, click to toggle visibilty
I'm not saying this is practical, but if it had been standard when elecbyte created MUGEN
most of this problem wouldn't exist.

#### The Railgunner

##### Re: Transformations in Mugen, DBZ style
#30  July 11, 2009, 02:06:33 am
• Sunglasses Security Guy is watching you necrobump.

#### Shmoodle

##### Re: Transformations in Mugen, DBZ style
#31  October 15, 2014, 03:35:01 am
• Pokemon Master in Training
So then could i use this code to make Goku Z2 transform into Super Saiyan Goku Z2?
Then there were none...

#### XGargoyle

##### Re: Transformations in Mugen, DBZ style
#32  October 15, 2014, 08:50:58 am
• Hedgehog Whisperer
 XGargoyle: Battle posing since 1979http://xgargoyle.mgbr.nethttp://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that linkhttp://paypal.me/XGargoyle  <-- Donations welcome!

#### AlexSin

##### Re: Transformations in Mugen, DBZ style
#33  October 16, 2014, 11:56:42 pm

#### XGargoyle

##### Re: Transformations in Mugen, DBZ style
#34  October 17, 2014, 08:49:26 am
• Hedgehog Whisperer