HdVaderII Posted March 5, 2008 Share Posted March 5, 2008 Okay, i'm using the script "Make an NPC exit(move to a location and vanish)",in the scripting tutorials, but when i try to use it for my NPC he just dissapears, he doesn't walk away. Am I doing anything wrong in this script? void main () { // reeloend.nss // This script will make any NPC // move to a desired location and vanish. object oNPC=GetObjectByTag("reelo"); // insert NPC's tag here float x=93.85714; // do a whereami cheat float y=-10.57143; // to get x, y, and z float z=0.0; int bRun=TRUE; // you can set this to TRUE // if you want the NPC to run vector vExit=Vector(x,y,z); location lExit=Location(vExit,0.0f); ActionDoCommand(SetCommandable(TRUE,oNPC)); AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun)); AssignCommand (oNPC,ActionDoCommand(DestroyObject(oNPC))); // you can omit this last command if you like -- // if the NPC is not able to move to the // location, this command will prevent // you from being able to speak with him // again. But if they're going to leave anyway... ActionDoCommand(SetCommandable(FALSE,oNPC)); } Also another thing, can the NPC have anything in their path, or will it not work if they do? Help is appreciated... Link to comment Share on other sites More sharing options...
GeorgNihilus Posted March 16, 2008 Share Posted March 16, 2008 The path to the vExit vector must be clear enough for the NPC to walk or run to it, maybe that's why your character just stays in the position before vanishing ... change the vExit coordinates and try. I sometimes use a 2 steps script to move an NPC where I want good luck Link to comment Share on other sites More sharing options...
DarthStoney Posted March 16, 2008 Share Posted March 16, 2008 Okay, i'm using the script "Make an NPC exit(move to a location and vanish)",in the scripting tutorials, but when i try to use it for my NPC he just dissapears, he doesn't walk away. Am I doing anything wrong in this script? void main () { // reeloend.nss // This script will make any NPC // move to a desired location and vanish. object oNPC=GetObjectByTag("reelo"); // insert NPC's tag here float x=93.85714; // do a whereami cheat float y=-10.57143; // to get x, y, and z float z=0.0; int bRun=TRUE; // you can set this to TRUE // if you want the NPC to run vector vExit=Vector(x,y,z); location lExit=Location(vExit,0.0f); [color=Red]ClearAllActions();[/color] ActionDoCommand(SetCommandable(TRUE,oNPC)); AssignCommand (oNPC,ActionForceMoveToLocation(lExit,bRun)); AssignCommand (oNPC,ActionDoCommand(DestroyObject(oNPC))); // you can omit this last command if you like -- // if the NPC is not able to move to the // location, this command will prevent // you from being able to speak with him // again. But if they're going to leave anyway... ActionDoCommand(SetCommandable(FALSE,oNPC)); } Also another thing, can the NPC have anything in their path, or will it not work if they do? Help is appreciated... I am using almost the same script to move an npc and vanish the only differance is the red line I added to yours. Link to comment Share on other sites More sharing options...
HdVaderII Posted March 17, 2008 Author Share Posted March 17, 2008 I put in the script, and for some reason, the character jumps to the area while saying the last line. Link to comment Share on other sites More sharing options...
DarthStoney Posted March 17, 2008 Share Posted March 17, 2008 I put in the script, and for some reason, the character jumps to the area while saying the last line. On mine I have the script fire on the last line in the dialog which is the Exiles line in the dialog.(the last blue line) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.