YesNoOk
avatar

Transformations in Mugen, DBZ style (Read 75145 times)

Started by The Railgunner, December 01, 2008, 11:52:47 am
Share this topic:
Re: Transformations in Mugen, DBZ style
#21  June 13, 2009, 12:01:53 am
  • avatar
  • **
    • www.codejin.com
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
Re: Transformations in Mugen, DBZ style
#22  June 13, 2009, 01:31:57 am
  • avatar
  • ******
... 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.
Re: Transformations in Mugen, DBZ style
#23  June 13, 2009, 02:16:28 am
  • ***
  • Freedom is the right of all sentient beings.
    • akkuis1173.me.pn/
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!
Re: Transformations in Mugen, DBZ style
#24  June 13, 2009, 03:33:15 am
  • avatar
  • **
    • www.codejin.com
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]
type = VarAdd
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]
type = VarAdd
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
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!  :bigcry:
But they hurt much less when we accidentally hit them!  :S
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!
    • New Zealand
    • network.mugenguild.com/cyanide/
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.
Re: Transformations in Mugen, DBZ style
#27  June 13, 2009, 08:25:54 am
  • ***
  • Freedom is the right of all sentient beings.
    • akkuis1173.me.pn/
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.
Re: Transformations in Mugen, DBZ style
#28  June 13, 2009, 09:59:38 am
  • avatar
  • **
    • www.codejin.com
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.
Re: Transformations in Mugen, DBZ style
#29  June 13, 2009, 07:11:25 pm
  • ***
  • Freedom is the right of all sentient beings.
    • akkuis1173.me.pn/
[...]
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.
Re: Transformations in Mugen, DBZ style
#30  July 11, 2009, 02:06:33 am
  • ****
  • Sunglasses Security Guy is watching you necrobump.
    • x-ism.co.cc/index.html
Re: Transformations in Mugen, DBZ style
#31  October 15, 2014, 03:35:01 am
  • **
  • Pokemon Master in Training
    • USA
    • djsims2012@gmail.com
So then could i use this code to make Goku Z2 transform into Super Saiyan Goku Z2?
Then there were none...
Re: Transformations in Mugen, DBZ style
#32  October 15, 2014, 08:50:58 am
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
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: Transformations in Mugen, DBZ style
#33  October 16, 2014, 11:56:42 pm
  • ******
Re: Transformations in Mugen, DBZ style
#34  October 17, 2014, 08:49:26 am
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
Well, I didn't notice the necrobump and all I saw was Vegeta 20XX's comment about his method and Shmoodle's silly question :P

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!