News:

MFG's Character of the Month: October 2026 Nominations

Main Menu

POTS - multiple damage value method

Started by Momotaro, August 23, 2020, 10:09:55 PM

Previous topic - Next topic

Momotaro

I need help to understand the method used in POTS characters (in other as well I think)

Since this method use 1 state for all versions of the special move (light, medium, strong)
The hitdef damage value depend on the button used.

This code is from J Morphman's Chun Li.

But I have difficulties understanding the structure of code.

Can you decode it and explain it a bit, parlticularly where are the actual damage values for each version of move.
THANKS

varset.
[State 1200, Button Detect]
type = VarSet
trigger1 = !Time && !AILevel
;ifElse((command = "c" || command = "rlsc"), 2, ifElse((command = "b" || command = "rlsb"), 1, 0))
var(10) = ifElse((NumExplod(90000250) || NumExplod(90000255)), 2, ifElse((NumExplod(90000240) || NumExplod(90000245)), 1, 0))


damage in hitdef
damage = ceil(ifElse(fvar(11) * ifElse(var(10), ifElse(HitCount > 2 && var(10) = 2, 14, 21), 35) < 7, 7, fvar(11) * ifElse(var(10), ifElse(HitCount > 2 && var(10) = 2, 14, 21), 35))), 7


I'm also looking for a good reference of different velocity depending on the button used. Light Medium or Strong.

VictorCYBR

var(10) is used to detect what button is pressed, the commented line is what would be a character without the Explodsive Buffering System, and can serve as a clean example since the EBS is a bit scary.

For the damage, here is pure math. A few things I can explain:
ceil = will round the number up
floor = will round the number down
* = multiply

There is also a dampener here (fvar(11)) and a hit count so all the damage is being multiplied by them. The dampener is in state -2 if I remember correctly. This is not the best move to take as an example because of the hit count...

Anyway, onto the actual var(10) value and damages.

input | value set to var(10)
LK or LP = 0
MK or MP = 1
HK or HP = 2

Now for the damage, it's basically checking what number is var(10) with "ifelse", and using proper damage values. If there was no dampener and hit count, it would probably look like this (using other values as example):
ifelse(var(10) = 2, 35, ifelse(var(10) = 1, 28, 21))
translating: if var(10) is 2 (strong punch/kick), damage will be 35, otherwise (then anoter condition happens) if var(10) is 1 (medium punch/kick), damage is 28, otherwise damage is 21.

Hopefuly everything makes sense.

Momotaro

Quote from: DeathScythe on August 23, 2020, 11:25:41 PM
Hopefuly everything makes sense.

Thanks a lot.
It helped me very much.

The fact I'm not very good with maths and not native english speaker, makes sometimes some stuffs harder to understand.

But Now I got it.
Also, yes, the cause structure from Chun li was not easy to understand because it was for her spinning bird kick, and it takes multi hits system.
With you help I identify similar code and stucture in other characters move, and now , I got it I think !