Patrol time break

Nazir

New member
Hi, I've implemented on my army guy a patrol task with some waypoints and it's doing fine. Now, I'd like to make him stop at some specific intervals, do an idle action (e.g. he smokes a cigarette), and then resume patrolling. Is there a way to do that?

It would be ideal if I could have some kind of timer, e.g. perform this action for X seconds, after that take a break (another action) and then return to the previous task. Because his cigarette break shouldn't be triggered by an outside event, it should be part of his behavior sequence.
 
The patrol task does have an option to wait at each waypoint. It does not depend on animations though so for that you'll likely want to subclass the patrol task to send an event to your animation system indicating that the idle action should play.
 
Yeah, wait at each waypoint is a nice option, but it's definitely a part of the patrol task (and that's fine, I'm using it as well). However, I don't understand how can I make a situation where a patrol task can send an event to the animation system? Which action / task could help me interrupt this patrol system after the soldier makes e.g. 4 rounds of patrolling?
 
If you subclass the Patrol task you can then notify the animation system that the patrol has stopped when waypointReachedTime does not equal -1. I can make this variable protected in the next version so you can easily check the value.
 
Top