Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

[K1]Sitting Script.

Page: 1 of 1
 HK-42
01-13-2009, 5:37 PM
#1
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?
 Canderis
01-13-2009, 5:47 PM
#2
void main() {
object oNPC= GetObjectByTag("a_king", 0);
AssignCommand(oNPC, ActionPlayAnimation(ANIMATION_LOOPING_SIT_CHAIR, 1.0, 0.0));
}



Try that.
 HK-42
01-13-2009, 5:49 PM
#3
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.
 Star Admiral
01-13-2009, 6:00 PM
#4
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
 HK-42
01-13-2009, 6:05 PM
#5
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.
 Canderis
01-13-2009, 6:35 PM
#6
aren't people in the cantena on taris sitting?
 HK-42
01-13-2009, 6:39 PM
#7
aren't people in the cantena on taris sitting?

They are part of the placeable
 glovemaster
01-14-2009, 10:35 AM
#8
void main() {
object oNPC = GetObjectByTag("a_king", 0);
AssignCommand(oNPC, ActionPlayAnimation(ANIMATION_LOOPING_SIT_CHAIR, 1.0, -1.0));
}
I also should mention that this will need to be put onEnter of the module as when you leave and return the animation stops.
Page: 1 of 1