Posted by Odb718
in How do you Faultless Defense correctly? (Started by JasonThePhoenix November 01, 2023, 05:08:21 am
Board: M.U.G.E.N Development Help
Board: M.U.G.E.N Development Help
Altering blockstunBlock stun I'm not 100% sure of for random vs. A full game it's doable for sure.
altering chip damage
altering pushback on block
reducing an onscreen meter's fullness when Barrier Blocking is used
making a character take more hitstun and blockstun if that Barrier Meter is empty
refilling when empty
Chip damage yes
pushback on block, probably in random. full game is doable.
reduce meter yes
more hitstun blockstun if empty, more than likely/yes. full game is doable.
refilling when empty yes
The altering Block stun off the top of my head, I dont think there's a way to know exactly how many tics of the game any random attack is going to stun you for. P2 can send that info to P1 I believe. I've never made a system like this, but I'm pretty sure there's a tried and true method for a full game.
Chip Damage may already be coded for you in Tricks and Tips or Code Library. I would think to make maybe 2 variables to record health. Then compare those values during the hit stun. Then give P1 10% of that value back or whatever value you want.
Pushback on block you can probably accomplish pretty easy. You have to multiply the
type = VelSet
trigger1 = Time = GetHitVar(slidetime)
In the guard states. I think State 151 - 153? I believe those will be the states. But yeah you can control the velocities
stand.friction=.85
crouch.friction=.85 ;Friction coefficient when crouching
in [Movement] at the top of your char. You _may_ be able to adjust that value in the middle of the matches. Then you'd be able to use your variable to make life easy.
Getting the on screen HUD to update has been done plenty of times. But it'll help out if you plan your variable's value ahead of time.
Making the character take more time in hitstun seems like it'll go in the 151 - 153 states. You can just delay the changestate with the value of your variable.
Spoiler: Random State 151 (click to see content)
So in this State 151 you can see the ctrlset and the changestate both have different triggers. If you decide to make your variable work for both of those triggers ahead of time, you can make things easier. You can't just use hitover + var(x). So you'll need a way to have a variable, or something, keep track of when hitover happens and then count down. One method that pops up into my head is to create a clear, see-thru, blank, animation. It'll have a couple of frames. Frame one will have a -1 for the time. This makes mugen not switch to frame two. But you can make it switch to frame 2 if the animation is over. Frame 2 can be any time you want. BUT if you want the delay to be a different value, you can set multiple frames at time = 1. So say you have 16 frames. frame 1 is -1 and then you'd have 15 tics. You could changeanim to frame 14 if you wanted 3 tics of delay or frame 2 if you wanted 15 tics of delay. Then once hitover AND the animation is over, That's your changestate.
Also I think HitVelSet doesn't work any longer.
Your idea of having the variable change is good. But you can always pick different numbers. You can use negative numbers also. So you could have the value only get VarAdd if the variable is less than 0.
You could use it at 3 spots, above 0, 0, and below 0. You could use it at above 1, 1, and below 1. The "center" value and the least and highest values wont matter to mugen. So pick 3 set of numbers you can adjust the other code with easier. If you know you'll always only need 4 tics of extra hitstun, Make frame 2 four tics long and check whatever value. If the hitstun needs to be a range, you could set up the variable to make the math easier for you. Having the variable work on 3 spots be on opposite sides of 1 particular number will make life easier for you. Above, At, Below. On, Waiting, Off. Active, Waiting, Refilling. However you want to think of it.
Look up how to get the bar on the screen if you haven't already. I think the method I know moves at times so dont listen to me on how to do it.
Once you get the bar on the screen, get it working in all 3 "positions" the way you expect it. Even if it's only based on a timer.
If you need help with the StateDef -2 stuff for it, just ask.