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] I need a script

Page: 1 of 1
 sekan
04-01-2008, 9:19 AM
#1
Hi,

I need a script that makes 7 npcs run to another place in the module.

I would guess you'll need something like this in the beginning

void main()
{
object oNPC1=GetObjectByTag("sith_mast");
object oNPC2=GetObjectByTag("sith_apr01");
object oNPC3=GetObjectByTag("sith_apr02");
object oNPC4=GetObjectByTag("sith_heavy01");
object oNPC5=GetObjectByTag("sith_heavy02");
object oNPC6=GetObjectByTag("sith_sol01");
object oNPC7=GetObjectByTag("sith_sol02");




}
 Silveredge9
04-01-2008, 10:04 AM
#2
If you want each NPC to run to the exact same spot, then your script would be something like this.

void main()
{
object oNPC1=GetObjectByTag("sith_mast");
object oNPC2=GetObjectByTag("sith_apr01");
object oNPC3=GetObjectByTag("sith_apr02");
object oNPC4=GetObjectByTag("sith_heavy01");
object oNPC5=GetObjectByTag("sith_heavy02");
object oNPC6=GetObjectByTag("sith_sol01");
object oNPC7=GetObjectByTag("sith_sol02");

vector aPosition=Vector(100.0,100.0,0.0);
location lBla=Location(aPosition,0.0);

AssignCommand (oNPC1,ActionForceMoveToLocation(lBla,TRUE));
AssignCommand (oNPC2,ActionForceMoveToLocation(lBla,TRUE));
AssignCommand (oNPC3,ActionForceMoveToLocation(lBla,TRUE));
AssignCommand (oNPC4,ActionForceMoveToLocation(lBla,TRUE));
AssignCommand (oNPC5,ActionForceMoveToLocation(lBla,TRUE));
AssignCommand (oNPC6,ActionForceMoveToLocation(lBla,TRUE));
AssignCommand (oNPC7,ActionForceMoveToLocation(lBla,TRUE));
}


Just change the coordinates to match your location.
 sekan
04-01-2008, 10:20 AM
#3
If you want each NPC to run to the exact same spot, then your script would be something like this.

void main()
{
object oNPC1=GetObjectByTag("sith_mast");
object oNPC2=GetObjectByTag("sith_apr01");
object oNPC3=GetObjectByTag("sith_apr02");
object oNPC4=GetObjectByTag("sith_heavy01");
object oNPC5=GetObjectByTag("sith_heavy02");
object oNPC6=GetObjectByTag("sith_sol01");
object oNPC7=GetObjectByTag("sith_sol02");

vector aPosition=Vector(100.0,100.0,0.0);
location lBla=Location(aPosition,0.0);

AssignCommand (oNPC1,ActionForceMoveToLocation(lBla,TRUE));
AssignCommand (oNPC2,ActionForceMoveToLocation(lBla,TRUE));
AssignCommand (oNPC3,ActionForceMoveToLocation(lBla,TRUE));
AssignCommand (oNPC4,ActionForceMoveToLocation(lBla,TRUE));
AssignCommand (oNPC5,ActionForceMoveToLocation(lBla,TRUE));
AssignCommand (oNPC6,ActionForceMoveToLocation(lBla,TRUE));
AssignCommand (oNPC7,ActionForceMoveToLocation(lBla,TRUE));
}


Just change the coordinates to match your location.

Thanks but i need them to run to different spots.
 Silveredge9
04-01-2008, 11:09 AM
#4
It always helps to be as descriptive as possible in your initial post.

Anyways, the script would be something like this;


void main()
{
object oNPC1=GetObjectByTag("sith_mast");
object oNPC2=GetObjectByTag("sith_apr01");
object oNPC3=GetObjectByTag("sith_apr02");
object oNPC4=GetObjectByTag("sith_heavy01");
object oNPC5=GetObjectByTag("sith_heavy02");
object oNPC6=GetObjectByTag("sith_sol01");
object oNPC7=GetObjectByTag("sith_sol02");

vector aPosition=Vector(100.0,100.0,0.0);
location lBla=Location(aPosition,0.0);

vector bPosition=Vector(100.0,100.0,0.0);
location lBla2=Location(bPosition,0.0);

vector cPosition=Vector(100.0,100.0,0.0);
location lBla3=Location(cPosition,0.0);

vector dPosition=Vector(100.0,100.0,0.0);
location lBla4=Location(dPosition,0.0);

vector ePosition=Vector(100.0,100.0,0.0);
location lBla5=Location(ePosition,0.0);

vector fPosition=Vector(100.0,100.0,0.0);
location lBla6=Location(fPosition,0.0);

vector gPosition=Vector(100.0,100.0,0.0);
location lBla7=Location(gPosition,0.0);

AssignCommand (oNPC1,ActionForceMoveToLocation(lBla,TRUE));
AssignCommand (oNPC2,ActionForceMoveToLocation(lBla2,TRUE));
AssignCommand (oNPC3,ActionForceMoveToLocation(lBla3,TRUE));
AssignCommand (oNPC4,ActionForceMoveToLocation(lBla4,TRUE));
AssignCommand (oNPC5,ActionForceMoveToLocation(lBla5,TRUE));
AssignCommand (oNPC6,ActionForceMoveToLocation(lBla6,TRUE));
AssignCommand (oNPC7,ActionForceMoveToLocation(lBla7,TRUE));
}

Again, replace the coordinates for each position with your own.
 sekan
04-01-2008, 11:39 AM
#5
It always helps to be as descriptive as possible in your initial post.

Anyways, the script would be something like this;


void main()
{
object oNPC1=GetObjectByTag("sith_mast");
object oNPC2=GetObjectByTag("sith_apr01");
object oNPC3=GetObjectByTag("sith_apr02");
object oNPC4=GetObjectByTag("sith_heavy01");
object oNPC5=GetObjectByTag("sith_heavy02");
object oNPC6=GetObjectByTag("sith_sol01");
object oNPC7=GetObjectByTag("sith_sol02");

vector aPosition=Vector(100.0,100.0,0.0);
location lBla=Location(aPosition,0.0);

vector bPosition=Vector(100.0,100.0,0.0);
location lBla2=Location(bPosition,0.0);

vector cPosition=Vector(100.0,100.0,0.0);
location lBla3=Location(cPosition,0.0);

vector dPosition=Vector(100.0,100.0,0.0);
location lBla4=Location(dPosition,0.0);

vector ePosition=Vector(100.0,100.0,0.0);
location lBla5=Location(ePosition,0.0);

vector fPosition=Vector(100.0,100.0,0.0);
location lBla6=Location(fPosition,0.0);

vector gPosition=Vector(100.0,100.0,0.0);
location lBla7=Location(gPosition,0.0);

AssignCommand (oNPC1,ActionForceMoveToLocation(lBla,TRUE));
AssignCommand (oNPC2,ActionForceMoveToLocation(lBla2,TRUE));
AssignCommand (oNPC3,ActionForceMoveToLocation(lBla3,TRUE));
AssignCommand (oNPC4,ActionForceMoveToLocation(lBla4,TRUE));
AssignCommand (oNPC5,ActionForceMoveToLocation(lBla5,TRUE));
AssignCommand (oNPC6,ActionForceMoveToLocation(lBla6,TRUE));
AssignCommand (oNPC7,ActionForceMoveToLocation(lBla7,TRUE));
}

Again, replace the coordinates for each position with your own.


Thanks :D

Sorry i didn't mean to sound negative.
Page: 1 of 1