Can somebody explain this?- new question.

Started by BC, January 09, 2010, 07:13:09 PM

Previous topic - Next topic

BC

Okay I'm never good at explaining stuff without confusing things so I'll try my best.

I'm coding street fighter alpha characters as some may or may not know, and I like to use their method of normal hitsound when p2 is alive and echo hitsound when p2 is dead.

My method works but isn't reliable in training mode.

Hitsound=S200,ifelse(enemynear,life<2,999,0)

200,0 is normal hitsound 200,999 is non existent this is where this comes in:

[State 200, PlaySnd]
type = PlaySnd
triggerall = Winko
trigger1 = movehit
value = S200,1 ;Echo hitsound
volume = 255
ignorehitpause = 1
persistent = 0

this allows the normal hitsound to play up untill p2 life = 1 or less then it plays a blank sound and by that time after getting hit p2 is dead and it plays the echo hitsound.

in training mode if you get p2's life to 1 no hitsound plays (well thats what i wanted) but not in training mode.

and i cant use this  Hitsound=S200,ifelse(winko,1,0) because there is a 1 second delay between roundstate 2 and  winko || roundstate3
so just the normal hitsound plays.


ok all that out the way i noticed sepp uses a completely different and more successful method for his akuma which doesn't have the problem i have BUT i don't understand it so if i post in a spolier mayb someone can help me understand it and its purpose.


below please look at triggers 2,3,4,5
Spoiler (click to show)
; Madness
[State -2, Hahaha]
Type = AssertSpecial
TriggerAll = RoundState = 2
Trigger1 = Var(1) := (StateNo = 52 && (PrevStateNo != [1400, 1500)) && Command != "holddown")
Trigger2 = (Var(13) := (P2Life * EnemyNear, Const(Data.Defence) / 100)) && 0
Trigger3 = (Var(13) > EnemyNear, lifemax / 3)
Trigger3 = (FVar(2) := 1) && 0
Trigger4 = Var(13) = (EnemyNear, lifemax * .08, EnemyNear, lifemax / 3]
Trigger4 = (FVar(2) := .8) && 0
Trigger5 = Var(13) <= EnemyNear, lifemax * .08
Trigger5 = (FVar(2) := .6) && 0
Trigger6 = HitPauseTime = 1 && P2MoveType = H && MoveHit
Trigger6 = (FVar(4) := (FVar(4) + 1)) && 0
Trigger7 = P2MoveType != H
Trigger7 = FVar(4) := 0
Trigger8 = FVar(4) < 4
Trigger8 = (FVar(3) := 1) && 0
Trigger9 = FVar(4) = 4
Trigger9 = (FVar(3) := .8) && 0
Trigger10 = FVar(4) = 5
Trigger10 = (FVar(3) := .7) && 0
Trigger11 = FVar(4) = 6
Trigger11 = (FVar(3) := .6) && 0
Trigger12 = FVar(4) = 7
Trigger12 = (FVar(3) := .5) && 0
Trigger13 = FVar(4) = 8
Trigger13 = (FVar(3) := .4) && 0
Trigger14 = FVar(4) = 9
Trigger14 = (FVar(3) := .3) && 0
Trigger15 = FVar(4) = 10
Trigger15 = (FVar(3) := .2) && 0
Trigger16 = FVar(4) >= 11
Trigger16 = (FVar(3) := .1) && 0
Trigger17 = (FVar(1) := (FVar(2) * IfElse((StateNo >= 3000 || NumHelper(3000) || NumHelper(3001)) && FVar(4) < 12, 1.0, FVar(3)))) && 0
Trigger18 = P2StateType != A || Var(0) || HitDefAttr = SCA, SA, HA || NumHelper(1000) || NumHelper(3000) || NumHelper(3001)
Trigger18 = Var(15) := 0
Trigger19 = !Var(0) && P2StateType = A && HitDefAttr = SCA, NA && MoveContact && P2MoveType = H
Trigger19 = (Var(15) := 1) && 0
Trigger20 = (Var(20) := IfElse(StateNo = 220 || StateNo = 250 || StateNo = 310 || StateNo = 330 || StateNo = 420 || StateNo = 450 || StateNo = 620 || StateNo = 650 || StateNo = 720 || (HitDefAttr = SCA, SA, HA), 2, 1)) && 0
Trigger21 = (MoveType != H && P2MoveType != H && !HitPauseTime) || ((MoveType = H ^^ P2MoveType = H) && !HitPauseTime)
Trigger21 = (Var(16) := IfElse(P2MoveType = A, 1, 0)) && 0
Trigger22 = NumTarget || (MoveType = H && P2MoveType = H && !Time)
Trigger22 = (Var(17) := 1) && 0
Trigger23 = Var(0) := IfElse(EnemyNear, BackEdgeBodyDist <= 10 || EnemyNear, FrontEdgeBodyDist <= 10, 0, 1)
Flag = NoJuggleCheck
IgnoreHitPause = 1


