Aller au contenu

Photo

Removing a companion from the party on death.


  • Veuillez vous connecter pour répondre
4 réponses à ce sujet

#1
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
I have a companion that I want to be removed from the party if it dies.  I wrote a simple script that should do the job, but it does not.  I added some changes and the script does not seem to be firing.  I put the script in the "on death" event of the NPC in the toolset.  Does the game engine change the script set when an NPC becomes a companion?

**Note, based on the circumstances the NPC could be a henchman or companion, so I am covering both situations.  So far I've only tested the companion part. 

Here's the script:



void main()
{
object oPC = GetFirstPC();
object oSelf = OBJECT_SELF;
string sRosterName = GetRosterNameFromObject(oSelf);
if (sRosterName == "")
 {
 RemoveHenchman(GetMaster(oSelf));
 }
 
else
 {
 RemoveRosterMemberFromParty(sRosterName,oPC);
 }
}

#2
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
My suspicions were correct. When I modified the script "gb_comp_death", then I started getting results. This suggests to me that when you add an NPC to your party, the scripts you have placed in their events get changed to the standard companion scripts.

#3
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

M. Rieder wrote...

My suspicions were correct. When I modified the script "gb_comp_death", then I started getting results. This suggests to me that when you add an NPC to your party, the scripts you have placed in their events get changed to the standard companion scripts.



Hi Matt,

This is correct. The scripts *are* changed.

Look at the NWN_Scriptsets.2da and it will answer some of your questions. I use this 2da with my own line added to alter companions inm all sorts of ways. :)

Lance.

#4
Shallina

Shallina
  • Members
  • 1 011 messages
No the script aren't changed alone, but somme actions can not be performed on dead NPC with the default scripts.

#5
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
@ Lance



So with a new line, you can add your own custom scripts instead of the default ones, eh? Clever.





@Shallina

What actions can be performed with the default scripts?