Talk:Epic:Unreal Creature Care and Feeding Guide

From Oldunreal-Wiki
Jump to navigation Jump to search

Duck and Pause

Here's a note on how DuckTime and PauseTime work in the AlarmPoint, because this point was tricky to understand and is actually the reason I scavenged this particular article from archive.org, as there is some confusion in this very article, and in most explanations you can find.

When a pawn reaches the alarm point, it performs the AlarmAnim animation if it has one, and is allocated a certain time to complete this animation. This time is DuckTime. After it has completed the animation, if DuckTime is not over, it will freeze on the last frame of its animation, until the timer is finished. Then, PauseTime kicks in. Only after PauseTime is finished is the pawn free again. So here's how it works:

A mercenary spots the player, and goes to its AlarmPoint. There, it has an AlarmAnim (Anim CHAREUP, for instance). It completes its animation, and then freezes on the last frame until DuckTime is up. If no DuckTime is given, it will play only the first frame of its animation, and then immediately abort it and start its PauseTime. If bShootWhilePaused is true and it has been given a ShootTarget, it will immediately start shooting the target, without waiting for the animation to be complete. If DuckTime is equal to the animation's lenght, it will play its animation, then shoot the target. If it's longer, it will play it, freeze, then shoot the target.

Notice that for the pawn to do anything, PauseTime must be over 0. If the AlarmPoint has an AlarmAnim and a DuckTime, but has a 0 PauseTime, the anim will not be performed and there will be no "ducking" : once the AlarmPoint is reached, the mercenary will immediately run to the next AlarmPoint, or shoot the player if he has no more AlarmPoints to reach.

To sum it up briefly, PauseTime is indeed the time during which the pawn will remain at the location of the AlarmPoint. It must necessarily exist as a value superior to 0 for anything to be done at this AlarmPoint, otherwise anything set up there will not be taken into account (as the pawn does not pause at this AlarmPoint to do its little act). DuckTime is the time during which AlarmAnim is played. If it's equal to zero, the animation will be aborted. If it's too long, the animation will freeze on its last frame. Try to keep it equal to the animation's lenght. If PauseTime is smaller than DuckTime, the animation will abort and the pawn will resume whatever it needs to do (run to the next AlarmPoint or shoot the player, accordingly): PauseTime is more important than DuckTime in this case.

These two timers are set in seconds. Finally, you can create looped behaviour by linking an AlarmPoint to another AlarmPoint earlier in the series.


Hellkeeper 21:02, 2 November 2012 (CET)