PDA

View Full Version : Recruitment Problem...


Godric Volturi
08-19-2009, 07:08 PM
Okay, so I got my scripts to finally compile, I /FINALLY/ figured out what was wrong. :P I was putting the "{" in the wrong spot. x_x

But anyway, now I have an error when recruiting the new party member... after I recruit the new member, a second copy is still there, the one I recruited and then the one that was spawned. So I was wondering how to destroy the spawned copy of the npc...

Lord of Hunger
08-19-2009, 08:36 PM
From the Recruitment tutorial....

Step 7 --> eliminate "twins" :

If you are recruiting an npc that is already used by the game, you may want to use an additional script or you may end up with twins. If you look at step 1 of this tutorial, you'll remember that we extracted the original .utc and renamed it. For the game these are two different objects, even if they have the same appearance. So when you recruit the npc, the original npc will still be there and you'll end up with 'twins". In order to avoid this, you can use the following script which will destroy the original npc on place: (note: don't look for this in the Dustil mod, it's not there. I made him run away instead of destroying him on place )


Code:
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();
}oGoodbye = GetObjectByTag("my_npc_tag"); (leave the quotes there) and replace my_npc_tag by the tag of the original npc in the the game. To get the tag, open the .utc file of the original npc in the game with a GFF editor or Kotor tool (for Dustil the .utc file is named kor35_dustil.utc) and check the tag field. The name of the .utc file does not always correspond to the tag field so always check.

Save your script with a .nss extension, compile and attach to dialog (do this at the very end of the conversation with the original npc or you'll ran into trouble if he disappears permanently before the end of the conversation ).

Godric Volturi
08-20-2009, 12:24 AM
Yeah, ya see... I tried that... but it didn't work. The "twin" was still there. >.< Oh well, not like it really matters... it's on the Endar Spire so the "twin is only there for like five seconds. :P

Canderis
08-20-2009, 12:33 AM
Yeah, ya see... I tried that... but it didn't work. The "twin" was still there. >.< Oh well, not like it really matters... it's on the Endar Spire so the "twin is only there for like five seconds. :P

what pard didn't work? Did it compile?

Godric Volturi
08-20-2009, 12:55 AM
Yeah, it compiled... it just didn't delete the NPC that started the recruitment... hmm... well I have an idea and if it doesn't work, I'll just see if I can get rid of the extra NPC that other way again... anyway, thanks for the help. :)

Totenkopf
08-20-2009, 01:11 AM
I tried something similiar inside the Taris hideout apt and tried several different scripts (including D333's example above), but none of them got rid of the "twin". It may just be that a disappearing/kill script doesn't work in some areas. If you can get it to work, let me see the .nss file you use. Either here or by pm. thanks.

Godric Volturi
08-21-2009, 08:27 AM
Alright! Thanks!

MishraArtificer
08-24-2009, 12:18 AM
A little quickie advice from what little I understood from my programming teacher? CHECK YOUR SEMICOLONS!