2016.07.3021:53

AI HELPER-5 当身记忆归类(加强版)

Episode 5 当身记忆归类(加强版)

对于大多数AI作者来言,最困难最头疼的地方就是当身这块了,也就是让人头大的movereversed

为什么呢,它可以制造格挡,也可以制造p2state技能,但是二者共同特点是都有movereversed存在

所以我们记忆的时候要给定一个归类,判断是p2技还是单纯的格挡技(不带p1和p2)

话不多说我们来举例子,准备一个helper,并且准备30个未使用var

;----------------------------------------------------------------------
;自分被ステート奪取記憶 ;10个var来记忆下自己被p2的情况,给定helper的ID比如说是33000+ID
;----------------------------------------------------------------------
[State 33000, VarSet]
Type = VarSet
TriggerAll = EnemyNear(Root,var(58)),Ctrl = 0
TriggerAll = EnemyNear(Root,var(58)),MoveType = A
TriggerAll = EnemyNear(Root,var(58)),StateNo >= 200
TriggerAll = EnemyNear(Root,var(58)),StateType != A
TriggerAll =(Root,StateNo != [120,159]) && (Root,StateNo != [5000,5500]) ;普通受击在5000-5500之间,一般不会超过这里,防御为120-155
TriggerAll = Root,Movetype = H && Root,Time = 1 ;被打的第一时间记下来,如果对面给你的p2不是movetype = H那只好GG
Trigger1 = Helper(33000+Root,ID),var(0) = 0
V = 0
Value = EnemyNear(Root,var(58)),PrevStateNo ;因为你是在被p2时候记录下来的。所以他前一个动作就是给你拉p2的动作
IgnoreHitPause = 1

;下面写法之前提过就不再多讲

[State 33000, VarSet]
Type = VarSet
TriggerAll = EnemyNear(Root,var(58)),Ctrl = 0
TriggerAll = EnemyNear(Root,var(58)),MoveType = A
TriggerAll = EnemyNear(Root,var(58)),StateNo >= 200
TriggerAll = EnemyNear(Root,var(58)),StateType != A
TriggerAll = EnemyNear(Root,var(58)),PrevStateNo != Helper(33000+Root,ID),var(0)
TriggerAll =(Root,StateNo != [120,159]) && (Root,StateNo != [5000,5500])
TriggerAll = Root,Movetype = H && Root,Time = 1
Trigger1 = Helper(33000+Root,ID),var(0)!= 0
Trigger1 = Helper(33000+Root,ID),var(1) = 0
V = 1
Value = EnemyNear(Root,var(58)),PrevStateNo
IgnoreHitPause = 1

......................

[State 33000, VarSet]
Type = VarSet
TriggerAll = EnemyNear(Root,var(58)),Ctrl = 0
TriggerAll = EnemyNear(Root,var(58)),MoveType = A
TriggerAll = EnemyNear(Root,var(58)),StateNo >= 200
TriggerAll = EnemyNear(Root,var(58)),StateType != A
TriggerAll = EnemyNear(Root,var(58)),PrevStateNo != Helper(33000+Root,ID),var(0)
TriggerAll = EnemyNear(Root,var(58)),PrevStateNo != Helper(33000+Root,ID),var(1)
TriggerAll = EnemyNear(Root,var(58)),PrevStateNo != Helper(33000+Root,ID),var(2)
TriggerAll = EnemyNear(Root,var(58)),PrevStateNo != Helper(33000+Root,ID),var(3)
TriggerAll = EnemyNear(Root,var(58)),PrevStateNo != Helper(33000+Root,ID),var(4)
TriggerAll = EnemyNear(Root,var(58)),PrevStateNo != Helper(33000+Root,ID),var(5)
TriggerAll = EnemyNear(Root,var(58)),PrevStateNo != Helper(33000+Root,ID),var(6)
TriggerAll = EnemyNear(Root,var(58)),PrevStateNo != Helper(33000+Root,ID),var(7)
TriggerAll = EnemyNear(Root,var(58)),PrevStateNo != Helper(33000+Root,ID),var(8)
TriggerAll =(Root,StateNo != [120,159]) && (Root,StateNo != [5000,5500])
TriggerAll = Root,Movetype = H && Root,Time = 1
Trigger1 = Helper(33000+Root,ID),var(0)!= 0
Trigger1 = Helper(33000+Root,ID),var(1)!= 0
Trigger1 = Helper(33000+Root,ID),var(2)!= 0
Trigger1 = Helper(33000+Root,ID),var(3)!= 0
Trigger1 = Helper(33000+Root,ID),var(4)!= 0
Trigger1 = Helper(33000+Root,ID),var(5)!= 0
Trigger1 = Helper(33000+Root,ID),var(6)!= 0
Trigger1 = Helper(33000+Root,ID),var(7)!= 0
Trigger1 = Helper(33000+Root,ID),var(8)!= 0
Trigger1 = Helper(33000+Root,ID),var(9) = 0
V = 9
Value = EnemyNear(Root,var(58)),PrevStateNo
IgnoreHitPause = 1 ;这是10个var,记录下来你被p2的情况

