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.

Need help with a script!

Page: 1 of 1
 Exile007
02-09-2008, 10:59 AM
#1
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(1Desti nation,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.
 Stream
02-09-2008, 11:12 AM
#2
Try this;

void main () {

object oNPC=GetObjectByTag("exarkun");

AssignCommand(oNPC, ClearAllActions());
AssignCommand(oNPC, ActionForceMoveToLocation(GetLocation(GetObjectByT ag("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.
 sekan
02-09-2008, 11:15 AM
#3
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(1Desti nation,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(lDesti nation,FALSE));
}


The script complies fine when i changed that.
 Exile007
02-09-2008, 2:08 PM
#4
Yes! I got it to compile! Thanks guys!
Page: 1 of 1