Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /var/sites/s/saturn-design.co.uk/public_html/index.php:44) in /var/sites/s/saturn-design.co.uk/public_html/libraries/joomla/session/session.php on line 423

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /var/sites/s/saturn-design.co.uk/public_html/index.php:44) in /var/sites/s/saturn-design.co.uk/public_html/libraries/joomla/session/session.php on line 423

Warning: Cannot modify header information - headers already sent by (output started at /var/sites/s/saturn-design.co.uk/public_html/index.php:44) in /var/sites/s/saturn-design.co.uk/public_html/libraries/joomla/session/session.php on line 426
Animations in NWN2
Home Blogs Ross Mackenzie Animations in NWN2


Animations in NWN2
Written by Ross   
Monday, 22 February 2010 18:03

Scripting is the name of the game this week, and we're busy putting in the dialogue we wrote actually into the engine. Once this is done, along with a few scripting tweaks like area transitions and such, we'll have an alpha to time-test internally. Fun!

So anyway, firing off animations in dialogues is easy, but there are multiple ways of doing it. The easiest way is to just specify an animation for the tag in the list below the conversation tree on the animations tab. However, going to the actions tab and adding a ga_play_custom_animation or a ga_play_animation script will allow much more control, including speed, duration, and delay.

play_custom_animation is easy. Just add the script and hit refresh, then input the tag of the character you want to animate for sTarget, the name of the animation (which can be found on the animations tab), whether you want it to loop (1) or not (0), and the number of seconds before the animation plays when the conversation hits that node. This allows you to set off an animation right at the start of a node, say of someone talking, or near the end, as they get hit by an arrow or somesuch. This gives the dialogue the feeling that it is an actual conversation happening in real-time rather than a series of lines of text.

play_animation is slightly more effort, but gives you even more control than play_custom_animation. The sTarget works in the same way, just the creature's tag, but instead of loop you have a duration setting, a speed setting (where 1.0 is normal speed, 0.5 is half speed, etc.) and a delay setting. This means you can cut an animation off before it has finished playing, which I used to take the first half of the 'tired' animation (knuckling his forehead) and cut off the second part (yawning). Without the yawn, knuckling his forehead makes it look like he feels ill, which is the effect I was looking to achieve.

The problem with play_animation is that instead of using a string for the animation and taking it's name from the animation tab, it calls it directly by its integer value. To find these values, go to the script editor, and click on the 'globals' tab in the script assist on the right hand side. If you then search 'animation' it will filter the results, and finding the integer for each animation is as simple as clicking on it and reading the script preview box. Slightly more effort, but if you need to control the speed of an animation or cut it off before the end, it is invaluable.

Well, that's all from me. Scripting time!

Comments (0)
Only registered users can write comments!