YesNoOk
avatar

How do i make them fall when they get stunned? (Read 1460 times)

Started by Fluttershy555, May 04, 2019, 01:01:30 am
Share this topic:
How do i make them fall when they get stunned?
#1  May 04, 2019, 01:01:30 am
  • avatar
  • *
    • USA
Ok so ive been wanting this for a while now. I have the stun system code i made myself but i tried everything and i just dont know how to get the hit that stuns them fall like Street Fighter 2. You know in KOF or Street Fighter where when your hit will stun them they fall over? I need to know how to do this for my game to be complete because when i hit them they get stun normally and dont fall down. I want them to fall down then when they get back up they are stunned like in Street Fighter 2. Anyone know how to do that? I cant find a tutorial on how to do so anywhere. Here is what i got in my stun code.

[Statedef 5300]
type = S
movetype = H
physics = N
ctrl = 0
velset = 0,0
anim = 5300

[State 0, VarAdd]
type = VarAdd
trigger1 = time = 20
v = 20
value = -200

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
v = 20
value = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 5300


[State 0, SelfState]
type = SelfState
trigger1 = time >= 200
value = 5100

[Statedef -2]

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


[State 0, VarAdd]
type = VarAdd
trigger1 = stateno != [120,169]
trigger1 = gethitvar(damage)
v = 20
value = gethitvar(damage)

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

[State 0, ChangeState]
type = ChangeState
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger1 = var(20) >= 100
value = 5300
ctrl = 0

I will really appreciate help on how to do it because ive tried to do this many times with hitvelocities and others but just cant seem to get any to work to where they fall down on the hit that stuns them.
Last Edit: May 12, 2019, 10:25:34 pm by Fluttershy555
Re: How do i make them fall when they get stunned?
#2  May 06, 2019, 04:45:43 pm
  • *****
  • Shame on you!
    • USA
You could probably do it with a hitdef set to "trip". If you were worried about the combo count, you can always set the hit count/add to -1.
If you're not trying to use a hitdef you can set P2's vel y and then change it to an Air state. Use debug, ctrl+d, to switch to P2 and sweep them to watch what state(s) it's sent to.
vVv Ryuko718 Updated 10/31/22 vVv
Re: How do i make them fall when they get stunned?
#3  May 07, 2019, 01:28:26 am
  • avatar
  • *
    • USA
It still didn't work the way i wanted it too. Is there a way to put it in a varset or something for when it goes into 5300 state they fall over? Ive seen people with so much varsets when they have their stun code.
Re: How do i make them fall when they get stunned?
#4  May 07, 2019, 07:06:34 am
  • avatar
  • ***
    • https://sites.google.com/site/mgmurrow/
if i'm reading your code right:  trigger1 = var(20) >= 100, this is your trigger for the dizzy state correct? you could use another variable trigger like
once var(20) >= 100 then make var(21)=1 Like:

[State 0, VarSet]
type = VarSet
trigger1 = var(20) >= 100
v = 21
value = 1

then in your standing state add this to the top

[State 0, ChangeState]
type = ChangeState
trigger1 = !Time
trigger1 = var(21) !=0
value = ?????  <------------------------this will be whatever your dizzy state number is
ctrl = 0

thats if you want to do it like that

hope this helps

MGMURROW
Re: How do i make them fall when they get stunned?
#5  May 07, 2019, 07:25:25 am
  • ****
based on who count the stun
if the guy how take the hit you can download one of my char as a reference.
Re: How do i make them fall when they get stunned?
#6  May 07, 2019, 01:01:08 pm
  • avatar
  • *
    • USA
based on who count the stun
if the guy how take the hit you can download one of my char as a reference.


That would be good but it would probably be easier if you told me how to do it. But i could see it.
Re: How do i make them fall when they get stunned?
#7  May 07, 2019, 01:02:47 pm
  • avatar
  • *
    • USA
if i'm reading your code right:  trigger1 = var(20) >= 100, this is your trigger for the dizzy state correct? you could use another variable trigger like
once var(20) >= 100 then make var(21)=1 Like:

[State 0, VarSet]
type = VarSet
trigger1 = var(20) >= 100
v = 21
value = 1