下面继续,这10个var在-3里面显示一下标记

;-----------------------------------------------------------------------
; 自分被ステート奪取記憶
;-----------------------------------------------------------------------
[State -3, VarSet]
Type = VarSet
Trigger1 = fvar(5) != 0
FV = 5
Value = 0
IgnoreHitPause = 1

[State -3, 自分被ステート奪取]
Type = Null
TriggerAll = var(59) = 1
TriggerAll = NumHelper(33000+ID)
TriggerAll = EnemyNear(var(58)),Ctrl = 0
TriggerAll = EnemyNear(var(58)),MoveType = A
TriggerAll = EnemyNear(var(58)),StateNo >= 200
TriggerAll = EnemyNear(var(58)),StateType != A ;一般这时候只要记录地面的p2就好了
Trigger1 = EnemyNear(var(58)),StateNo = Helper(33000+ID),var(0)
Trigger1 = fvar(5) := fvar(5) + 1 || 1
Trigger2 = EnemyNear(var(58)),StateNo = Helper(33000+ID),var(1)
Trigger2 = fvar(5) := fvar(5) + 1 || 1
Trigger3 = EnemyNear(var(58)),StateNo = Helper(33000+ID),var(2)
Trigger3 = fvar(5) := fvar(5) + 1 || 1
Trigger4 = EnemyNear(var(58)),StateNo = Helper(33000+ID),var(3)
Trigger4 = fvar(5) := fvar(5) + 1 || 1
Trigger5 = EnemyNear(var(58)),StateNo = Helper(33000+ID),var(4)
Trigger5 = fvar(5) := fvar(5) + 1 || 1
Trigger6 = EnemyNear(var(58)),StateNo = Helper(33000+ID),var(5)
Trigger6 = fvar(5) := fvar(5) + 1 || 1
Trigger7 = EnemyNear(var(58)),StateNo = Helper(33000+ID),var(6)
Trigger7 = fvar(5) := fvar(5) + 1 || 1
Trigger8 = EnemyNear(var(58)),StateNo = Helper(33000+ID),var(7)
Trigger8 = fvar(5) := fvar(5) + 1 || 1
Trigger9 = EnemyNear(var(58)),StateNo = Helper(33000+ID),var(8)
Trigger9 = fvar(5) := fvar(5) + 1 || 1
Trigger10 = EnemyNear(var(58)),StateNo = Helper(33000+ID),var(9)
Trigger10 = fvar(5) := fvar(5) + 1 || 1
IgnoreHitPause = 1 ;当检测到p2时候,fvar(5)变为1

接下来就是带p2的当身记忆

;----------------------------------------------------------------------
;敵に当身ステート記憶 Part 1
;----------------------------------------------------------------------
[State 33000, VarSet]
Type = VarSet
Trigger1 = Root,fvar(5) = 1 ;首先检测到对面是带p2的技能
Trigger1 = Root,MoveReversed ;本体触摸当身,有一个前提,必须自己存在hitpausetime,不然没法记下来
Trigger1 = EnemyNear(Root,var(58)),Ctrl = 0
Trigger1 = EnemyNear(Root,var(58)),MoveType = A
Trigger1 = Helper(33000+Root,ID),var(10) = -1
var(10) = EnemyNear(Root,var(58)),PrevStateNo ;前一个动作确定为当身技能
IgnoreHitPause = 1

..............................

