![]() |
![]() |
|||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
Regarding Animations Intended Audience: [Printer Friendly / Syntax Highlight] You basically have two choices when adding animations to your creatures in the game. Adding them directly or using the automatic functions in the generic AI. Adding Animations Directly The Action Queue The reason this is important is that there are two main commands that deal with animations: ActionPlayAnimation and just PlayAnimation. ActionPlayAnimation places the command to perform the animation in the queue... PlayAnimation tells the creature to do the animation immediately as soon as it is reached in the script, overriding anything else going on in the queue. If I wanted to script someone to move to a particular waypoint and then meditate for 6 seconds, it would look like this: The creature would then move to the waypoint and wait until he got there before he began playing his meditation animation. If I wanted to set a variable when he was finished all that, I would also have to add it into the queue. You can do this with the ActionDoCommand(). This places a non-Action command into the queue. If I did the SetLocalInt command without putting it into the queue, then it would fire as soon as that point in the script was reached... probably well before the creature even reached the waypoint. The two commands for animations are as follows: There are two types of animations: 'fire-and-forget' (or FNF), which only plays once and no duration is needed, and 'looping' which play as long as needed and a duration is required for. A reminder once again: NOT ALL MODELS HAVE ALL ANIMATIONS. Just to mention, too, that the animations listed in the constants are not every animation that a model is capable of (there is a dying animation, after all, as well as combat animations and others)... this is just the current list of the ones that can be played via script. Using Generic AI Animations For a quick and easy solution to adding some life to your placed creatures, the generic AI has two functions that you can use. In the generic OnSpawn script ("nw_c2_default9"), there is a whole list of commands that are all commented out (they are preceded with a '//' double slash that colors them green and prevents them from being compiled). To use the built-in animations, you simply need to comment back in (remove the '//') one of the following commands: Don't worry about the comments that are on the same line with these commands... that just tells what they do. Simply erase the double-slash at the beginning of the line. Then you re-compile the script and save it as a different file. And that's it... that's all you have to do. What do these do? Basically they are called in the OnHeartbeat event (meaning the script will 'activate' every 6 seconds). The script checks to make sure that the creature is not asleep, not in combat, not in conversation and no enemy is in sight... if all those are okay, it plays the animations. 'Ambient animations' means that the creature will move about randomly, occasionally stopping to turn to nearby friends (creatures with a friendly reputation) and play what social animations it has (and, yes, this will work on any type of creature.. it will do what it can for those creatures who don't have the full range). 'Immobile ambient animation' does the same thing... without the random movement. The creature stays in place. So you can put down several of these types of creatures, for instance, and they will turn to each other at random intervals and seem to chat, laugh, argue... and even mill around and mingle, with the ambient animations. Do the placeable object animations work the same way? Yes. You can tell a chest to open by having it run its ANIMATION_PLACEABLE_OPEN, or a lamp post to turn off using ANIMATION_PLACEABLE_DEACTIVATE. A few things to keep in mind: 1) For placeable objects that are sources of illumination (such as the lamp post), it is not enough to just use its ANIMATION_PLACEABLE_DEACTIVATE or ANIMATION_PLACEABLE_ACTIVATE. That just affects the glowing part of the animation, itself. You must also use the SetPlaceableIllumination command set to TRUE and tell the area it's in to RecomputeStaticLighting. The following is an example of placeable illumination use: 2) Doors are not placeable objects. First thing you should know about them is that if the door is unlocked, a creature who is told to move to a point on the other side of one will automatically open it.
|
|||||||||||||||||||||||
|
|
||
|
Multiplayer Games at Neverwinter Connections
|
||
|
Download Modules
|
||
|
5,048,300 usuarios de BioWare:
|
||