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