Making of the Super Butouden fly codes Note: Many times I've asked the 'naysayers' of my coding abilities to try and replicate this coding. Not ONE has yet stepped forward. The challenge isn't for better/best though but for KNOWLEDGE on THEIR parts (or even yours too). Think as you go down through this of ALL the multiple instances and code rewrites involved in this. Many things to learn and keep track of in the common file. You also learn that sysvar(1) is used for the run forward and backward states (1 = forward, 0 = no run, -1 = back dash). Also, these could be rewritten for using the free flight Hyper Dimension type fly codes (if they don't wish to 'copy' something). For to do that though the PosSets need to be stored in vars for the 5000 states so that the character can be reset to 'ground zero'. But really attempt this coding from the existing common file from scratch. It isn't exactly a 'cake walk' and you'll find that out soon enough. So to Inny (Infiinma) and Raggingdork (Ragnarok Nemo) Go fo it... I dare you... Not for better/best but because you should learn something from this (other than you are idiots and need to shut your mouths). In order to make this work I had to LEARN every common state and EXACTLY what it does. In addition, many times I had to rewrite sections that MUGEN itself wouldn't let you touch. All the code debugging (and since this was Elecbyte's and not my code, I used debug mode ONLY to learn which states were which sometimes - hey, I was new ONCE myself and like I said, if you CAN code you don't need it except to debug OTHER people's stuff not your own - hint also - watch them try and twist this around as usual bacause they always seem to HEAR what they WANT TO HEAR and NOT WHAT OTHERS SAY which ticks most people off including myself many times. I know what I said and the reasons BEHIND it and why it got worded certain ways. I know EXACTLY what I said because I know how I worded it for THEM to play with. Never ass-u-me when I deal with nDo, Shank or Devils. I play games on them since they do it to others. I do it back to them but they don't seem to be intelligent enough to realize this. They are so caught up in being arseholes that they don't see how idiotic they usually behave. They are so used to picking on others (that are either young and unknowledgeable or don't speak the language so can't fight back on equal ground - aka the lame and the weak) that they don't realize they've made fools of themselves in the process. Such mental midgets they are. Anyway (I know they can't figure it out {been over a year now}) so onto the flying code making discussion... The basis is that the ground = 0 and that the air = -110. Another basis is that var(12) = 0 is the ground and var(12) = 1 is the air. With this said... State 0 - standing state Just the changeanim entries. Var(12) = 0 is for the ground and var(12) = 1 is for in the air. State 10 - stand to crouch added 10,0 the velset entry. 10,1 got changed to the changeanim entry and velmul got moved to 10,2. State 11 - Crouching All changed somehow. Hyper Buu has the crouch fix (as do the aircodes.txt codes on the site): [State 11, 1] ;Change from turning animation type = ChangeState trigger1 = Statetype != C value = 12 This fix allows state 12 anims. If statetype is not crouch then it moves to state 12 the crouch to stand state. State 12 - Crouch to Stand 12,1 changeanim done State 20 - Walk Changeanims redone. State 40 - Jump Start Changeanim (of course). Velsets were divided for ground and air but not implemented. Super Butouden had slower jump velocities in the air and if I had added a multiplier (divider really) I could slow down the jump speeds like the games. I like the faster jump however so I didn't change values (but it is still possible. Probably could add a sysvar(1) = -1 run backwards state as well but didn't. Hey, Elecbyte hasn't yet either. State 45 - AirJump Start Probably ought to add code so that it looks like this (but I didn't yet, maybe later): ; AirJump Start [Statedef 45] type = A physics = N ctrl = 0 velset = 0,0 [State 45, 1] type = ChangeAnim trigger1 = SelfAnimExist(44) trigger1 = var(12) = 0 value = 44 [State 45, 2] type = ChangeAnim trigger1 = !SelfAnimExist(44) trigger1 = var(12) = 0 value = 41 [State 45, 2.1] type = ChangeAnim trigger1 = SelfAnimExist(54) trigger1 = var(12) = 1 value = 54 [State 45, 2.2] type = ChangeAnim trigger1 = !SelfAnimExist(54) trigger1 = var(12) = 1 value = 51 [State 45, 3] type = VarSet trigger1 = Time = 0 sysvar(1) = 0 [State 45, 4] type = VarSet trigger1 = command = "holdfwd" sysvar(1) = 1 [State 45, 5] type = VarSet trigger1 = command = "holdback" sysvar(1) = -1 [State 45, 6] type = VelSet trigger1 = Time = 2 trigger1 = var(12) = 0 x = ifelse(sysvar(1)=0, const(velocity.airjump.neu.x), ifelse(sysvar(1)=1, const(velocity.airjump.fwd.x), const(velocity.airjump.back.x))) y = const(velocity.airjump.y) [State 45, 7] type = VelSet trigger1 = Time = 2 trigger1 = var(12) = 1 x = ifelse(sysvar(1)=0, const(velocity.airjump.neu.x), ifelse(sysvar(1)=1, const(velocity.airjump.fwd.x), const(velocity.airjump.back.x))) y = const(velocity.airjump.y) [State 45, 8] type = VelSet trigger1 = Time >= 6 trigger1 = var(12) = 1 trigger1 = Pos Y >= -110 y = 0 [State 45, 9] type = ChangeState trigger1 = Time = 2 value = 50 ctrl = 1 State 50 - Jump Up Note: This is a state that should also be used for jump landing or 'air' attacks to change to. State 52 is the land state but is missing some important velsets and such needed for a 'smooth landing' Use state 50 for air changestates. Use state 52 IF you already have the character where they are supposed to be on the y axis before the changestate. You need to learn when to use which one. Most of the time it depends on the move itself. Changeanims redone (of course again). Wrote in velset, PosSet and Changestate. State 51 - Jump Down Except type = null, I wrote the whole part from scratch. Type = null does absolutely nothing but I left it in as a laugh. The concept behind the coding is that you want the character to jump downward but NOT go through the floor (or come out of the sky either). Hence velsets and possets. Could be rewritten better though as (but oh well): ; Jump Down (empty state for compatibility) [Statedef 51] type = A physics = A [State 51, 1] type = Null trigger1 = 1 [State 51, 2] type = Velset trigger1 = var(12) = 0 trigger1 = Pos Y < 0 y = 3 [State 51, 3] type = Velset trigger1 = var(12) = 1 trigger1 = Pos Y < -110 y = 3 [State 51, 3.2] type = Velset trigger1 = var(12) = 0 trigger1 = Pos Y >= 0 y = 0 [State 51, 3.3] type = Velset trigger1 = var(12) = 1 trigger1 = Pos Y >= -110 y = 0 [State 51, 4] type = PosSet trigger1 = Pos Y >= 0 trigger1 = var(12) = 0 y = 0 [State 51, 5] type = PosSet trigger1 = Pos Y >= -110 trigger1 = var(12) = 1 y = -110 [State 51, 6] type = ChangeState trigger1 = var(12) = 0 trigger1 = Pos Y >= 0 value = 0 ctrl = 1 [State 51, 7] type = ChangeState trigger1 = var(12) = 1 trigger1 = Pos Y >= -110 value = 0 ctrl = 1 State 52 - Jump land The playsnd, notice the var(12) = 0. That keeps the sound from playing while in the air states. Changeanims of course. Possets added in. Use this state for an air changestate if the character is ALREADY set at the ground level and doesn't need to be adjusted. State 100 - Run forward Added in the afterimage. I remember the assertspecial from v06.27.2000 MUGEN. Also, the varset is for the afterimage. State 105 - Run back Added in the afterimage and the varset to clear the afterimage with a -2 state (just like forward only var58 instead of var57). Also took out the default y value for the backdash velset. That gets rid of the 'hop'. Really difficult I know because like most coding it is usually just ONE value that you need to find to change how something behaves (or in this case delete it). State 106 - Run Backwards stop Not used. In for compatibility. State 110 and 115 - Run Up and Run Down. Not used. In for Compatibility. State 120 - Guard start (v04.??.2001 and later - added in) I could probably add a crouch guard in the air so that the character doesn't squat down (using var12) but this is fine for me. Besides, switching to the standing anim gives a bigger crouch target which I don't want. State 130 and 131, 130 - stand, 131 - crouch Nata. State 132 - Air guard Took out sysvar and used PosSets and VelSets. Altered ChangeStates as well. State 140 - Guard end Mainly velsets and possets. States 150 to 154 - Special guard states no changes - SGUARD = Standing Guard, CGUARD = Crouching Guard, AGUARD = Air Guard State 155 - Special Air Guard state Velsets and PosSets... States 170, 175, 190, 191 - Lose and Intro... Done in the chars cns file anyway (except 175 which can be copied in anyway). No need to mess with it. State 5000 - HITG_SHAKE Take your time reading through these states. Through the coding you will see how the game decides between displaying the animtype = back, animtype = hard, etc. They are contained in this area. Only alteration I did was the statetype set (5000,5). But without altering the value there then air wouldn't technically have an 'air' type in it. One of the needles in the haystack things. If in crouch state it is either 0 or -110, if in stand state it is either 0 or -110 but if in air it will be neither 0 or -110 AT SOME POINT IN TIME (if var12 = 0 and pos y is -110 it isn't true BUT the character won't stay at -110 in the air from the ground so it will reset to air again anyway). State 5001 - HITG_SLIDE The ground.slidetime area. No need to change here either. Study this though. State 5010 - HITC_SHAKE Hit C (crouch). No need to change. State 5011 - HITC_SLIDE Crouch Hit slide values. State 5020 - HITA_SHAKE Hit A (Air). Air means posset and velsets need to be altered. Well, actually, not in this case... No changes. State 5030 - Hit Up - Going up Alive trigger is introduced here. Comes in handy as well. Also, hitfall and hitover. A bit of slight altering... State 5035 - Hit Up - Transition This is the states between going up and then going back down. A = Air so the next one is Hit Air Recover or the Recover states. Slight altering... State 5040 - Recovering in air (not falling) If you press a+b by default then your character will 'recover' and not fall helplessly to the ground but will be able to attack and move on the way down. 5040,1 is interesting in itself. The !alive means no life so if you are KO'ed then you will go to state 5050. Nice to know. Each line of coding has some significance in some way. Learning to read takes time and patience (and also looking at the coding docs a lot as well). Posset, changestate... State 5050 - Knocked up falling If you don't recover (or are KO'ed) you get sent here where you have no control. Notice also 5100 and 5200 as in can recover and can't recover. Rewritten changestates (the ; should be a tip since the original code was left in but just made unseeable by the engine using semi-colons (type = null works as well). Alterations... State 5070 - HIT_TRIP (shaking) Fall = 1 or too many juggle points (old MUGEN v01.01.2000 those that remember but useless here). This is where you go when you are put into a 'trip' type state where the character is knocked down (but not knocked out). There's the trip up and then the trip down. This is actually a preliminary state before the trip up and down. State 5071 - HIT_TRIP (fall through air) This is both the up and down part. Notice the state 5110 references for changestates. After hitting the ground the 'on ground' animations need to come into play. Also, if on the ground you could possibly be a corpse aka the alive triggers. State 5080 - HITL_SHAKE L stands for... (look it up in the cns doc/text file). My guess would be Lie Down. sysvar(2) holds the info for which animation to display. If velocity of y is not equal to zero the state 5030. If equal to zero then state 5081... No changes by me. State 5081 - HITL_SLIDE Slide values. Hitover goes to 'tada' state 5110. No coding changes as well here. State 5100 - HIT_BOUNCE (hit ground) Ever notice that they hit and bounce then stay down afterwards. This is the bounce state BEFORE the stay on the ground state. A bit of code reworking here. Lots of new stuff to learn and look up here (if I kept saying everything you wouldn't learn where to look stuff up at, plus the EXTRA descriptions of stuff explained elsewhere isn't really necessary. Learn what the docs in the docs folder are). This state of course leads different ways: You can bounce and then get back up, bounce and then be KO'ed. State 5101 - HIT_BOUNCE (bounce into air) This is the bounce itself... HitFallVel? Usual Posset and Changestate alterations. State 5110 - HIT_LIEDOWN Yup, you are now on the ground. You are either KO'ed or able to get back up again. sysvar(1) is for? Well, I stated it above as 1,0,-1 for dashing but is now used to hold the y fall velocity value (floored of course and what is floor?...) Playsnd, GameMakAnim, etc. lots of stuff to play with here. That's how you really learn, playing around... Lots of different alterations here. State 5120 - HIT_GETUP You are not a corpse YET. This references the getup animations and NotHitBy? Look it up... Changestate to 0 afterwards or the stand state. No alterations needed. State 5150 - HIT_LIEDEAD You are now a corpse and the other dude wins (unless a double KO). Round over. No alterations to the corpse. State 5200 - HIT_FALLRECOVER (still falling) Look SelfStates. Only slight alterations but the varset is to reset var12 to be on the ground and not in the air. State 5201 - HIT_FALLRECOVER (on the ground) You have reached bottom now. Turn, PalFX? Information overload yet? (probably happened a while ago). Take your time. The air codes I did in 42 hours (with a few extra hours added later for debugging and such). The first 24 hours were with version 01.01.2000 MUGEN with which these were nearly impossible to work with. The last 18 hours were in late october/early november 2000 when they were nearly possible with slight visual bugs (and lots more Possets). Probably about 5 hours since then on extra stuff so 47 hours now. TAKE YOUR TIME and learn at your own pace. What is important is that it sinks in not at what speed it takes for it to sink in. This is the state where you are on the ground ready to get back up again. State 5210 - HIT_AIRFALLRECOVER You get up now. PosFreeze and NotHitBy (again). Only slight alterations. State 5500 - Continue? Arcade mode... No alterations State 5900 - Initialize (at the start of the round) Non-arcade mode. Resets. Known problem is that when the round FIRST starts all the vars are cleared just AFTER the round starts so if you try to do the fly at the VERY start of the round you will become caught between the air and the ground. Needs a pause factor but because intros can be stretched out to different times gametime isn't very effective. I'll eventually figure something out like: ;resets each tick of the intro but STOPS at end of intro state ;and keeps that value until reset in State -2, 2. [State -2, 1] type = varset trigger1 = RoundState = 1 var(5) = gametime [State -2, 2] type = varset trigger1 = (gametime - var(5)) > 70 ; over 1 second after intro var(5) = 0 Now if var(5) > 0 then you can't fly (cns entries): ;Fly up [State -1] type = ChangeState value = 767 trigger1 = command = "z" trigger1 = statetype != A trigger1 = var(5) > 0 trigger1 = ctrl = 1 trigger1 = var(12) = 0 ;Fly down [State -1] type = ChangeState value = 777 trigger1 = command = "z" trigger1 = statetype != A trigger1 = var(5) > 0 trigger1 = ctrl = 1 trigger1 = var(12) = 1 Only seems to happen in arcade mode... Character goes part way up and then stays at that up and down point. But, what do I know? They've worked on far more complicated stuff than this. I just wish THEY would release it without it looking like a copy of someone else's pre-existing codes and techniques. Many of these techniques (vars especially but p2 custom states as well) were new ground same as throw states back when I started tinkering in late october/early november 2000 (and earlier). -2 states were new ground as well. Counters and accumulators... Then they use it and then put down the one they take from. I'm definitely NOT the only one either. I know these techniques though because I invented them from the docs LONG ago and have been building more knowledge each time, over time. It didn't just happen overnight but was a process just like everyone else I've talked to that has done coding themselves. But then you see certain others just 'leap' onto the scene and do popular stuff 'to gain attention' but always seem to use other people's tricks (and/or coding). Like I said, no one just really LEAPS into being able to code. There is a progression that shows from work to work (or updates as well). It doesn't just 'happen'.