Jump to content

Home

Scripting help (no surprise there)


Canderis

Recommended Posts

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("[color=SkyBlue]Creature1Tag[/color]");  
   object oNPC2 = GetObjectByTag("[color=SkyBlue]Creature2Tag[/color]");

   location lLoc1 = Location(Vector([color=Yellow]1.0, 1.0[/color], 0.0), [color=Plum]0.0[/color]);
   location lLoc2 = Location(Vector([color=Yellow]1.0, 1.0[/color], 0.0), [color=Plum]0.0[/color]);

   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.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...