Option | Description |
---|
Chooser |
---|
Sources Count | Number of outputs (sources). |
Check Movement | Check, if there is free space on the AI map. Each animation in source0-sourceN has its own offset. You can determine the point where an NPC will move to, if it uses this animation. Before each animation is chosen, the availability of this point from the current NPC position is checked (there should be no obstacles on the AI map). If there are obstacles on the AI map, the animation gets the minimum weight and will not be sent to the output. If there is no place on the AI map for end points of any of the listed animations, then the one with the smallest offset is selected. Important: even if zero weight is specified for the animation in Probs, it could be selected, if all other animations are blocked by the AI map. |
Check NPC | When checking for free space on the AI map, other NPCs are taken into account as obstacles (their move shapes are stored in move_shape_type in npc.lua). |
Disable P2P | Disable the linear pull to a point. If Check Movement is enabled, then by default the NPC is pulled to the nearest spot available on the AI map (nearest to the current position of the NPC + the animation offset). This property lets you disable this, since such behavior is not always desired, especially if the animation does not fit the AI map with the specified offset. |
Probs |
---|
Prob 0 | Weight of a source. The greater the weight, the greater the likelihood that this particular animation will be selected. |
Prob 1 |
Choose Once | If this property is on, then after selecting and playing 100% of one of the animations from the outputs, it will continue playing in a loop, if it is Looped, otherwise it will remain stuck on the last frame. If this property is off, another animation will be selected. Animations are selected without repetition. If all animations have been selected once, the cycle of their selection is restarted. |
Random | If disabled, the weight specified in Prob0-ProbN is used as the current probability value of this source. That is, the animations are selected according to the weight set for them (first the animation with the highest is selected, then the one with the lower weight, etc.). |
Fade Time | Probability attenuation time. x – time elapsed since the last selection of this source. attenuation coefficient = (3 * x * x - 2 * x * x * x) / Fade Time, the minimum value is 0.00001, the maximum value is 1. The current weight from Probs will be multiplied by the attenuation coefficient. This value is best left untouched unless there’s a pressing need to change it. |
Use Global Cache | Guarantees a repetition-free selection of animations for all NPCs that use this animation script at once. Not very good for performance, so it should be used only where necessary and, if possible, not used with Check Movement. |