Jump to content

Home

Need help with a script!


Exile007

Recommended Posts

I wrote my own script this time, but it didn't work out so well. I attempted make an NPC move to a certain waypoint.

 

 

void main()

{

object oExarKun=GetObjectByTag("exarkun");

object oWP=GetObjectByTag("walk");

location 1Destination = GetLocation(oWP);

AssignCommand(oExarKun,ActionMoveToLocation(1Destination,FALSE);

}

 

I get a syntax error when I try to compile it.

 

walk.nss(5): Error: Syntax error at "integer constant"

walk.nss(6): Error:Syntax error at "Destination"

 

Anyhelp with this would be appreciated.

Link to comment
Share on other sites

Try this;

void main () {

object oNPC=GetObjectByTag("exarkun"); 

AssignCommand(oNPC, ClearAllActions());
AssignCommand(oNPC, ActionForceMoveToLocation(GetLocation(GetObjectByTag("walk", 0)), 0));

 

EDIT: There shouldn't be a space in 'Tag' I have no idea why it's showing like this but just remove the space.

Link to comment
Share on other sites

I wrote my own script this time, but it didn't work out so well. I attempted make an NPC move to a certain waypoint.

 

 

void main()

{

object oExarKun=GetObjectByTag("exarkun");

object oWP=GetObjectByTag("walk");

location 1Destination = GetLocation(oWP);

AssignCommand(oExarKun,ActionMoveToLocation(1Destination,FALSE);

}

 

I get a syntax error when I try to compile it.

 

walk.nss(5): Error: Syntax error at "integer constant"

walk.nss(6): Error:Syntax error at "Destination"

 

Anyhelp with this would be appreciated.

 

Shouldn't it be lDestination instead of 1Destination?

void main()
{
object oExarKun=GetObjectByTag("exarkun");
object oWP=GetObjectByTag("walk");
location lDestination = GetLocation(oWP);
AssignCommand(oExarKun,ActionMoveToLocation(lDestination,FALSE));
}

 

The script complies fine when i changed that.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...