mugen吧 关注:69,161贴子:1,449,513
  • 10回复贴,共1

提问一个代码的问题

只看楼主收藏回复

所有动作在播放完毕后自动回复到statedef 0,我有个人物有多个站立动作,假设为1,2
我希望在动作播放完毕后随机进入0,1,2里,这个代码要怎么写,麻烦大神帮我写下完整的代码,谢谢


回复
1楼2018-08-31 10:38
    [State 200, 3]
    type = ChangeState
    trigger1 = AnimTime = 0
    value = Random%3;随机进入0,1,2中的一个状态
    ctrl = 1


    回复(4)
    2楼2018-08-31 12:02
      谢谢了


      回复
      4楼2018-09-03 11:46
        [Statedef 0]
        Type = S
        Physics = S

        [State 0, 1]
        Type = Velset
        Trigger1 = Time = 0
        Y = 0

        [State 0, 2]
        Type = Velset
        Trigger1 = Abs(Vel X) < 2
        Trigger2 = Time = 4
        X = 0

        [State 0, 1]
        Type = Changeanim
        Trigger1 = Anim != 0 && Anim != 5
        Trigger2 = Anim = 5 && Animtime = 0
        Value = Random%3

        [State 0, 2]
        Type = Changeanim
        Trigger1 = Time = 0
        Value = Random%3

        [State 0]
        Type = Changestate
        Trigger1 = !Alive
        Value = 5050


        回复(1)
        5楼2018-09-03 13:05
          试了,无效


          回复
          6楼2018-09-03 13:05
            初次进入0状态号才会随机进入0,1,2其中一个动画,若你想要本状态动画播放完毕时随机切换0,1,2动画那么条件time = 0改成AnimTime = 0
            [State 0, 2]
            Type = Changeanim
            Trigger1 = Time = 0
            Value = Random%3
            改成
            [State 0, 2]
            Type = Changeanim
            Trigger1 = AnimTime = 0
            Value = Random%3


            这里
            [State 0, 1]
            Type = Changeanim
            Trigger1 = Anim != 0 && Anim != 5
            Trigger2 = Anim = 5 && Animtime = 0
            Value = Random%3
            要改成
            [State 0, 1]
            Type = Changeanim
            Trigger1 = (Anim != [0,2]) && Anim != 5
            Trigger2 = Anim = 5 && Animtime = 0
            Value = Random%3


            回复
            8楼2018-09-03 13:41