Then in hidef

HitSound = S200, IfElse(Var(13) > 35 * FVar(1), 1, 2)  

Fvar(1) by the way is just attackmulset being 1.0


ok so var(13) is clearly set in this assert special but why for nojugglecheck and how does it work with playsnd?
in debug var(13)=900 when you deplete p2 life by pressing f2 it becomes 0
(there are no other varsets for var(13) other than being assigned there)

so yea anyway if someone could explain and help me to understand that i would be greatful.
Accepting commissions

Byakko

#1
Quotein training mode if you get p2's life to 1 no hitsound plays (well thats what i wanted) but not in training mode.
In training mode but not in training mode ? :S

Quoteok so var(13) is clearly set in this assert special but why for nojugglecheck and how does it work with playsnd?
Just because. It's not related to the nojugglecheck itself, it's there because it fits the triggers.
In
Trigger3 = (Var(13) > EnemyNear, lifemax / 3)
Trigger3 = (FVar(2) := 1) && 0
what you have is, if var(13) is this or that value, then set fvar(2) to that. That's all. You just also happen to need the same triggers to trigger the nojugglecheck, but it could be anywhere else, even on a type = null. Sepp simply put it in the same sctrl for the hell of it.
How does it work with playsnd : well, var(13) is set to various values depending on the enemy's current life ; it seems the hitsound played depends on the opponent's remaining life (see the various possible values for var(13) and how they're set in that list of triggers) rather than the attack, but that's just the system he decided to use for whatever reason. If you have a different system, just use yours and don't bother. In the ennd, all his code does for the hitsound is either play 200,1 or 200,2 ; at the end of the day you just have to check which is what to know what he's doing. If var(13) is 0 in the case you need, it will play 200,2 and that's that.


..... Anyway, I'm not sure I understand why you need to use the sound 200,999 that doesn't exist. Basically the only difference between the two codes (on the topic of which sound to play) is that you use an non-existent sound and then play the other sound you want, but why do you need to do that ? Your normal hitsound is 200,0 and your echo hitsound is 200,1, if I get it right. why do you play the non-existent 200,999 and then add the 200,1, especially if you see it doesn't work right ? I can't find any relevant trigger in your code that justifies making a separate sctrl... Either there's enough life, or there isn't.
I also don't really understand the "enemynear,life<2" trigger (well, the condition for your ifelse). What if the enemy has more than 2 life, but the hit still kills him ? Sepp's list of triggers specifically checks if his hit is strong enough to kill the opponent depending on his remaining life (35 being his attack power, multiplied by his attackmulset, and checking if it's more than the opponent's current life + taking into account the opponent's defense - the purpose of using var(13) instead of just p2life), while you only check if the opponent has less than 2 life.
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.

BC

#2
QuoteIn training mode but not in training mode ? :S

lol i mean't in anything but training mode (vs,arcade). Because you can't kill p2 in training mode so you will always get the blank sound because the other playsnd was only activated in roundstate 3 or winko.

But yea my method isn't great i couldn't think of any other way untill seeing sepps method.

QuoteAnyway, I'm not sure I understand why you need to use the sound 200,999 that doesn't exist.

i would have used S200,ifelse(winko,1,0) but that doesn't work due to the 1 tick delay between p1 dead and roundstate 3. This would only play the normal hit sound and if it was a multi hit it would only play the echo the second hit because p2 would already be in roundstate 3.

the blank sound was just so a sound wont play so i get no interference when i use the winko playsnd.... i know it sounds odd i know what i wanted to do, but i just didn't know how to get the right method so i was trying out stuff.

and you're right if the hit could still kill p2 but his life was like 10 both normal and echo would play &gt;_&gt;  although you don't actually notice a difference because the echo sound is louder but yea both play.


Also thanks for explaining sepp's method

by doing this i got the results i wanted:

[State -2, Null]
type = Null
TriggerAll = RoundState = 2
Trigger1 = (Var(13) := (P2Life * EnemyNear, Const(Data.Defence) / 100)) && 0
Trigger2 = (Var(13) > EnemyNear, lifemax / 3)
ignorehitpause =1

hitsound = S200, IfElse(Var(13) > 27, 0, 1)  ;damage for light punch = 27
Accepting commissions

Byakko

[State -2, Null]
type = Null
TriggerAll = RoundState = 2
Trigger1 = (Var(13) := (P2Life * EnemyNear, Const(Data.Defence) / 100)) && 0
ignorehitpause =1

=>

[State -2, Null]
type = varset
Trigger1 = RoundState = 2
Var(13) = P2Life * EnemyNear, Const(Data.Defence) / 100
ignorehitpause =1

:P
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.

BC

Ok so turns out i wasn't happy with the previous method. So i found another method

(reason i wasn't happy was beause i was getting undesired results, for example... normal hitsound would play for say a hard punch if p2's life is > 118, and if 118 then the echo hitsound would play, BUT during combos near the end of p2's life the damage dampener came into play and compressed the damage of the hard punch so the damage of the hard punch was probably less than 118 so it played the echo hitsound before p2 was dead.)... im using the typical enemynear,gethitvar(hitcount) damapeners.

so moving on:

for those who haven't read the whole topic, basically i want a normal hitsound on movehit and an echo hitsound on ko

[State 200, hitsnd]
type = PlaySnd
trigger1= movecontact
value = ifelse(moveguarded, 199, 200), !p2life && roundstate > 2
channel = 1
ignorehitpause = 1

ok so the above code for a standing light punch clearly will play persistently, but the problem is when persistent it works, it plays 200,0 on movehit and it plays 200,1 when i ko'd player 2.  !p2life && roundstate > 2  being = to 1


however if i add persistent = 0  the ko sound wont play.

yes im having the same issues over and over again but im trying to find the best method.
Accepting commissions

kakkoii superhero

#5
how about using trigger alive = 0 for the echo or alive = 1 for non echo

wait sorry so it is for P2.. hmm

seems like you have to make in statedef -2
playsnd
with trigger for every attack you have

like:
stateno(state of your attack) && p2 life <= (insert amount of damage of that attack) && movehit
stateno(state of your attack) && p2 life <= (insert amount of block damage of that attack) && moveguarded


BC

#6
"insert amount of damage of that attack"

again i would have problems with that due to the damage dampener.

if the damage of the attack is 45 and i did a combo near the end of p2's life and p2 had 45 life left and i finished off the combo with that attack and the attacks damage got compressed to half or something due to the amount of hits dealt and my dampener taking effect it would play the echo sound before p2 died because the damage would be less than 45.


using the exmaple could work if i could get it to stop playing persistently in -2.


ok so far so good, ill do some further testing with combos and stuff but this works i used a helper instead

[State -2, Helper]
type = Helper
triggerall = !numhelper(5454)
trigger1 = stateno=200&&p2life<=41&&movehit
helpertype = normal ;player
name = "sounds"
ID = 5454
stateno = 5454
pausemovetime = 99999
ignorehitpause = 1


then in the helper state just a normal playsnd with !time as trigger.


ok im getting weird results near the end,  if p2 has like 50 something life and i use light punch it plays the echo sound before i kill p2..probably because p2's life is now less than 41 so the helper is triggered.
Accepting commissions

kakkoii superhero

how about separating the hit sound from the following echo, so it always play the same hit sound, but when the opponent dies, it will be followed by the echoes after the hit sound

BC

not sure what you mean ?


also for now i've just done it like this for now, wether they play at the same time during ko doesn't matter for the stronger hits because you really only hear the echo due to it being louder than the normal but the problem is for light attacks, the echo's aren't as loud so you can kinda hear the double sound.

[State 0, PlaySnd]
type = PlaySnd
triggerall = roundstate = 2
trigger1 = movehit=1
value = S250,0
volume = 255
channel = 1
ignorehitpause = 1
persistent = 0

[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life=0
trigger1 = movehit=1
value = S250,1
volume = 255
channel = 1
ignorehitpause = 1
persistent = 0
Accepting commissions

Byakko

#9
Why aren't your triggers mutually exclusive ? If you're worried that they play at the same time, the first thing you should do is make them so they can't happen at the same time. Here, if they play at the same time, it can only mean that there is one tick where roundstate is 2 AND movehit is 1 AND p2life is 0. Out of these triggers, you should easily find out which one you have to forbid for one of the two sounds to not play when the other is triggered. The important bit is that movehit=1 is only true for one tick and is needed for either case, so this one is a keeper ; thus, chances are, the ones that clash are the other two : at one point, P2life is = 0 while roundstate is still 2.
I don't know at what point the target's life is decreased, it's possible it's done instantly at movehit=1 (seems it is, considering the KO version works, as I understand). So why don't you just put triggerall = p2life > 0 for the normal hitsound (instead of roundstate = 2) ? It doesn't seem to me like you actually need roundstate = 2 more than p2life > 0 for the normal hitsound.
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.

BC

ok so i tried this...

[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life > 0
trigger1 = movehit=1
value = S200,0
volume = 255
channel = 1
ignorehitpause = 1
persistent = 0

[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life=0  ;wait did you say not to use this?
trigger1 = movehit=1
value = S200,1
volume = 255
channel = 1
ignorehitpause = 1
persistent = 0

both sounds are still noticably playing at the same time during ko or just before (as in when you ko p2 and also when the life of p2 is less than the damage of the attack).  I used scroll lock to frame step and theres a noticable 1 tick gap. which im guessing is roundstate 3 being the 1 tick gap... seeing as there is a 1 tick delay between roundstate 2 and 3.
Accepting commissions

kakkoii superhero

Quote from: BC on February 01, 2010, 02:35:11 PM
not sure what you mean ?


whta i meant was separating the sound like

hadouken(normal)
hadouken douken ouken ken en n (+ echo)

douken ouken ken en n (echo only)
just add this echo only when P2 KO, the prior sound just the same basic "hadouken"

Byakko

#12
... Okay, I can't see how movehit can be 1 on two different ticks :blank: If there's a one tick gap, the value of movehit should change inbetween to 2. ... Unless there are two hits.
I don't know, try displaying the value of P2Life and MoveHit in the DisplayToClipboard, and see which value changes on what tick ? I don't understand why movehit would still be 1 one tick later.
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.

BC

ok so i set up the DTC.

i pressed f2 to get p2's life to 1, at this point obviously movehit = 0 and p2life = 1  then i hit p2 (im using scroll lock so i dont miss anything)  and when i killed p2, like when his death voice played... in debug movehit = 1 and p2life still = 1  for a 1 tick delay (hence roundstate = 2 - roundstate = 3 delay.) then after 1 tick it changes to p2life = 0.


heres a screenshot showing p2 is dead but his life still = 1 which explains why the normal hitsound plays still.

Accepting commissions


BC

theres always been a delay between roundstate 2 and 3 i think (correct me if im wrong) because negative states don't read time = 0.
Accepting commissions

kakkoii superhero

well, I dunno, how many hit sound you intended to use, maybe like I said separating the echo only from the basic sound would be much more easier, since you don't need to replace any sound, just add followup echo as P2 life = 0

Byakko

What happens when you remove ignorehitpause = 1 ? Any hitsound would play after the pause, but if you have a point where P2life is still 1 and movehit is 1 when he should be dead, I can't see any other way around it. The problem would be to make sure P2 is dead even if his life isn't 0 yet, and roundstate isn't 3 yet. Apart from waiting until after the pause is done, I can't see how you would do that...
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.

BC

yea when i remove ignorehitpause = 1 on the normal sound then yea i don't have a problem of them both playing. But now obviously the hitsound will only play after the pause of the attack as you said.

playing both sounds on top of each other(if i have to) isn't a problem nor noticable with the strong attacks, it almost blends perfectly well together, it's just the light attacks that's more noticable that 2 sounds are playing unevenly.(1 tick delay)

So if there's no way around it i guess i'll just have to put up with it for now.
Accepting commissions

Seravy

Quoteheres a screenshot showing p2 is dead but his life still = 1 which explains why the normal hitsound plays still.
Try the same on P2 side. Characters are executed in the order of P1 first then P2, if the life is only set when the execution starts for that player, it can easily result in P1 detecting P2's life as 1 when in reality it is already 0. (I've never checked this before, but it is the most likely reason)
The best you can do is the trigger the whole thing on movehit=2 instead of movehit=1, and check for P2's life then.