harIII

10-19-2009, 09:20 AM

I am trying to make some npcs walk around in a module and I could never figure out the process used in the tutorial here on LFs. I made a huge script that is simply a script making the npc walk from one specific location to another.

It worked fine on the first npc but the second two I had problems with. The second one I went straight to another location and by passed the one that the npc stopped at and is now working fine. The third npc is completely stopping at the 7th to 8th movement and it shouldn't yet it does. Here is my script.

void main() {

object oNPC=GetObjectByTag("colonist03");

float x=115.8;

float y=135.17;

float z=0.0;

int bRun=TRUE;

vector vExit=Vector(x,y,z);

location lExit=Location(vExit,0.0f);

ActionDoCommand(SetCommandable(TRUE,oNPC));

AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun));

x=101.6;

y=172.54;

z=0.0;

vExit=Vector(x,y,z);

lExit=Location(vExit,0.0f);

ActionDoCommand(SetCommandable(TRUE,oNPC));

AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun));

x=116.72;

y=187.34;

z=0.0;

vExit=Vector(x,y,z);

lExit=Location(vExit,0.0f);

ActionDoCommand(SetCommandable(TRUE,oNPC));

AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun));

x=111.48;

y=205.0;

z=0.0;

vExit=Vector(x,y,z);

lExit=Location(vExit,0.0f);

ActionDoCommand(SetCommandable(TRUE,oNPC));

AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun));

x=115.8;

y=135.17;

z=0.0;

vExit=Vector(x,y,z);

lExit=Location(vExit,0.0f);

ActionDoCommand(SetCommandable(TRUE,oNPC));

AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun));

x=119.46;

y=130.88;

z=0.0;

vExit=Vector(x,y,z);

lExit=Location(vExit,0.0f);

ActionDoCommand(SetCommandable(TRUE,oNPC));

AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun));

x=109.42;

y=124.89;

z=0.0;

vExit=Vector(x,y,z);

lExit=Location(vExit,0.0f);

ActionDoCommand(SetCommandable(TRUE,oNPC));

AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun));

x=109.38;

y=103.53;

z=0.0;

vExit=Vector(x,y,z);

lExit=Location(vExit,0.0f);

ActionDoCommand(SetCommandable(TRUE,oNPC));

AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun));

x=93.09;

y=97.21;

z=0.0;

vExit=Vector(x,y,z);

lExit=Location(vExit,0.0f);

ActionDoCommand(SetCommandable(TRUE,oNPC));

AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun));

x=136.88;

y=93.6;

z=0.0;

vExit=Vector(x,y,z);

lExit=Location(vExit,0.0f);

ActionDoCommand(SetCommandable(TRUE,oNPC));

AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun));

x=136.75;

y=100.7;

z=0.0;

vExit=Vector(x,y,z);

lExit=Location(vExit,0.0f);

ActionDoCommand(SetCommandable(TRUE,oNPC));

AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun));

x=112.59;

y=100.7;

z=0.0;

vExit=Vector(x,y,z);

lExit=Location(vExit,0.0f);

ActionDoCommand(SetCommandable(TRUE,oNPC));

AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun));

x=109.42;

y=124.89;

z=0.0;

vExit=Vector(x,y,z);

lExit=Location(vExit,0.0f);

ActionDoCommand(SetCommandable(TRUE,oNPC));

AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun));

x=119.46;

y=130.88;

z=0.0;

vExit=Vector(x,y,z);

lExit=Location(vExit,0.0f);

ActionDoCommand(SetCommandable(TRUE,oNPC));

AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun));

x=115.8;

y=135.17;

z=0.0;

vExit=Vector(x,y,z);

lExit=Location(vExit,0.0f);

ActionDoCommand(SetCommandable(TRUE,oNPC));

AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun));

ExecuteScript("move_colonist03", OBJECT_SELF);

}

In the second quote is where the npc is just stopping and the very end code, the execute script, it simply makes the script start all over again making it loop.

What is making the npc stop?

It worked fine on the first npc but the second two I had problems with. The second one I went straight to another location and by passed the one that the npc stopped at and is now working fine. The third npc is completely stopping at the 7th to 8th movement and it shouldn't yet it does. Here is my script.

void main() {

object oNPC=GetObjectByTag("colonist03");

float x=115.8;

float y=135.17;

float z=0.0;

int bRun=TRUE;

vector vExit=Vector(x,y,z);

location lExit=Location(vExit,0.0f);

ActionDoCommand(SetCommandable(TRUE,oNPC));

AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun));

x=101.6;

y=172.54;

z=0.0;

vExit=Vector(x,y,z);

lExit=Location(vExit,0.0f);

ActionDoCommand(SetCommandable(TRUE,oNPC));

AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun));

x=116.72;

y=187.34;

z=0.0;

vExit=Vector(x,y,z);

lExit=Location(vExit,0.0f);

ActionDoCommand(SetCommandable(TRUE,oNPC));

AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun));

x=111.48;

y=205.0;

z=0.0;

vExit=Vector(x,y,z);

lExit=Location(vExit,0.0f);

ActionDoCommand(SetCommandable(TRUE,oNPC));

AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun));

x=115.8;

y=135.17;

z=0.0;

vExit=Vector(x,y,z);

lExit=Location(vExit,0.0f);

ActionDoCommand(SetCommandable(TRUE,oNPC));

AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun));

x=119.46;

y=130.88;

z=0.0;

vExit=Vector(x,y,z);

lExit=Location(vExit,0.0f);

ActionDoCommand(SetCommandable(TRUE,oNPC));

AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun));

x=109.42;

y=124.89;

z=0.0;

vExit=Vector(x,y,z);

lExit=Location(vExit,0.0f);

ActionDoCommand(SetCommandable(TRUE,oNPC));

AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun));

x=109.38;

y=103.53;

z=0.0;

vExit=Vector(x,y,z);

lExit=Location(vExit,0.0f);

ActionDoCommand(SetCommandable(TRUE,oNPC));

AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun));

x=93.09;

y=97.21;

z=0.0;

vExit=Vector(x,y,z);

lExit=Location(vExit,0.0f);

ActionDoCommand(SetCommandable(TRUE,oNPC));

AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun));

x=136.88;

y=93.6;

z=0.0;

vExit=Vector(x,y,z);

lExit=Location(vExit,0.0f);

ActionDoCommand(SetCommandable(TRUE,oNPC));

AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun));

x=136.75;

y=100.7;

z=0.0;

vExit=Vector(x,y,z);

lExit=Location(vExit,0.0f);

ActionDoCommand(SetCommandable(TRUE,oNPC));

AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun));

x=112.59;

y=100.7;

z=0.0;

vExit=Vector(x,y,z);

lExit=Location(vExit,0.0f);

ActionDoCommand(SetCommandable(TRUE,oNPC));

AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun));

x=109.42;

y=124.89;

z=0.0;

vExit=Vector(x,y,z);

lExit=Location(vExit,0.0f);

ActionDoCommand(SetCommandable(TRUE,oNPC));

AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun));

x=119.46;

y=130.88;

z=0.0;

vExit=Vector(x,y,z);

lExit=Location(vExit,0.0f);

ActionDoCommand(SetCommandable(TRUE,oNPC));

AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun));

x=115.8;

y=135.17;

z=0.0;

vExit=Vector(x,y,z);

lExit=Location(vExit,0.0f);

ActionDoCommand(SetCommandable(TRUE,oNPC));

AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun));

ExecuteScript("move_colonist03", OBJECT_SELF);

}

In the second quote is where the npc is just stopping and the very end code, the execute script, it simply makes the script start all over again making it loop.

What is making the npc stop?