YesNoOk
avatar

Hit until turn (Read 490 times)

Started by Arpad72, August 15, 2016, 08:36:33 pm
Share this topic:
Hit until turn
#1  August 15, 2016, 08:36:33 pm
  • avatar
    • Hungary
Hi again!

Please help me! Where can I find the turn state??? Is there everywhere?

I would like to make a hitdef until character turning.
Is there a way? I have put this but not working?

[State -2, Ut]
type = HitDef
trigger1 = Anim = 5
trigger1 = time = 25
attr = S,NA        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAF        ;HLAFD+-
guardflag = MA         ;HLA
;affectteam = E          ;B,E,F
animtype = light          ;light,medium,hard,back,up,diagup
air.animtype = light
;fall.animtype = Back
;priority = 4,Hit
damage = 20,0
pausetime = 0 ,0
sparkxy = 0,0
hitsound = S1,0
guardsound = S2,0
ground.type = High      ;Low,Trip,None
;air.type = High
ground.slidetime = 0
ground.hittime = 0
air.hittime = 20
ground.velocity = 0,0
air.velocity = 0,0
p1getp2facing = 0
fall = 0
fall.yvelocity = -4.5
fall.recover = 1
fall.recovertime = 4
fall.damage = 0
down.bounce = 0
id = 0
chainID = -1
nochainID = -1
hitonce = 1
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1
palfx.time = 0
envshake.time = 0
fall.envshake.time = 0
Re: Hit until turn
#2  August 15, 2016, 09:03:32 pm
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
The turn anim is executed from State 0.

Re: Hit until turn
#3  August 15, 2016, 09:23:24 pm
  • avatar
    • Hungary
I have put the above code in state 0 but not working.
Re: Hit until turn
#4  August 15, 2016, 10:00:48 pm
  • ******
Of course it won't.

Let's analyze the Statedef 0:
first,
Code:
[Statedef 0]
type = S
physics = S
sprpriority = 0

this code omits the movetype; when it's omitted it means the state is idle and thus anything won't hit, whether or not you add an hitdef (and red collision boxes on the turning animation).
You would need to add movetype = A (it means the type of the move, in this case the stand state, is an attack).

Second, like I said, if you don't add the red collision boxes the hitdef won't do anything.

Third, the attack triggers at the 25th tick of time; the turning animation usually is very quick, so you would have a hard time having that condition met.


About the last two points, I don't know how your character is coded/animated. I'm just saying in general, usually it's like that.
Last Edit: August 15, 2016, 10:04:28 pm by Sin-
Re: Hit until turn
#5  August 16, 2016, 02:44:37 pm
  • ******
Someone wanted to do something like this eariler.

Remove the HitDef. Add a Helper to StateDef 0 instead, and make it trigger on the Turn animation.
Then add the HitDef onto the Helper state.

You won't have to mess with the stand/turn state while adding an attack to the turn.
Re: Hit until turn
#6  August 16, 2016, 07:50:40 pm
  • avatar
    • Hungary
Thanks for answers. The helper is a good choice. I searched the changeanim type =5 and same but
there is not.
I think it has hard coded is mane exe file. And there is a state type named turn that means me the hard
coded too.
When I will get enough time I will use the helper I think.
Re: Hit until turn
#7  August 16, 2016, 11:56:24 pm
  • *****
  • Shame on you!
    • USA
type =5
Try
type =S
as in Snake. not 1234 5.
I would like to make a hitdef until character turning.
Is there a way? I have put this but not working?

UNTIL? As in it's active UNTIL it's turning.
Or UNLESS? As in, the hit wont happen unless it's turning.

If you're trying until, you're doing it all wrong.
If you're trying unless, just change the set the hitdef to trigger
trigger1 = Anim = 5
trigger1 = 1

and add

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 =   Anim = 5 &&  AnimElem = 5  ;you'll change this to what ever time = 25 is.
movetype = A        ;I,A,H 


ALL of the hitdef and statetypeset needs to go into state 0.
vVv Wheat Stage Released vVv
Re: Hit until turn
#8  August 17, 2016, 05:07:21 pm
  • ******
Yeah, I didn't understand the question either. I thought he wanted to attack in the turning animation.