YesNoOk
avatar

Can someone tell me how to create the stun damage health? (Read 1154 times)

Started by Fluttershy555, January 09, 2020, 01:47:15 pm
Share this topic:
Can someone tell me how to create the stun damage health?
#1  January 09, 2020, 01:47:15 pm
  • avatar
  • *
    • USA
My stun system works great and they fall over just like Street Fighter 2. The problem is it randomizes when falling over. Like for example i want then to get stun after they lose 200 health for a test and they dont. Sometimes they need to lose 500 health before falling over and sometimes 200 or 300 and so on. But i want it to be everytime they lose 200 health. This is the code that stuns them. Its in the statedef -2. I know its something in here i need to add.

[State 0, VarRandom]
type = VarRandom
trigger1 = movetype = H
trigger1 = alive
v = 5
range = 500
ignorehitpause = 1


[State 0, VarAdd]
type = VarAdd
triggerall = var(21) != 0
trigger1 = var(15) != 1
trigger1 = stateno != [120,169]
trigger1 = gethitvar(damage)
v = 21
value = gethitvar(damage)

[State 0, VarAdd]
type = VarAdd
trigger1 = timemod = 6,2
v = 21
value = -2

[State -2, VarAdd]
type = Varadd
triggerall = var(21) != 0
trigger1 = 1
v = 21
value = 1

[State 0, VarSet]
type = VarSet
triggerall = stateno = 0
trigger1 = 1
v = 15
value = 0

[State 0, VarSet]
type = VarSet
trigger1 = roundstate<2
trigger2 = var(15)>200
var(21) = 0



[State 0, ChangeState]
type = ChangeState
triggerall = statetype = S
trigger1 = ctrl = 1
trigger1 = var(21) >= 200
value = 5050
ignorehitpause = 1
ctrl = 0


Note: Var(21) is what puts them into the 5050 fall state that stuns them.
Last Edit: January 20, 2020, 05:46:32 pm by Fluttershy555
Re: Can someone tell me how to create the stun damage health?
#2  January 10, 2020, 05:26:16 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
You're requiring ctrl. Take that out. They can break out of whichever hitstate it is that way. You might want to include a nothitby as well to prevent further comboing.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: Can someone tell me how to create the stun damage health?
#3  January 10, 2020, 10:08:05 pm
  • avatar
  • *
    • USA
Thanks and i think that helped how the stun works. But i was more talking about the stun damage. Like say i put the stun health to 10. That would mean only like 1 hit would stun. I say this as an example in the fact that i want to put the stun health to my likings but for some reason they get stunned randomly. I am guessing varrandom might have something to do with it. This is whats in varrandom.

[State 0, VarRandom]
type = VarRandom
trigger1 = movetype = H
trigger1 = alive
v = 5
range = 500
ignorehitpause = 1

But i thought it would work anyway because i thought the stun damage was in the changestate here is what puts them in 5050 after beating on them.

[State 0, ChangeState]
type = ChangeState
triggerall = statetype = S
trigger1 = var(21) >= 200
value = 5050
ignorehitpause = 1
ctrl = 0

I thought trigger1 = var(21) >= 200 means they must lose 200 health before going into this state i thought but they dont do that. Sometimes they must lose 600 health before they get stunned or sometimes its after you hit them once they get stunned. I want them to be programmed where they get stunned when they lose 200 health.
Re: Can someone tell me how to create the stun damage health?
#4  January 14, 2020, 09:37:56 pm
  • *****
  • Shame on you!
    • USA
You know

[State 0, VarAdd]
type = VarAdd
trigger1 = timemod = 6,2
v = 21
value = -2

is subtracting the value right?  So even though you've done 199 damage, that value will decrease over time. If you wait long enough, you'll have to do another 200 damage to P2. If you wait even longer, Var 21 could be in the negatives???

I'm honestly having a hard time tracking what you're doing. Why are you listing Var 5? Why do you need to change the value every tic P2 is hit?
Why are you adding 1 to Var 21 every tic when it's not 0?

Use DisplayToClipboard to watch your variable's values and make sure they're acting the way you want.
vVv Ryuko718 Updated 10/31/22 vVv
Re: Can someone tell me how to create the stun damage health?
#5  January 15, 2020, 06:19:04 pm
  • avatar
  • *
    • USA
[State 0, VarRandom]
type = VarRandom
trigger1 = movetype = H
trigger1 = alive
v = 5
range = 500
ignorehitpause = 1


I put that there when i was first learning how to stun they alwaysed had this here so i thought that meant they get randomly stunned. But maybe i dont need this. I deleted it and they still get stunned.
[State 0, VarAdd]
type = VarAdd
trigger1 = timemod = 6,2
v = 21
value = -2

I put this here because i thought this meant they recover stun points after not being hit. If i take this out they for some reason dont get stunned at all and the stun system dont seem to work without this.
Re: Can someone tell me how to create the stun damage health?
#6  January 20, 2020, 05:46:58 pm
  • avatar
  • *
    • USA
Nevermind i fixed the stun health
Re: Can someone tell me how to create the stun damage health?
#7  January 29, 2020, 06:43:10 pm
  • avatar
    • UK
May I ask how?