YesNoOk
avatar

Way to simulate DefenceMulSet (Read 8733 times)

Started by Mr. Shaggy, May 07, 2014, 03:50:03 PM
Share this topic:
Way to simulate DefenceMulSet
#1  May 07, 2014, 03:50:03 PM
  • avatar
  • *
    • Slovakia
    • mofowo@azet.sk
We know that DefenceMulset state controller does not work in mugen. So I was wondering how to fix it and now I want to show you first result. It's pretty simple code, but it costs much time to calculate all values to make it work properly.

The idea is add corresponding fraction of life to character when it is hitted by another. In example I've created I'm trying to add character (Goku GT) 1.6x better defence when he turns to SSJ (Var(6) = 2). Here it is:

note: code snippet must be placed in [Statedef -2] block.
note2: I'm using bigger value of Life (7738), in your case it may be something like 1000, it's not problem...

Spoiler, click to toggle visibilty

And result of it all is: It's working pretty well, but not against all characters (if they are stronger, but don't do damage more than 20% in one hit...). I don't know why. Please tell me if you will figure it out.

And 2nd thing is I was reached limitation when using integers for dividing values. I don't know if I can use float numbers for dividing in mugen. I will be glad if you will answer me.

Please try it out and tell me what you think. I will be updating this thread when will have more time and results.
Re: Way to simulate DefenceMulSet
#2  May 07, 2014, 11:26:56 PM
  • *****
  • Shame on you!
    • USA
All of that code is just so redundant looking at it. I figured there has to be a way to smash it into one group of code.

If you use
value=floor(GetHitVar(damage)*2.6)
You get roughly your values

If that doesnt work well enough for you, maybe something like



[State -2, VarSet]
type = VarSet
trigger1 = whateveryouneed
v = 99
value = floor(Const(Data.Life)/GetHitVar(damage))   ;this should give you your "/6, /7, /8..." values

[State 0, SSJ_DefenceMulSet_simulate]
type = LifeAdd
triggerall = Var(6) = 2
trigger1 = GetHitVar(damage)  = [ var(99), var(99)+1]
value= ???


Maybe there's a more accurate way to combine the two ideas?
vVv Mauru Mauru Released vVv
Re: Way to simulate DefenceMulSet
#3  May 09, 2014, 09:47:10 PM
  • avatar
  • *
    • Slovakia
    • mofowo@azet.sk
Big THANKS for helping Odb718  :) .

I was testing this code:
Code:
[State 0, SSJ_DefenceMulSet_simulate]
type = LifeAdd
triggerall = Var(6) = 2
trigger1 = GetHitVar(damage) > 0
value= floor(GetHitVar(damage)/2.4)

and it's actually good enough for using. It's producing these values:

low kick-1.703, medium kick-1.698, high kick-1.711, low punch-1.629, medium punch-1.706, high punch-1.636
combo1-1.54, combo2-1.651, combo3-1.609, combo4-1.565, combo5-1.57, combo6-1.554
weak_kamehame-1.623, medium_kamehame-1.648, strong_kamehame-1.667

But I wasn't able to make functional your 2nd code. Never mind, 1st one is good  :cool3: .