Jump to content

Home

Making NPC's Kneel or sit


dangen77

Recommended Posts

On Dantoine, in the grove, when you first approach Juhani, she is kneeling (in deep mediation). I am creating a Courescant Mod and I would like to have the memebrs of the Jedi Council kneeling in this fashion. Is this possible? How do you make an NPC kneel or sit? Thanks in advance!!!!

Link to comment
Share on other sites

On Dantoine, in the grove, when you first approach Juhani, she is kneeling (in deep mediation). I am creating a Courescant Mod and I would like to have the memebrs of the Jedi Council kneeling in this fashion. Is this possible? How do you make an NPC kneel or sit?

 

You can do this by making that NPC run one of the the PlayAnimation() or ActionPlayAnimation() script functions.

 

To make them sit on their knees with hands on their lap:

PlayAnimation(ANIMATION_LOOPING_MEDITATE, 1.0, -1.0);

 

In K2:TSL, to make them sit with their legs crossed and their hands on their knees:

PlayAnimation(ANIMATION_LOOPING_SIT_AND_MEDITATE, 1.0, -1.0);

Link to comment
Share on other sites

You can attach a script like this in the OnSpawn field of the .utc file (or any other suitable location):

 

(If I recall well, I think this one if the kneeling animation - it's a script I made for svosh's Revan Redemtion robes mode sometime ago)

 

void main() {
PlayAnimation(3,1.0,-1.0);
}

 

or, if you attach it somewhere else than the OnSpawn event, you have to indicate which npc will play the animation:

 

void main() {
AssignCommand(GetObjectByTag("my_npc_tag"), ActionPlayAnimation(3,1.0,-1.0));

 

3 corresponds to the animation you want to play (check nwscript.nss), the second value to the speed of the animation and the 3rd to the duration. Set it to -1.0 if you want a continouous animation.

 

Relevant excerpt of nwscript.nss:

// 40: Cause the action subject to play an animation
// - nAnimation: ANIMATION_*
// - fSpeed: Speed of the animation
// - fDurationSeconds: Duration of the animation (this is not used for Fire and
//   Forget animations) If a time of -1.0f is specified for a looping animation
//   it will loop until the next animation is applied.
void ActionPlayAnimation(int nAnimation, float fSpeed=1.0, float fDurationSeconds=0.0);

 

Edit, hehe stoffe beats me to it!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...