[State 33000, VarSet]
Type = VarSet
Trigger1 = Root,fvar(5) = 1
Trigger1 = Root,MoveReversed
Trigger1 = EnemyNear(Root,var(58)),Ctrl = 0
Trigger1 = EnemyNear(Root,var(58)),MoveType = A
Trigger1 = EnemyNear(Root,var(58)),PrevStateNo != Helper(33000+Root,ID),var(10)
Trigger1 = EnemyNear(Root,var(58)),PrevStateNo != Helper(33000+Root,ID),var(11)
Trigger1 = EnemyNear(Root,var(58)),PrevStateNo != Helper(33000+Root,ID),var(12)
Trigger1 = EnemyNear(Root,var(58)),PrevStateNo != Helper(33000+Root,ID),var(13)
Trigger1 = EnemyNear(Root,var(58)),PrevStateNo != Helper(33000+Root,ID),var(14)
Trigger1 = EnemyNear(Root,var(58)),PrevStateNo != Helper(33000+Root,ID),var(15)
Trigger1 = EnemyNear(Root,var(58)),PrevStateNo != Helper(33000+Root,ID),var(16)
Trigger1 = EnemyNear(Root,var(58)),PrevStateNo != Helper(33000+Root,ID),var(17)
Trigger1 = EnemyNear(Root,var(58)),PrevStateNo != Helper(33000+Root,ID),var(18)
Trigger1 = Helper(33000+Root,ID),var(10) != -1
Trigger1 = Helper(33000+Root,ID),var(11) != -1
Trigger1 = Helper(33000+Root,ID),var(12) != -1
Trigger1 = Helper(33000+Root,ID),var(13) != -1
Trigger1 = Helper(33000+Root,ID),var(14) != -1
Trigger1 = Helper(33000+Root,ID),var(15) != -1
Trigger1 = Helper(33000+Root,ID),var(16) != -1
Trigger1 = Helper(33000+Root,ID),var(17) != -1
Trigger1 = Helper(33000+Root,ID),var(18) != -1
Trigger1 = Helper(33000+Root,ID),var(19) = -1
var(19) = EnemyNear(Root,var(58)),PrevStateNo
IgnoreHitPause = 1

这样一来,20个var就能把当身技能记录下来了,但是有个缺点,你第一次吃当身不知道对面是p2,所以得吃两次才能记下来(囧)

然后再说说格挡,比刚才简单很多,但同时也有些不足的地方

;----------------------------------------------------------------------
;敵に当身ステート記憶 Part 2
;----------------------------------------------------------------------
[State 33000, VarSet]
Type = VarSet
Trigger1 = Root,MoveReversed
Trigger1 = EnemyNear(Root,var(58)),Ctrl = 0
Trigger1 = EnemyNear(Root,var(58)),MoveType = A
Trigger1 = Helper(33000+Root,ID),var(20) = -1
var(20) = EnemyNear(Root,var(58)),StateNo ;原理同上,但是这里记下来的是当前stateno,有两种情况,1个是p2stateno,另一个就是格挡技能,不拉P1也不拉P2
IgnoreHitPause = 1

......................................

[State 33000, VarSet]
Type = VarSet
Trigger1 = Root,MoveReversed
Trigger1 = EnemyNear(Root,var(58)),Ctrl = 0
Trigger1 = EnemyNear(Root,var(58)),MoveType = A
Trigger1 = EnemyNear(Root,var(58)),StateNo != Helper(33000+Root,ID),var(20)
Trigger1 = EnemyNear(Root,var(58)),StateNo != Helper(33000+Root,ID),var(21)
Trigger1 = EnemyNear(Root,var(58)),StateNo != Helper(33000+Root,ID),var(22)
Trigger1 = EnemyNear(Root,var(58)),StateNo != Helper(33000+Root,ID),var(23)
Trigger1 = EnemyNear(Root,var(58)),StateNo != Helper(33000+Root,ID),var(24)
Trigger1 = EnemyNear(Root,var(58)),StateNo != Helper(33000+Root,ID),var(25)
Trigger1 = EnemyNear(Root,var(58)),StateNo != Helper(33000+Root,ID),var(26)
Trigger1 = EnemyNear(Root,var(58)),StateNo != Helper(33000+Root,ID),var(27)
Trigger1 = EnemyNear(Root,var(58)),StateNo != Helper(33000+Root,ID),var(28)
Trigger1 = Helper(33000+Root,ID),var(20) != -1
Trigger1 = Helper(33000+Root,ID),var(21) != -1
Trigger1 = Helper(33000+Root,ID),var(22) != -1
Trigger1 = Helper(33000+Root,ID),var(23) != -1
Trigger1 = Helper(33000+Root,ID),var(24) != -1
Trigger1 = Helper(33000+Root,ID),var(25) != -1
Trigger1 = Helper(33000+Root,ID),var(26) != -1
Trigger1 = Helper(33000+Root,ID),var(27) != -1
Trigger1 = Helper(33000+Root,ID),var(28) != -1
Trigger1 = Helper(33000+Root,ID),var(29) = -1
var(29) = EnemyNear(Root,var(58)),StateNo
IgnoreHitPause = 1

这里的缺陷,就是会把p2技和格挡技记录在一块,但是要明白一点,你被拉P2的时候是肯定不能动的,所以剩下来的就是格挡技了

然后把两个当身技能归类在var里面

;-----------------------------------------------------------------------
; 相手の特殊ステート(当身)記憶
;-----------------------------------------------------------------------
[State -3, VarSet]
Type = VarSet
Trigger1 = fvar(2) != 0
FV = 2
Value = 0
IgnoreHitPause = 1

