Jump to content

Home

Help with vanishing a npc


Seamhainn

Recommended Posts

Hello!

 

I took this script from the tutorial for making a npc walk and then vanish:

 


void main () {

object oNPC=GetObjectByTag("n_basvis");

ActionDoCommand(SetCommandable(TRUE,oNPC));

AssignCommand (oNPC,ActionDoCommand(DestroyObject(oNPC)));

ActionDoCommand(SetCommandable(FALSE,oNPC));

}
[/Code]

 

Unfortunately it doesn't work. What did I do wrong?

 

Thanks and take care

Link to comment
Share on other sites

Umm this may be wrong as I'm still an avarage scripter but I think that you have basically made your NPC that you want to vanish modifiable and then have made it unmodifiable, to solve this just remove the last line of the script

 

ActionDoCommand(SetCommandable(FALSE,oNPC));

 

 

I hope this is correct. I did do a little research. :)

Link to comment
Share on other sites

Hello!

 

I took this script from the tutorial for making a npc walk and then vanish:

 

Unfortunately it doesn't work. What did I do wrong?

 

Thanks and take care

 

Your script does not make the NPC walk anywhere. Provided that the Tag set in the UTC for your NPC is n_basvis, and you are in a standard area which has a SW_EXIT waypoint, I think this should work:

 

void ST_Leave(string sTag) {
   SetCommandable(TRUE);
   ClearAllActions();
   ActionForceMoveToObject(GetObjectByTag(sTag));
   ActionDoCommand(DestroyObject(OBJECT_SELF));
   SetCommandable(FALSE);
}


void main () {
   object oNPC = GetObjectByTag("n_basvis");
   AssignCommand(oNPC, ST_Leave("SW_EXIT"));
}

Link to comment
Share on other sites

Im am sorry to bump my own thread, but how can I make a npc vanish/destroy on the Endar Spire? Is it at all possible?

 

Thanks and take care

 

If you just want the NPC to vanish you do:

void main() {
   DestroyObject(GetObjectByTag("NPCTAG"));
}

 

Change NPCTAG to the tag of the NPC to destroy. If that doesn't work either then you've either set an incorrect tag or your script isn't being run at all.

Link to comment
Share on other sites

Stupid me!!! I mixed up the Tag with the utc-file-name. It works very nice now!

 

Some questions regarding this script:

 

1. Its used for an npc using Bastila's utc-file named n_basvis.utc. The tag is Bastila obviously. If I destroy the npc, does it have repercussions on the rest of the game (anything regarding the real Bastila)? I tried to change the tag to another name, but it did not work.

 

2. As the script is fired with the last line of the dialogue with this npc its dialogue line vanishes imidiately, too. Is it possible to script a delay, so the line is readable?

 

Thanks and take care

Link to comment
Share on other sites

1. Its used for an npc using Bastila's utc-file named n_basvis.utc. The tag is Bastila obviously. If I destroy the npc, does it have repercussions on the rest of the game (anything regarding the real Bastila)? I tried to change the tag to another name, but it did not work.

 

If you haven't removed Bastila from the party table it shouldn't cause any trouble, since you only destroy the instance in the game world. The character stored in the party table would still be there and possible to spawn in normally via SpawnAvailableNPC().

 

2. As the script is fired with the last line of the dialogue with this npc its dialogue line vanishes imidiately, too. Is it possible to script a delay, so the line is readable?

 

If the last node in the dialog is an Entry, add a "goodbye" reply node to it or something and put the action script on that node instead.

Link to comment
Share on other sites

I expected as much.

 

Maybe I forgot it in my last couple of posts, but I'd like to thank you, stoffe, once again for your tremendous help, but also this whole community. I can't put it in better words because of lack of knowing the language: I feel very much supported by you people here!

 

Thanks and take care

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...