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.

Script to remove an NPC

Page: 1 of 1
 JebusJM
05-17-2011, 10:59 PM
#1
I want to make a script and attach it to a dialog that will remove an NPC from the same module I'm in, but remove him during the conversation without the annoying "Global Fadeout".

Thanks.
 TimBob12
05-18-2011, 3:09 AM
#2
What do you mean global fadeout and have you tried


void main()
{
object NPC = GetObjectByTag("your_npc_tag");
DestroyObject(NPC, 0, FALSE, 0, 0);
}


The FALSE there stops the fade if thats what your looking for.
 JebusJM
05-18-2011, 4:56 AM
#3
Thanks, TimBob, I'll try it later on tonight.

This script stops the party selection popping up when I recruit my NPC:

void main()
{
ActionPauseConversation();
object oGoodbye;
oGoodbye = GetObjectByTag("my_npc_tag");
SetGlobalFadeOut(1.0, 0.5);
DelayCommand(1.0, DestroyObject(oGoodbye));
DelayCommand(1.0,SetGlobalFadeIn(0.7,0.0));
ActionResumeConversation();
}
 JebusJM
05-18-2011, 11:27 AM
#4
The script gave me a few errors, but for others looking, I found this one to work perfectly:

void main()
{
object oGoodbye;
oGoodbye = GetObjectByTag("npc_tag_here");
DelayCommand(1.0, DestroyObject(oGoodbye));
}

Thanks TimBob.
Page: 1 of 1