Exile007 Posted February 9, 2008 Posted February 9, 2008 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.
Stream Posted February 9, 2008 Posted February 9, 2008 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.
sekan Posted February 9, 2008 Posted February 9, 2008 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.
Exile007 Posted February 9, 2008 Author Posted February 9, 2008 Yes! I got it to compile! Thanks guys!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.