翔鹰帝国网|帝国时代论坛|帝国时代系列|神话时代
 找回密码
 注册翔鹰会员(昵称)
搜索
查看: 1063|回复: 4

[求助] 2个rule,为什么第二和第三个rule不执行?(结贴)

 关闭 [复制链接]

38

主题

0

精华

5066

积分

国王

耕战
933
鹰币
4
天龙币
0
回帖
249

三级嘉禾勋章

附庸关系0
发表于 2013-9-27 22:45:27 | 显示全部楼层 |阅读模式
本帖最后由 tankant 于 2013-9-28 10:58 编辑

(defconst gl-come-bugongshou 0)

(defrule
(true)
=>
(set-goal gl-come-bugongshou 1)
(chat-to-all "gl-come-bugongshou 1")
(disable-self)
)

(defrule
(goal gl-come-bugongshou 1)
=>
(chat-to-all "gl-come-bugongshou 1")
)

(defrule
(goal gl-come-bugongshou 0)
=>
(chat-to-all "gl-come-bugongshou 0")
)

求懂AI的高手指点迷津
期待特色AOC!!!!!
回复

使用道具 举报

38

主题

0

精华

5066

积分

国王

耕战
933
鹰币
4
天龙币
0
回帖
249

三级嘉禾勋章

附庸关系0
 楼主| 发表于 2013-9-27 23:18:34 | 显示全部楼层

追问2

本帖最后由 tankant 于 2013-9-28 00:10 编辑

很好,YTY一眼看出来goal可能不能是0
追问:现在前三个rule已经正常运作了。第4、5个rule为什么不好用?可能原因是什么?

(defconst gl-come-bugongshou 2)

;1
(defrule
(true)
=>
(set-goal gl-come-bugongshou 1)
(chat-to-all "gl-come-bugongshou 1")
(disable-self)
)

;2
(defrule
(goal gl-come-bugongshou 1)
=>
(chat-to-all "gl-come-bugongshou 1")
)

;3
(defrule
(goal gl-come-bugongshou 2)
=>
(chat-to-all "gl-come-bugongshou 2")
)

;4
(defrule
(or(players-unit-type-count any-enemy archer-line > 3)
(or(players-unit-type-count any-enemy longbowman-line > 3)
(or(players-unit-type-count any-enemy plumed-archer-line > 3)
(or(players-unit-type-count any-enemy lunbadenushou-line > 3)
(players-unit-type-count any-enemy hualangsheshou-line > 3)))))
=>
(set-goal gl-come-bugongshou 1)
)

;5
(defrule
(players-unit-type-count any-enemy archer-line <= 3)
(players-unit-type-count any-enemy longbowman-line <= 3)
(players-unit-type-count any-enemy plumed-archer-line <= 3)
(players-unit-type-count any-enemy lunbadenushou-line <= 3)
(players-unit-type-count any-enemy hualangsheshou-line <= 3)
=>
(set-goal gl-come-bugongshou 2)
)
期待特色AOC!!!!!
回复

使用道具 举报

38

主题

0

精华

5066

积分

国王

耕战
933
鹰币
4
天龙币
0
回帖
249

三级嘉禾勋章

附庸关系0
 楼主| 发表于 2013-9-27 23:47:24 | 显示全部楼层

追问3

本帖最后由 tankant 于 2013-9-28 10:24 编辑

自己尝试重点修改第五个rule换成如下形式:
(defconst gl-come-bugongshou 2)

;1
(defrule
(true)
=>
(set-goal gl-come-bugongshou 1)
(chat-to-all "gl-come-bugongshou 1")
(disable-self)
)

;4
(defrule
(or(players-unit-type-count any-enemy archer-line > 3)
(or(players-unit-type-count any-enemy longbowman-line > 3)
(or(players-unit-type-count any-enemy plumed-archer-line > 3)
(or(players-unit-type-count any-enemy lunbadenushou-line > 3)
(players-unit-type-count any-enemy hualangsheshou-line > 3)))))
=>
(set-goal gl-come-bugongshou 1)
(chat-to-all "1111111111111111111111111111")
)

