「システムで定義されたシンボル」の中で、判明していて、使えそうなもの。
UP-POCKET-POSITION
この定数が、定義されていれば、自分の位置が後衛だとAIは判断している。
後衛かどうかは、例えば、3v3や4v4で、敵と隣り合っていない位置に配置されたプレイヤーのことを指します。
後衛かどうか判断するときは、以下のように定数に落とし込むことで、判定しやすいです。
#load-if-defined UP-POCKET-POSITION
(defconst this-player-position 2)
#else
(defconst this-player-position 1)
#end-if
このようにすれば、this-player-position が1なら前衛、2なら後衛だと判定できる
上記を踏まえた使い方の例。
(defrule
(up-compare-const this-player-position == 1)
=>
(set-goal 77 1)
(chat-to-all "前衛なので、戦術を射手にセットしました")
(disable-self)
)
(defrule
(up-compare-const this-player-position == 2)
=>
(set-goal 77 2)
(chat-to-all "後衛なので、戦術を騎兵にセットしました")
(disable-self)
)
最終更新:2023年02月14日 19:43