Cooldownの使い方がよく分からない

Here is the forum to do the questions about how to use to Arbor developer.
Attention point:
  • We can not answer your questions about your project specific issues.
  • We can not answer your questions on Unity's specification issues.
  • Please check Arbor Documentation and ask a question if you still don't know how to use it. If the desired function is not described in the document, it is highly possible that the function does not exist from the beginning, so go to the request forum.

ここは、Arbor開発者へ使い方に関する質問を行うフォーラムです。
注意点:
  • ユーザー様のプロジェクトの仕様上の問題や設計に対する質問には答えられません。
  • Unityの仕様上の問題に対する質問には答えられません。
  • Arbor Documentationを確認の上、それでも使い方がわからない場合にご質問ください。欲しい機能の記載がドキュメントにない場合は機能が元から存在しない可能性が高いので要望フォーラムへ。

Forum rules
Here is the forum to do the questions about how to use to Arbor developer.
Attention point:
  • We can not answer your questions about your project specific issues.
  • We can not answer your questions on Unity's specification issues.
  • Please check Arbor Documentation and ask a question if you still don't know how to use it. If the desired function is not described in the document, it is highly possible that the function does not exist from the beginning, so go to the request forum.

ここは、Arbor開発者へ使い方に関する質問を行うフォーラムです。
注意点:
  • ユーザー様のプロジェクトの仕様上の問題や設計に対する質問には答えられません。
  • Unityの仕様上の問題に対する質問には答えられません。
  • Arbor Documentationを確認の上、それでも使い方がわからない場合にご質問ください。欲しい機能の記載がドキュメントにない場合は機能が元から存在しない可能性が高いので要望フォーラムへ。
Yuki

Cooldownの使い方がよく分からない

Post by Yuki »

やりたいことは
「クールダウン時間内はアクションを実行しない」
です。
この動画の41:30でやっている「変数がNullならアクションを実行しない」みたいな制御をしたいです。
https://www.youtube.com/watch?v=OEfHtqIQh1I

CooldownをWaitアクションに追加して、
カウントダウンが始まらないです。
割り込みはNothing、演算はAndです。
User avatar
caitsithware
管理人
Posts: 493
Joined: 2015/08/17 12:41

Re: Cooldownの使い方がよく分からない

Post by caitsithware »

Cooldownは、ノードが終了後からの時間経過後にノードを再度アクティブにするDecoratorになっております。
詳しくはドキュメントをご覧ください
Cooldown | Arbor Documentarion

目的の「クールダウン時間内はアクションを実行しない」を実現する方法ですが、
  • クールダウン後に実行したいアクション側にCooldownデコレータを付ける。
    ほかにクールダウン中にしていたいアクションがあるなら優先度が低い側にそのアクションを置いておく。
    (クールダウン中は何もしないならIdleアクション、など)
  • クールダウン中の待機を優先度が高いとみなす場合は、クールダウン中をWaitアクションで処理することにする。
    Waitアクション側の優先度を高くして、クールダウン後に目的のアクションを実行するようにSequencerでつないでおく。
という感じです。

【追記】
優先度が低いノードから優先度の高いノードを「割り込み(再実行)」するには、AbortFlagsをLowerPriorityにする必要があります。
Cooldownデコレータは、基本的に再実行させるためにつけるためAbortFlagsはLowerPriorityにしてください。
AbortFlagsについて詳しくはドキュメントをご覧ください。
AbortFlagsについて
Guest

Re: Cooldownの使い方がよく分からない

Post by Guest »

Cooldownはそういう仕様であるということで了解しました。
Decoratorを自作したところ望み通りの挙動が得られました。

ご提案のやり方は、
私がビヘイビアツリーの完全な初心者であるため、全くイメージがつかめませんでした。

私のビヘイビアーツリーの設計がよくない気がしますが、ともかくありがとうございました。
Post Reply