then in your standing state add this to the top

[State 0, ChangeState]
type = ChangeState
trigger1 = !Time
trigger1 = var(21) !=0
value = ?????  <------------------------this will be whatever your dizzy state number is
ctrl = 0

thats if you want to do it like that

hope this helps

MGMURROW


It didn't work. I tried putting in in my standing state they still get stunned normally then i put it in my state -2] they still get stunned normally. I didn't see how that would work anyway because dont i need a falling state number to happen before they go into 5300 state? Like ive been trying 5050 and they just fall like they are suppose to but they dont get stunned when they wake up.
Re: How do i make them fall when they get stunned?
#8  May 07, 2019, 03:59:15 pm
  • avatar
  • ***
    • https://sites.google.com/site/mgmurrow/
is 5300 your dizzy state, sorry i need more info on the state numbers?

if 5300 is your dizzy state then from 5300 you are going into 5100 which is a hit the ground(fall) state. (this is not what you want right?)

you want to: get hit-->go into a fall state-->then stand up and get dizzy right?

because your code is: get dizzy-->fall-->stand up, if im reading it right.

if you like send me the character and i can try to get it the way you like, its a little difficult not seeing everything

talk to you soon

MGMURROW
Re: How do i make them fall when they get stunned?
#9  May 07, 2019, 05:35:41 pm
  • avatar
  • *
    • USA
is 5300 your dizzy state, sorry i need more info on the state numbers?

if 5300 is your dizzy state then from 5300 you are going into 5100 which is a hit the ground(fall) state. (this is not what you want right?)

you want to: get hit-->go into a fall state-->then stand up and get dizzy right?

because your code is: get dizzy-->fall-->stand up, if im reading it right.

if you like send me the character and i can try to get it the way you like, its a little difficult not seeing everything

talk to you soon

MGMURROW


I would prefer you to teach me rather then doing it for me so i will know how to do it. So i will show you. The stun code is soooo short and easy to make i wrote this down myself and saved it in notepad so i can paste it anytime i need my characters to get stunned but here it is.

This is the state that they go in when they are stunned. Its statedef 5300. This is all i have in it.

[Statedef 5300]
type = A
movetype = H
physics = N
ctrl = 0
velset = 0,0
anim = 5300



[State 0, VarAdd]
type = VarAdd
trigger1 = time = 20
v = 20
value = -200

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
v = 20
value = 0





[State 0, SelfState]
type = SelfState
trigger1 = time >= 200
value = 5100

I have stuff in statedef -2 that makes them go into the state 5300 after they lose 200 damage. For now i may increase it if my characters are too overpowered this is just for now. And in statedef -2 I have this.

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


[State 0, VarAdd]
type = VarAdd
trigger1 = stateno != [120,169]
trigger1 = gethitvar(damage)
v = 20
value = gethitvar(damage)

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

[State 0, VarSet]
type = VarSet
trigger1 = var(21) >= 200
v = 21
value = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = !time
trigger1 var(20) != 0
value = 5300
ctrl = 0


[State 0, ChangeState]
type = ChangeState
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger1 = var(20) >= 200
value = 5300
ctrl = 0

As you can see on this

[State 0, ChangeState]
type = ChangeState
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger1 = var(20) >= 200
value = 5300
ctrl = 0

After 200 damage is taken away they get stunned but i dont know what to code to have them fall first.
Re: How do i make them fall when they get stunned?
#10  May 07, 2019, 10:29:38 pm
  • avatar
  • ***
    • https://sites.google.com/site/mgmurrow/

[/quote]
I have stuff in statedef -2 that makes them go into the state 5300 after they lose 200 damage. For now i may increase it if my characters are too overpowered this is just for now. And in statedef -2 I have this.

[State 0, VarAdd]
type = VarAdd
trigger1 = stateno != [120,169]
trigger1 = gethitvar(damage)
v = 20
value = gethitvar(damage)

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

[State 0, VarSet]
type = VarSet
trigger1 = var(21) >= 200
v = 21
value = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = !time
trigger1 var(20) != 0  <---------------im assuming this should say var(21)!=0
value = 5300             <---------------this is the wrong state, this is your dizzy state, it should be your falling state
ctrl = 0