[State -3, 相手の特殊ステート]
Type = Null
TriggerAll = var(59) = 1
TriggerAll = NumHelper(33000+ID)
TriggerAll = EnemyNear(var(58)),MoveType = A
Trigger1 = EnemyNear(var(58)),StateNo = Helper(33000+ID),var(10)
Trigger1 = fvar(2) := fvar(2) + 1 || 1
Trigger2 = EnemyNear(var(58)),StateNo = Helper(33000+ID),var(11)
Trigger2 = fvar(2) := fvar(2) + 1 || 1
Trigger3 = EnemyNear(var(58)),StateNo = Helper(33000+ID),var(12)
Trigger3 = fvar(2) := fvar(2) + 1 || 1
Trigger4 = EnemyNear(var(58)),StateNo = Helper(33000+ID),var(13)
Trigger4 = fvar(2) := fvar(2) + 1 || 1
Trigger5 = EnemyNear(var(58)),StateNo = Helper(33000+ID),var(14)
Trigger5 = fvar(2) := fvar(2) + 1 || 1
Trigger6 = EnemyNear(var(58)),StateNo = Helper(33000+ID),var(15)
Trigger6 = fvar(2) := fvar(2) + 1 || 1
Trigger7 = EnemyNear(var(58)),StateNo = Helper(33000+ID),var(16)
Trigger7 = fvar(2) := fvar(2) + 1 || 1
Trigger8 = EnemyNear(var(58)),StateNo = Helper(33000+ID),var(17)
Trigger8 = fvar(2) := fvar(2) + 1 || 1
Trigger9 = EnemyNear(var(58)),StateNo = Helper(33000+ID),var(18)
Trigger9 = fvar(2) := fvar(2) + 1 || 1
Trigger10 = EnemyNear(var(58)),StateNo = Helper(33000+ID),var(19)
Trigger10 = fvar(2) := fvar(2) + 1 || 1
Trigger11 = EnemyNear(var(58)),StateNo = Helper(33000+ID),var(20)
Trigger11 = fvar(2) := fvar(2) + 2 || 1
Trigger12 = EnemyNear(var(58)),StateNo = Helper(33000+ID),var(21)
Trigger12 = fvar(2) := fvar(2) + 2 || 1
Trigger13 = EnemyNear(var(58)),StateNo = Helper(33000+ID),var(22)
Trigger13 = fvar(2) := fvar(2) + 2 || 1
Trigger14 = EnemyNear(var(58)),StateNo = Helper(33000+ID),var(23)
Trigger14 = fvar(2) := fvar(2) + 2 || 1
Trigger15 = EnemyNear(var(58)),StateNo = Helper(33000+ID),var(24)
Trigger15 = fvar(2) := fvar(2) + 2 || 1
Trigger16 = EnemyNear(var(58)),StateNo = Helper(33000+ID),var(25)
Trigger16 = fvar(2) := fvar(2) + 2 || 1
Trigger17 = EnemyNear(var(58)),StateNo = Helper(33000+ID),var(26)
Trigger17 = fvar(2) := fvar(2) + 2 || 1
Trigger18 = EnemyNear(var(58)),StateNo = Helper(33000+ID),var(27)
Trigger18 = fvar(2) := fvar(2) + 2 || 1
Trigger19 = EnemyNear(var(58)),StateNo = Helper(33000+ID),var(28)
Trigger19 = fvar(2) := fvar(2) + 2 || 1
Trigger20 = EnemyNear(var(58)),StateNo = Helper(33000+ID),var(29)
Trigger20 = fvar(2) := fvar(2) + 2 || 1
IgnoreHitPause = 1

这里就很明确了,fvar(2) = 1时代表带P2的当身技,fvar(2) = 2时代表格挡技和已被拉的p2state,当然被拉的p2state以外的就是格挡技了

然后接下来的AI怎么写,如果对面出当身带P2技能,你已经记下来知道了,那么不在版边你可以选择后跳和44,然后如果你被卡版边了,你可以选择闪身或者大跳(千万别手贱点嘲讽不然会死得很惨- -+),但是格挡技能因为不确定是升龙还是单纯的格挡,所以闪身和防御是最好的选择,然后剩下来的你只要抓最后几帧硬直就可以了(EnemyNear(var(58)),AnimTime = -X,X为某招触发判定帧数)

好了,今天的课就先到这,如果您有什么问题的话可以私信我(只要是我会的,不管什么问题),我会第一时间给您答复,或者把问题发到我的邮箱

mizore@kotori.moe, 谢谢大家!

アクセス

オンライン