2016.03.1712:32

AI HELPER-3 AI HELPER记忆器的制作

Episode 3 AI HELPER记忆器的制作

记忆器的话,写法是可以通用的,因为都是记招,因为HELPER能记下来的也不是万能的,所以也要配合AI里面的条件使用

举个例子,先说基本部分

;----------------------------------------------------------------------
[Statedef 36000]
anim = 9999
ctrl = 0

[State 36000, AssertSpecial]
Type = AssertSpecial
Trigger1 = 1
flag = invisible

[State 36000, BindToRoot]
type = BindToRoot
trigger1 = 1
facing = 1
pos = 0,0

[State 36000, NotHitBy]
Type = NotHitBy
Trigger1 = 1
Value = SCA

[State 36000, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0

[State 36000, SelfState]
Type = SelfState
Trigger1 = !IsHelper
Value = 0

[State 36000, AssertSpecial]
type = AssertSpecial
Trigger1 = 1
flag = NoShadow
flag2 = invisible

以上是基本部分,anim = 9999是一个空动画,前面提到过,不再讲

比如我现在记录下对手出招状态和判定触发时间,我可以这么写

;----------------------------------------------------------------------
[State 36000, VarSet]
Type = VarSet
TriggerAll = EnemyNear(Root,var(58)),Ctrl = 0 ;对手不可控
TriggerAll = EnemyNear(Root,var(58)),MoveType = A ;对手攻击状态
TriggerAll = EnemyNear(Root,var(58)),HitDefAttr = SCA,NA,SA ;一般记下来普攻和必杀技攻击就可以,虽然说下面的状态有限制
TriggerAll = EnemyNear(Root,var(58)),StateNo = [200,499] ;200-499一般是地面拳脚,概率比较大
TriggerAll = Root,StateNo = 150 || Root,StateNo = 152 ;防御硬直中触发
TriggerAll = Root,Time = 1 ;硬直中第一帧记下来,防出错
Trigger1 = var(1) = 0 ;未记录情况
V = 1
Value = (EnemyNear(Root,var(58)),StateNo) ;记下对面状态号
IgnoreHitPause = 1

[State 36000, VarSet]
Type = VarSet
Trigger1 = var(1)!= 0 ;对面状态号有
Trigger1 = var(2) = 0 ;时间还未记下来
V = 2
Value = (EnemyNear(Root,var(58)),Time) ;记录下敌方经过时间
IgnoreHitPause = 1

一个招记下来了,接下来记第二个

[State 36000, VarSet]
Type = VarSet
TriggerAll = var(1) > 0 ;有第一招的记录
TriggerAll = EnemyNear(Root,var(58)),Ctrl = 0
TriggerAll = EnemyNear(Root,var(58)),MoveType = A
TriggerAll = EnemyNear(Root,var(58)),HitDefAttr = SCA,NA,SA
TriggerAll = EnemyNear(Root,var(58)),StateNo = [200,499]
TriggerAll = EnemyNear(Root,var(58)),StateNo != var(1) ;不能和第一个冲突
TriggerAll = Root,StateNo = 150 || Root,StateNo = 152
TriggerAll = Root,Time = 1
Trigger1 = var(3) = 0
V = 3
Value = (EnemyNear(Root,var(58)),StateNo)
IgnoreHitPause = 1

[State 36000, VarSet]
Type = VarSet
TriggerAll = var(2) ;第一个时间记下来了
Trigger1 = var(3)!= 0 ;有第二招的记录
Trigger1 = var(4) = 0
V = 4
Value = (EnemyNear(Root,var(58)),Time) ;记录下第二招时间
IgnoreHitPause = 1

然后一直记到10个招
............

[State 36000, VarSet]
Type = VarSet
TriggerAll = var(17) > 0
TriggerAll = EnemyNear(Root,var(58)),Ctrl = 0
TriggerAll = EnemyNear(Root,var(58)),MoveType = A
TriggerAll = EnemyNear(Root,var(58)),HitDefAttr = SCA,NA,SA
TriggerAll = EnemyNear(Root,var(58)),StateNo = [200,499]
TriggerAll = EnemyNear(Root,var(58)),StateNo != var(1)
TriggerAll = EnemyNear(Root,var(58)),StateNo != var(3)
TriggerAll = EnemyNear(Root,var(58)),StateNo != var(5)
TriggerAll = EnemyNear(Root,var(58)),StateNo != var(7)
TriggerAll = EnemyNear(Root,var(58)),StateNo != var(9)
TriggerAll = EnemyNear(Root,var(58)),StateNo != var(11)
TriggerAll = EnemyNear(Root,var(58)),StateNo != var(13)
TriggerAll = EnemyNear(Root,var(58)),StateNo != var(15)
TriggerAll = EnemyNear(Root,var(58)),StateNo != var(17)
TriggerAll = Root,StateNo = 150 || Root,StateNo = 152
TriggerAll = Root,Time = 1
Trigger1 = var(19) = 0
V = 19
Value = (EnemyNear(Root,var(58)),StateNo)
IgnoreHitPause = 1

[State 36000, VarSet]
Type = VarSet
TriggerAll = var(18)
Trigger1 = var(19)!= 0
Trigger1 = var(20) = 0
V = 20
Value = (EnemyNear(Root,var(58)),Time)
IgnoreHitPause = 1

这个就是记录下敌方出招和时间的方法

除此之外,还可以记录下别的东西,用敌方飞行道具为例子来举个例子

;----------------------------------------------------------------------
[State 36000, 1] ;第一个状态
Type = VarSet
TriggerAll = EnemyNear(Root,var(58)),NumProj = 1 ;一般是地波和中段波之类的,出大跳的话可以大跳躲过去抓硬直
TriggerAll = EnemyNear(Root,var(58)),Ctrl = 0
TriggerAll = EnemyNear(Root,var(58)),MoveType = A
Trigger1 = var(1) = 0
var(1) = EnemyNear(Root,var(58)),StateNo
IgnoreHitPause = 1

[State 36000, 2] ;第二个
Type = VarSet
TriggerAll = EnemyNear(Root,var(58)),NumProj = 1
TriggerAll = EnemyNear(Root,var(58)),Ctrl = 0
TriggerAll = EnemyNear(Root,var(58)),MoveType = A
TriggerAll = EnemyNear(Root,var(58)),StateNo != var(1)
Trigger1 = var(1) != 0
Trigger1 = var(2) = 0
var(2) = EnemyNear(Root,var(58)),StateNo
IgnoreHitPause = 1

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

[State 36000, 10] ;第十个
Type = VarSet
TriggerAll = EnemyNear(Root,var(58)),NumProj = 1
TriggerAll = EnemyNear(Root,var(58)),Ctrl = 0
TriggerAll = EnemyNear(Root,var(58)),MoveType = A
TriggerAll = EnemyNear(Root,var(58)),StateNo != var(1)
TriggerAll = EnemyNear(Root,var(58)),StateNo != var(2)
TriggerAll = EnemyNear(Root,var(58)),StateNo != var(3)
TriggerAll = EnemyNear(Root,var(58)),StateNo != var(4)
TriggerAll = EnemyNear(Root,var(58)),StateNo != var(5)
TriggerAll = EnemyNear(Root,var(58)),StateNo != var(6)
TriggerAll = EnemyNear(Root,var(58)),StateNo != var(7)
TriggerAll = EnemyNear(Root,var(58)),StateNo != var(8)
TriggerAll = EnemyNear(Root,var(58)),StateNo != var(9)
Trigger1 = var(1) != 0
Trigger1 = var(2) != 0
Trigger1 = var(3) != 0
Trigger1 = var(4) != 0
Trigger1 = var(5) != 0
Trigger1 = var(6) != 0
Trigger1 = var(7) != 0
Trigger1 = var(8) != 0
Trigger1 = var(9) != 0
Trigger1 = var(10) = 0
var(10) = EnemyNear(Root,var(58)),StateNo
IgnoreHitPause = 1

这样十个招都记下来了

接下来我们来用DISPLAYTOCLIPBOARD代码来观察下面的DEBUG信息

;---------------------------------------------------------------------------
[State 36000, DisplayToClipBoard]
Type = DisplayToClipBoard
Trigger1 = IsHelper(36000) ;确认是helper并且helper的ID是36000,载入的时候记得,stateno = 36000, ID = 36000
Text = "var(1)=%d,var(2)=%d,var(3)=%d,var(4)=%d,var(5)=%d"
Params = var(1),var(2),var(3),var(4),var(5)
IgnoreHitPause = 1

[State 36000, AppendToClipboard]
Type = AppendToClipboard
Trigger1 = IsHelper(36000) ;补充段,当然,不管是记录飞行道具状态号还是记录出招状态号和时间,想观察哪个就可以改成哪个
Text = "\nvar(6)=%d,var(7)=%d,var(8)=%d,var(9=%d,var(10)=%d"
Params = var(6),var(7),var(8),var(9),var(10)
IgnoreHitPause = 1

记忆器使用其实还是挺简单的吧,实战中最好用能用到的记忆,缺哪个就补哪个

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

mizore@kotori.moe, 谢谢大家!

发表留言

秘密留言

等待许可的留言

此留言需要管理员的许可

等待许可的留言

此留言需要管理员的许可

アクセス

オンライン