jim87
New Member
- Joined
- Aug 26, 2011
- Messages
- 445
- Reaction score
- 7
Hello!
I'm trying to let the combat behavior start, but I encountered a problem, that is behavior tree-based behaviors won't start (haven't tried scripted ones though).
This is the code, took from AutoAngler2 (which in any case doesn't work =\)... I found no reference for the BT-based combat behaviors.
Result:
I'm trying to let the combat behavior start, but I encountered a problem, that is behavior tree-based behaviors won't start (haven't tried scripted ones though).
This is the code, took from AutoAngler2 (which in any case doesn't work =\)... I found no reference for the BT-based combat behaviors.
PHP:
class ActionCombat : Action
{
protected override RunStatus Run(object context)
{
if (RoutineManager.Current.CombatBehavior != null)
{
try
{
if (!RoutineManager.Current.CombatBehavior.IsRunning)
{
Utils.DebugLog("Starting combat behavior");
RoutineManager.Current.CombatBehavior.Start(null);
}
Utils.changeStatusText("In combat");
return RoutineManager.Current.CombatBehavior.Tick(null);
}
catch (Exception ex)
{
Utils.DebugLog(ex.Message);
RoutineManager.Current.Combat();
return RunStatus.Success;
}
}
// Legacy Combat() method
else
{
RoutineManager.Current.Combat();
return RunStatus.Success;
}
}
}
Result:
PHP:
[23:21:40:525] [FB] Starting combat behavior
[23:21:40:526] [FB] Cannot run Tick before running Start first!
[... repeat]