;5
(defrule
(not
(or(players-unit-type-count any-enemy archer-line > 3)
(or(players-unit-type-count any-enemy longbowman-line > 3)
(or(players-unit-type-count any-enemy plumed-archer-line > 3)
(or(players-unit-type-count any-enemy lunbadenushou-line > 3)
(players-unit-type-count any-enemy hualangsheshou-line > 3)))))
)
=>
(set-goal gl-come-bugongshou 2)
(chat-to-all "22222222222222222222222")
)

;2
(defrule
(goal gl-come-bugongshou 1)
=>
(chat-to-all "gl-come-bugongshou 1")
)

;3
(defrule
(goal gl-come-bugongshou 2)
=>
(chat-to-all "gl-come-bugongshou 2")
)

测试结果:视野中任何一家敌人的步弓手+视野中任何一家敌人的步弓手尸体>3个的时候,"1111111111111111111111111111"出现;
不满足该条件的时候"22222222222222222222222"出现;
可是永远不显示"gl-come-bugongshou 1",永远是"gl-come-bugongshou 2"。
请问这个原因又是为什么?
期待特色AOC!!!!!
回复

使用道具 举报

23

主题

1

精华

2万

积分

征服者

耕战
3880
鹰币
3530
天龙币
75
回帖
1134

翔鹰建站十周年纪念章二级翔鹰勋章第八届火箭筒杯最佳战役第八届火箭筒杯最佳新人

附庸关系0
发表于 2013-9-28 01:37:48 | 显示全部楼层
因为你每次启动时都有(defconst gl-come-bugongshou 2)这句强行赋值为2了?

                 【2021】天堂之路DE版                                   【2016】霭之坡的窈蔚之森
个人网盘
回复

使用道具 举报

38

主题

0

精华

5066

积分

国王

耕战
933
鹰币
4
天龙币
0
回帖
249

三级嘉禾勋章

附庸关系0
 楼主| 发表于 2013-9-28 10:35:40 | 显示全部楼层

最终版本

本帖最后由 tankant 于 2013-9-28 11:53 编辑

最后调试好用了,具体原因不明。最终变成以下版本:


(defconst gl-come-bugongshou 2)

;1
(defrule
(true)
=>
(set-goal gl-come-bugongshou 1)
(chat-to-all "gl-come-bugongshou 1")
(disable-self)
)

;5
(defrule
(not
(or(players-unit-type-count any-enemy archer-line > 3)
(or(players-unit-type-count any-enemy longbowman-line > 3)
(or(players-unit-type-count any-enemy plumed-archer-line > 3)
(or(players-unit-type-count any-enemy lunbadenushou-line > 3)
(players-unit-type-count any-enemy hualangsheshou-line > 3)))))
)
=>
(set-goal gl-come-bugongshou 2)
(chat-to-all "22222222222222222222222")
)


;4
(defrule
(or(players-unit-type-count any-enemy archer-line > 3)
(or(players-unit-type-count any-enemy longbowman-line > 3)
(or(players-unit-type-count any-enemy plumed-archer-line > 3)
(or(players-unit-type-count any-enemy lunbadenushou-line > 3)
(players-unit-type-count any-enemy hualangsheshou-line > 3)))))
=>
(set-goal gl-come-bugongshou 1)
(chat-to-all "1111111111111111111111111111")
)



;2
(defrule
(goal gl-come-bugongshou 1)
=>
(chat-to-all "gl-come-bugongshou 1")
)

;3
(defrule
(goal gl-come-bugongshou 2)
=>
(chat-to-all "gl-come-bugongshou 2")
)
期待特色AOC!!!!!
回复

使用道具 举报

本版积分规则

排行榜|小黑屋|翔鹰帝国

GMT+8, 2024-11-23 13:31 , Processed in 0.230763 second(s), 66 queries , File On.

Powered by Hawk Studio  QS Security Corp.® Licensed

Copyright © 2001-2023, Hawkaoe.net All Rights Reserved

快速回复 返回顶部 返回列表