Jump to content

Home

[K1]Sitting Script.


HK-42

Recommended Posts

This is getting a bit frustrating :confused:.

 

void main() {
    object oAtton = GetObjectByTag("a_king", 0);
    AssignCommand(oAtton, ActionPlayAnimation(ANIMATION_LOOPING_SIT_CHAIR, 1.0, 0.0));
}

 

The script works on normal number like 21, but not like this.(and for some reason it says Atton, but probably its a K2 script.) 21: is sit but it played a poison animation.

 

I get tons of syntax with the one above complaining about the 2 commands and ANIMATION_LOOPING_SIT_CHAIR. Any ideas how I can fix this?

Link to comment
Share on other sites

void main() {
    object oNPC= GetObjectByTag("a_king", 0);
    AssignCommand(oNPC, ActionPlayAnimation(ANIMATION_LOOPING_SIT_CHAIR, 1.0, 0.0));
}

 

 

 

Try that.

 

Nope, same errors. By the way the "Atton" part was not a big deal, didnt make a difference.

Link to comment
Share on other sites

To figure out what constants are usable for the ActionPlayAnimation() function, use NotePad to open up the nwscript.nss file inside your Override folder. Using the Find ability under the Edit menu, type in ANIMATION_ and hit Find. You'll be taken to the start of all animation constants that you can use in the game. Note that in this case, ANIMATION_LOOPING_SIT_CHAIR does not exist. (Well, technically it does, but that line is commented out.) There doesn't seem to be a constant for a sitting animation, so if you want the character to sit, you'll probably have to test each one of the constants until you find one that will make the character sit. Try using ANIMATION_LOOPING_DEACTIVATE.

 

- Star Admiral

Link to comment
Share on other sites

To figure out what constants are usable for the ActionPlayAnimation() function, use NotePad to open up the nwscript.nss file inside your Override folder. Using the Find ability under the Edit menu, type in ANIMATION_ and hit Find. You'll be taken to the start of all animation constants that you can use in the game. Note that in this case, ANIMATION_LOOPING_SIT_CHAIR does not exist. (Well, technically it does, but that line is commented out.) There doesn't seem to be a constant for a sitting animation, so if you want the character to sit, you'll probably have to test each one of the constants until you find one that will make the character sit. Try using ANIMATION_LOOPING_DEACTIVATE.

 

- Star Admiral

 

Ok, I see them, but I dont see one that will make them sit, I wonder why sit chair was removed.

Link to comment
Share on other sites

void main() {
    object oNPC = GetObjectByTag("a_king", 0);
    AssignCommand(oNPC, ActionPlayAnimation(ANIMATION_LOOPING_SIT_CHAIR, 1.0, [color=red]-1.0[/color]));
}

I also should mention that this will need to be put onEnter of the module as when you leave and return the animation stops.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...