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.

Scripting help (no surprise there)

Page: 1 of 1
 Canderis
10-26-2008, 1:17 AM
#1
How would i make a script that does one thing then another thing without making 2 seperate scripts?

Details:
i want 2 creatures to move to 2 differnt points then turn arround and play the salute animation.
 stoffe
10-26-2008, 11:14 AM
#2
i want 2 creatures to move to 2 differnt points then turn arround and play the salute animation.

An example of this as its simplest, since you didn't specify under what circumstances it should be done:


void main() {
object oNPC1 = GetObjectByTag("Creature1Tag");
object oNPC2 = GetObjectByTag("Creature2Tag");

location lLoc1 = Location(Vector(1.0, 1.0, 0.0), 0.0);
location lLoc2 = Location(Vector(1.0, 1.0, 0.0), 0.0);

AssignCommand(oNPC1, ClearAllActions());
AssignCommand(oNPC2, ClearAllActions());

AssignCommand(oNPC1, ActionMoveToLocation(lLoc1));
AssignCommand(oNPC2, ActionMoveToLocation(lLoc2));

AssignCommand(oNPC1, ActionDoCommand( SetFacing(GetFacingFromLocation(lLoc1)) ));
AssignCommand(oNPC2, ActionDoCommand( SetFacing(GetFacingFromLocation(lLoc2)) ));

AssignCommand(oNPC1, ActionPlayAnimation(ANIMATION_FIREFORGET_SALUTE));
AssignCommand(oNPC2, ActionPlayAnimation(ANIMATION_FIREFORGET_SALUTE));
}


Where Creature1Tag and Creature2Tag should be the tags of the creatures to do the moving and saluting, 1.0, 1.0 should be changed to the X and Y coordinates within the area they should move to and 0.0 should be set to the angle (0.0 - 360.0 degrees) they should be facing when they arrive at that location.
 Canderis
10-26-2008, 1:05 PM
#3
The circumstances under wich it should be done is when a trigger fires but i can set up the trigger.
Thannks stoffe =)
Page: 1 of 1