[State 0, ChangeState]  <--------------dont need 2 changestates that trigger to the same state
type = ChangeState
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger1 = var(20) >= 200   <---------this is the same as above var(21)!=0
value = 5300                       <---------------this is the wrong state, this is your dizzy state, it should be your falling state
ctrl = 0

As you can see on this

[State 0, ChangeState]   <--------------dont need these changestates that trigger to the same state
type = ChangeState
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger1 = var(20) >= 200   <---------this is the same as above var(21)!=0
value = 5300                       <---------------this is the wrong state, this is your dizzy state, it should be your falling state
ctrl = 0

After 200 damage is taken away they get stunned but i dont know what to code to have them fall first.
[/quote]


your var(20)>=200 or var(21)!=0 should trigger to your falling state(not your dizzy state),
then when you get up from your falling state it should go into state 5300(your dizzy state)

you have your triggers going into the wrong state

MGMURROW

Re: How do i make them fall when they get stunned?
#11  May 08, 2019, 02:17:21 pm
  • avatar
  • *
    • USA
Like this?

[State 0, VarSet]
type = VarSet
trigger1 = var(21) >= 200
v = 21
value = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = !time
trigger1 var(21) != 0
value = 5050
ctrl = 0


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

Because now they do fall but when they get back up they fall again.
Re: How do i make them fall when they get stunned?
#12  May 08, 2019, 05:31:33 pm
  • avatar
  • ***
    • https://sites.google.com/site/mgmurrow/
Like this?

[State 0, VarSet]
type = VarSet
trigger1 = var(21) >= 200
v = 21
value = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = !time
trigger1 var(21) != 0
value = 5050
ctrl = 0


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

Because now they do fall but when they get back up they fall again.

thats because when they get up you have to put them in your dizzy state, then inside your dizzy state reset the variable to 0
like:

; HIT_GETUP
[Statedef 5120]
type    = L
movetype= I
physics = N

[State 5120, 1a] ;Get up anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim != [5111,5119]
trigger2 = !SelfAnimExist(5120 + (anim % 10))
value = 5120

[State 5120, 1b] ;Get up anim (for hit up/diag-up)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim = [5111,5119]
trigger1 = SelfAnimExist(5120 + (anim % 10))
value = 5120 + (anim % 10)

[State 5120, 2]
type = VelSet
trigger1 = Time = 0
x = 0

[State 5120, 3]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 5120, 4]
type = HitFallSet
trigger1 = AnimTime = 0
value = 1

[State 5120, 5] ;Can't be thrown right after getting up
type = NotHitBy
trigger1 = AnimTime = 0
value = , NT,ST,HT
time = 12

[State 5120, 6] ;Can't be hit right after getting up (short time)
type = NotHitBy
trigger1 = AnimTime = 0
value2 = SCA
time = 3

[State 5120, 7] <---------------------------------------here is your dizzy state, remember inside your dizzy state to reset your dizzy variables to 0
type = ChangeState                                                    or reset them in your -2 state
trigger1 = AnimTime = 0
trigger1 = Var(21)!=0
value = 5300
ctrl = 0

[State 5120, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

hope this helps

MGMURROW
Re: How do i make them fall when they get stunned?
#13  May 08, 2019, 08:58:51 pm
  • avatar
  • *
    • USA
Ok i am understanding it a little better now. Its while they are getting up they go into there stun state. I wrote all this down but i am confused on one thing but here is my code.

[Statedef 5120]
type = L
movetype = I
physics = N

[State 5120, ChangeAnim]
type = ChangeAnim
triggerall = time = 0
trigger1 = anim != [5111,5119]
trigger2 = !SelfAnimExist(5120 + (anim % 10))
value = 5120

[State 5120, ChangeAnim]
type = ChangeAnim
triggerall = time = 0
trigger1 = anim = [5111,5119]
trigger1 = SelfAnimExist(5120 + (anim % 10))
value = 5120 + (anim % 10)

[State 5120, VelSet]
type = VelSet
trigger1 = time = 0
x = 0

[State 5120, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 5120, HitFallSet]
type = HitFallSet
trigger1 = animtime = 0
value = 1

[State 5120, NotHitBy]
type = NotHitBy
trigger1 = AnimTime = 0
value = , NT,ST,HT
time = 12

[State 5120, NotHitBy]
type = NotHitBy
trigger1 = animtime = 0
value = SCA
time = 3


[State 0, ChangeState]
type = ChangeState
trigger1 = animtime = 0
trigger1 = var(21) != 0
value = 5300
ctrl = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1

They still dont get stunned when they fall but i saw you said to put it in my dizzy state so which one do i put in the dizzy state? Are you saying to put this one in the dizzy state?

[State 0, ChangeState]
type = ChangeState
trigger1 = animtime = 0
trigger1 = var(21) != 0
value = 5300
ctrl = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1

And if not this one then which one because i put everything in the 5120 state as you can see. And i remember you saying to put it in the dizzy state so i got confused which one do i put in statedef 5300?
Re: How do i make them fall when they get stunned?
#14  May 08, 2019, 09:34:41 pm
  • avatar
  • ***
    • https://sites.google.com/site/mgmurrow/
im saying to reset your variables inside your dizzy state like:

[State 0, VarSet] <-------------this will reset your dizzy variable
type = VarSet
trigger1 = 1
v = 21
value = 0

once they stand up in their dizzy state the variable needs to be reset, put that code in the dizzy state 5300

MGMURROW
Re: How do i make them fall when they get stunned?
#15  May 08, 2019, 10:03:01 pm
  • avatar
  • *
    • USA
I put that in the state but they still dont get stunned so i was wondering if i should remove something from statedef -2. I was wondering if i need this.

[State 0, VarSet]
type = VarSet
trigger1 = var(21) >= 200
v = 21
value = 1

I also will show you whats in statedef 5300 just to see if anything needs to be changes so here is what i now have in 5300.

[Statedef 5300]
type = S
movetype = H
physics = N
ctrl = 0
velset = 0,0
anim = 5300


[State 0, VarAdd]
type = VarAdd
trigger1 = time = 20
v = 20
value = -200

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
v = 20
value = 0

[State 0, SelfState]
type = SelfState
trigger1 = time >= 200
value = 5100
This is all i have in 5300 now but it still dont seem to work. Unless i need to change something in statedef -2? Here is what i have in statedef -2.

[Statedef -2]

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


[State 0, VarAdd]
type = VarAdd
trigger1 = stateno != [120,169]
trigger1 = gethitvar(damage)
v = 20
value = gethitvar(damage)

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

[State 0, VarSet]
type = VarSet
trigger1 = var(21) >= 200
v = 21
value = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = !time
trigger1 var(21) != 0
value = 5050
ctrl = 0



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

I just dont understand why its not working. So i was wondering if maybe i need to add or remove something from Statedef -2?
Re: How do i make them fall when they get stunned?
#16  May 12, 2019, 04:00:08 am
  • avatar
  • *
    • USA
IT WORKED! I had to add something else. I added this

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

I put that in statedef -2 and it worked. I also put this triggerall = var(21) != 0 on this

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

Because i needed that so it knows not to let any knock down moves go into 5300 if var 21 isn't active. But i still aint finished yet. I know i finally got this but the only problem now is when they are stunned and i punch them they fall and i cant combo. You know as if they were in the air. Anyone know how to fix that? Then it will be complete. Also thanks for the help. <3
Re: How do i make them fall when they get stunned?
#17  May 12, 2019, 09:51:38 pm
  • avatar
  • *
    • USA
Alright i fixed everything. I just now need to know how to stop the infinite stunning which i am sure i gotta make a varable to turn on where they wont get stunned when getting hit or something like that.
Re: How do i make them fall when they get stunned?
#18  May 12, 2019, 10:25:23 pm
  • avatar
  • *
    • USA
I FIXED IT! I RESET THE VARABLE AND EVERYTHING. The rest i had to teach myself. Took awhile and made me want to have a meltdown memorizing and keeping varables inline togeather looking at all that coding i had to write. XD But it all worked so thanks to all who helped me.